home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / phpnuke / PHP-Nuke-7.5.exe / html / modules / News / print.php < prev   
PHP Script  |  2004-08-21  |  3KB  |  77 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. /*         Additional security & Abstraction layer conversion           */
  15. /*                           2003 chatserv                              */
  16. /*      http://www.nukefixes.com -- http://www.nukeresources.com        */
  17. /************************************************************************/
  18.  
  19. if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
  20.     die ("You can't access this file directly...");
  21. }
  22. require_once("mainfile.php");
  23. $module_name = basename(dirname(__FILE__));
  24. get_lang($module_name);
  25.  
  26. if(!isset($sid)) {
  27.     exit();
  28. }
  29.  
  30. function PrintPage($sid) {
  31.     global $site_logo, $nukeurl, $sitename, $datetime, $prefix, $db, $module_name;
  32.     $sid = intval($sid);
  33.     $row = $db->sql_fetchrow($db->sql_query("SELECT title, time, hometext, bodytext, topic, notes FROM ".$prefix."_stories WHERE sid='$sid'"));
  34.     $title = stripslashes(check_html($row['title'], "nohtml"));
  35.     $time = $row['time'];
  36.     $hometext = stripslashes($row['hometext']);
  37.     $bodytext = stripslashes($row['bodytext']);
  38.     $topic = intval($row['topic']);
  39.     $notes = stripslashes($row['notes']);
  40.     $row2 = $db->sql_fetchrow($db->sql_query("SELECT topictext FROM ".$prefix."_topics WHERE topicid='$topic'"));
  41.     $topictext = stripslashes($row2['topictext']);
  42.     formatTimestamp($time);
  43.     echo "<html>
  44.         <head><title>$sitename - $title</title></head>
  45.         <body bgcolor=\"#ffffff\" text=\"#000000\">
  46.         <table border=\"0\" align=\"center\"><tr><td>
  47.     
  48.         <table border=\"0\" width=\"640\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#000000\"><tr><td>
  49.         <table border=\"0\" width=\"640\" cellpadding=\"20\" cellspacing=\"1\" bgcolor=\"#ffffff\"><tr><td>
  50.         <center>
  51.         <img src=\"images/$site_logo\" border=\"0\" alt=\"\"><br><br>
  52.         <font class=\"content\">
  53.         <b>$title</b></font><br>
  54.         <font class=tiny><b>"._PDATE."</b> $datetime<br><b>"._PTOPIC."</b> $topictext</font><br><br>
  55.         </center>
  56.         <font class=\"content\">
  57.         $hometext<br><br>
  58.         $bodytext<br><br>
  59.         $notes<br><br>
  60.         </font>
  61.         </td></tr></table></td></tr></table>
  62.         <br><br><center>
  63.         <font class=\"content\">
  64.         "._COMESFROM." $sitename<br>
  65.         <a href=\"$nukeurl\">$nukeurl</a><br><br>
  66.         "._THEURL."<br>
  67.         <a href=\"$nukeurl/modules.php?name=$module_name&file=article&sid=$sid\">$nukeurl/modules.php?name=$module_name&file=article&sid=$sid</a>
  68.         </font>
  69.         </td></tr></table>
  70.         </body>
  71.         </html>";
  72.     die();
  73. }
  74.  
  75. PrintPage($sid);
  76.  
  77. ?>