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