home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / unitednuke / unitednuke.exe / html / blocks / block-Top10_Downloads.php < prev    next >
PHP Script  |  2004-01-10  |  1KB  |  32 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* PHP-NUKE: Web Portal System                                          */
  5. /* ===========================                                          */
  6. /*                                                                      */
  7. /* Copyright (c) 2002 by Francisco Burzi                                */
  8. /* http://phpnuke.org                                                   */
  9. /*                                                                      */
  10. /* This program is free software. You can redistribute it and/or modify */
  11. /* it under the terms of the GNU General Public License as published by */
  12. /* the Free Software Foundation; either version 2 of the License.       */
  13. /************************************************************************/
  14.  
  15. if (eregi("block-Top10_Downloads.php",$_SERVER['PHP_SELF'])) {
  16.     Header("Location: index.php");
  17.     die();
  18. }
  19.  
  20. global $prefix, $db;
  21.  
  22. $a = 1;
  23. $result = $db->sql_query("SELECT lid, title FROM ".$prefix."_downloads_downloads ORDER BY hits DESC LIMIT 0,10");
  24. while ($row = $db->sql_fetchrow($result)) {
  25.     $lid = intval($row['lid']);
  26.     $title = stripslashes($row['title']);
  27.     $title2 = ereg_replace("_", " ", $title);
  28.     $content .= "<strong><big>·</big></strong> $a: <a href=\"modules.php?name=Downloads&d_op=viewdownloaddetails&lid=$lid&title=$title\">$title2</a><br>";
  29.     $a++;
  30. }
  31.  
  32. ?>