home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 March / PCWorld_2001-03_cd.bin / KOMUNIK / progweb / progweb.exe / phpnuke / html / top.php < prev    next >
PHP Script  |  2000-12-05  |  5KB  |  125 lines

  1. <?php
  2.  
  3. ######################################################################
  4. # PHP-NUKE: Web Portal System
  5. # ===========================
  6. #
  7. # Copyright (c) 2000 by Francisco Burzi (fburzi@ncc.org.ve)
  8. # http://phpnuke.org
  9. #
  10. # This modules is for the top10 page generated in real time
  11. #
  12. # This program is free software. You can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License.
  15. ######################################################################
  16.  
  17. if(!isset($mainfile)) { include("mainfile.php"); }
  18. include("header.php");
  19.  
  20. echo "<font size=3>
  21.     <center>
  22.     <table cellpadding=2 cellspacing=0 bgcolor=000000 width=100% border=0><tr><td>
  23.     <table cellpadding=2 cellspacing=0 bgcolor=FFFFFF width=100% border=0><tr><td>
  24.     <font size=4>
  25.     <br><center><b>".translate("Welcome to the TOP page for")." $sitename!</b><br><br>";
  26.  
  27. // Top 10 read stories
  28.  
  29. $result = mysql_query("select sid, title, time, counter from stories order by counter DESC limit 0,$top");
  30.  
  31. echo "<table border=0 cellpadding=10 width=100%><tr><td align=left><font size=4>
  32.       <b>$top ".translate("most read stories")."</b><br><br><font size=3>";
  33. $lugar=1;
  34. while(list($sid, $title, $time, $counter) = mysql_fetch_row($result)) {
  35.     if($counter>0) {
  36.     echo "<li>$lugar: <a href=article.php?sid=$sid>$title</a> - (".translate("read:")." $counter ".translate("times").")<br>";
  37.     $lugar++;
  38.     }
  39. }
  40. mysql_free_result($result);
  41. echo "</td></tr></table><br>";
  42.  
  43. // Top 10 commented stories
  44.  
  45. $result = mysql_query("select sid, title, comments from stories order by comments DESC limit 0,$top");
  46.  
  47. echo "<table border=0 cellpadding=10 width=100%><tr><td align=left><font size=4>
  48.       <b>$top ".translate("most commented stories")."</b><br><br><font size=3>";
  49. $lugar=1;
  50. while(list($sid, $title, $comments) = mysql_fetch_row($result)) {
  51.     if($comments>0) {
  52.     echo "<li>$lugar: <a href=article.php?sid=$sid>$title</a> - (".translate("comments:")." $comments)<br>";
  53.     $lugar++;
  54.     }
  55. }
  56. mysql_free_result($result);
  57. echo "</td></tr></table><br>";
  58.  
  59. // Top 10 articles in special sections
  60.  
  61. $result = mysql_query("select artid, secid, title, content, counter from seccont order by counter DESC limit 0,$top");
  62.  
  63. echo "<table border=0 cellpadding=10 width=100%><tr><td align=left><font size=4>
  64.       <b>$top ".translate("most read articles in special sections")."</b><br><br><font size=3>";
  65. $lugar=1;
  66. while(list($artid, $secid, $title, $content, $counter) = mysql_fetch_row($result)) {
  67.     echo "<li>$lugar: <a href=sections.php?op=viewarticle&artid=$artid>$title</a> - (".translate("read:")." $counter ".translate("times").")<br>";
  68.     $lugar++;
  69. }
  70. mysql_free_result($result);
  71. echo "</td></tr></table><br>";
  72.  
  73. // Top 10 users submitters
  74.  
  75. $result = mysql_query("select uname, counter from users order by counter DESC limit 0,$top");
  76.  
  77. echo "<table border=0 cellpadding=10 width=100%><tr><td align=left><font size=4>
  78.       <b>$top ".translate("most active news submitters")."</b><br><br><font size=3>";
  79. $lugar=1;
  80. while(list($uname, $counter) = mysql_fetch_row($result)) {
  81.     if($counter>0) {
  82.     echo "<li>$lugar: <a href=user.php?op=userinfo&uname=$uname>$uname</a> - (".translate("sent news:")." $counter)<br>";
  83.     $lugar++;
  84.     }
  85. }
  86. mysql_free_result($result);
  87. echo "</td></tr></table><br>";
  88.  
  89. // Top 10 Polls
  90.  
  91. $result = mysql_query("select pollID, pollTitle, voters from poll_desc order by voters DESC limit 0,$top");
  92.  
  93. echo "<table border=0 cellpadding=10 width=100%><tr><td align=left><font size=4>
  94.       <b>$top ".translate("most voted polls")."</b><br><br><font size=3>";
  95. $lugar=1;
  96. while(list($pollID, $pollTitle, $voters) = mysql_fetch_row($result)) {
  97.     if($voters>0) {
  98.     echo "<li>$lugar: <a href=pollBooth.php?op=results&pollID=$pollID>$pollTitle</a> - (".translate("votes:")." $voters)<br>";
  99.     $lugar++;
  100.     }
  101. }
  102. mysql_free_result($result);
  103. echo "</td></tr></table><br>";
  104.  
  105. // Top 10 authors
  106.  
  107. $result = mysql_query("select aid, counter from authors order by counter DESC limit 0,$top");
  108.  
  109. echo "<table border=0 cellpadding=10 width=100%><tr><td align=left><font size=4>
  110.       <b>$top ".translate("most active authors")."</b><br><br><font size=3>";
  111. $lugar=1;
  112. while(list($aid, $counter) = mysql_fetch_row($result)) {
  113.     if($counter>0) {
  114.     echo "<li>$lugar: <a href=search.php?query=&author=$aid>$aid</a> - (".translate("news published:")." $counter)<br>";
  115.     $lugar++;
  116.     }
  117. }
  118. mysql_free_result($result);
  119. echo "</td></tr></table><br>
  120.     <br><br></center>
  121.     </td></tr></table></td></tr></table>";
  122.  
  123. include("footer.php");
  124. ?>
  125.