home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / modules / news / print.php < prev   
Encoding:
PHP Script  |  2002-09-16  |  2.7 KB  |  68 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("modules.php", $PHP_SELF)) {
  16.     die ("You can't access this file directly...");
  17. }
  18. require_once("mainfile.php");
  19. $module_name = basename(dirname(__FILE__));
  20. get_lang($module_name);
  21.  
  22. if(!isset($sid)) {
  23.     exit();
  24. }
  25.  
  26. function PrintPage($sid) {
  27.     global $site_logo, $nukeurl, $sitename, $datetime, $prefix, $dbi, $module_name;
  28.     $result = sql_query("select title, time, hometext, bodytext, topic, notes from ".$prefix."_stories where sid=$sid", $dbi);
  29.     list($title, $time, $hometext, $bodytext, $topic, $notes) = sql_fetch_row($result, $dbi);
  30.     $result2 = sql_query("select topictext from ".$prefix."_topics where topicid=$topic", $dbi);
  31.     list($topictext) = sql_fetch_row($result2, $dbi);
  32.     formatTimestamp($time);
  33.     echo "
  34.     <html>
  35.     <head><title>$sitename - $title</title></head>
  36.     <body bgcolor=\"#ffffff\" text=\"#000000\">
  37.     <table border=\"0\" align=\"center\"><tr><td>
  38.  
  39.     <table border=\"0\" width=\"640\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#000000\"><tr><td>
  40.     <table border=\"0\" width=\"640\" cellpadding=\"20\" cellspacing=\"1\" bgcolor=\"#ffffff\"><tr><td>
  41.     <center>
  42.     <img src=\"images/$site_logo\" border=\"0\" alt=\"\"><br><br>
  43.     <font class=\"content\">
  44.     <b>$title</b></font><br>
  45.     <font class=tiny><b>"._PDATE."</b> $datetime<br><b>"._PTOPIC."</b> $topictext</font><br><br>
  46.     </center>
  47.     <font class=\"content\">
  48.     $hometext<br><br>
  49.     $bodytext<br><br>
  50.     $notes<br><br>
  51.     </font>
  52.     </td></tr></table></td></tr></table>
  53.     <br><br><center>
  54.     <font class=\"content\">
  55.     "._COMESFROM." $sitename<br>
  56.     <a href=\"$nukeurl\">$nukeurl</a><br><br>
  57.     "._THEURL."<br>
  58.     <a href=\"$nukeurl/modules.php?name=$module_name&file=article&sid=$sid\">$nukeurl/modules.php?name=$module_name&file=article&sid=$sid</a>
  59.     </font>
  60.     </td></tr></table>
  61.     </body>
  62.     </html>
  63.     ";
  64. }
  65.  
  66. PrintPage($sid);
  67.  
  68. ?>