home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / blocks / block-last_5_articles.php < prev    next >
Encoding:
PHP Script  |  2002-09-16  |  1.9 KB  |  37 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. /* Block to fit perfectly in the center of the site, remember that not all
  16.    blocks looks good on Center, just try and see yourself what fits your needs */
  17.  
  18. if (eregi("block-Last_10_Articles.php", $PHP_SELF)) {
  19.     Header("Location: index.php");
  20.     die();
  21. }
  22.  
  23. global $prefix, $multilingual, $currentlang, $dbi;
  24.  
  25. if ($multilingual == 1) {
  26.     $querylang = "WHERE (alanguage='$currentlang' OR alanguage='')";
  27. } else {
  28.     $querylang = "";
  29. }
  30. $content = "<table width=\"100%\" border=\"0\">";
  31. $result = sql_query("select sid, title, comments, counter from ".$prefix."_stories $querylang order by sid DESC limit 0,5", $dbi);
  32. while(list($sid, $title, $comtotal, $counter) = sql_fetch_row($result, $dbi)) {
  33.     $content .= "<tr><td align=\"left\"><strong><big>·</big></strong> <a href=\"modules.php?name=News&file=article&sid=$sid\">$title</a></td><td align=\"right\">[ $comtotal "._COMMENTS." - $counter "._READS." ]</td></tr>";
  34. }
  35. $content .= "</table>";
  36. $content .= "<br><center>[ <a href=\"modules.php?name=News\">"._MORENEWS."</a> ]</center>";
  37. ?>