home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / unitednuke / unitednuke.exe / html / modules / News / print.php < prev   
PHP Script  |  2004-01-10  |  3KB  |  79 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", $_SERVER['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, $db, $module_name;
  28.     $sid = intval(trim($sid));
  29.     $row = $db->sql_fetchrow($db->sql_query("SELECT title, time, hometext, bodytext, topic, notes FROM ".$prefix."_stories WHERE sid='$sid'"));
  30.     $title = $row['title'];
  31.     $time = $row['time'];
  32.     $hometext = $row['hometext'];
  33.     $bodytext = $row['bodytext'];
  34.     $topic = $row['topic'];
  35.     $notes = $row['notes'];
  36.  
  37.     $row2 = $db->sql_fetchrow($db->sql_query("SELECT topictext FROM ".$prefix."_topics WHERE topicid='$topic'"));
  38.     $topictext = $row2['topictext'];
  39.  
  40.     formatTimestamp($time);
  41.     echo "
  42.     <html>
  43.     <head>
  44.     <title>$sitename - $title</title>
  45.     <META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset="._CHARSET."\">
  46.     </head>
  47.     <body bgcolor=\"#ffffff\" text=\"#000000\">
  48.     <table border=\"0\" align=\"center\"><tr><td>
  49.  
  50.     <table border=\"0\" width=\"640\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#000000\"><tr><td>
  51.     <table border=\"0\" width=\"640\" cellpadding=\"20\" cellspacing=\"1\" bgcolor=\"#ffffff\"><tr><td>
  52.     <center>
  53.     <img src=\"images/$site_logo\" border=\"0\" alt=\"\"><br><br>
  54.     <font class=\"content\">
  55.     <b>$title</b></font><br>
  56.     <font class=tiny><b>"._PDATE."</b> $datetime<br><b>"._PTOPIC."</b> $topictext</font><br><br>
  57.     </center>
  58.     <font class=\"content\">
  59.     $hometext<br><br>
  60.     $bodytext<br><br>
  61.     $notes<br><br>
  62.     </font>
  63.     </td></tr></table></td></tr></table>
  64.     <br><br><center>
  65.     <font class=\"content\">
  66.     "._COMESFROM." $sitename<br>
  67.     <a href=\"$nukeurl\">$nukeurl</a><br><br>
  68.     "._THEURL."<br>
  69.     <a href=\"".$nukeurl."/modules.php?name=$module_name&file=article&sid=$sid\">".$nukeurl."/modules.php?name=$module_name&file=article&sid=$sid</a>
  70.     </font>
  71.     </td></tr></table>
  72.     </body>
  73.     </html>
  74.     ";
  75. }
  76.  
  77. PrintPage($sid);
  78.  
  79. ?>