[ Index ] |
|
Code source de PHP NUKE 7.9 |
1 <?php 2 3 /************************************************************************/ 4 /* PHP-NUKE: Web Portal System */ 5 /* =========================== */ 6 /* */ 7 /* Copyright (c) 2005 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 (!defined('MODULE_FILE')) { 16 die ("You can't access this file directly..."); 17 } 18 19 require_once ("mainfile.php"); 20 $module_name = basename(dirname(__FILE__)); 21 get_lang($module_name); 22 23 function avtgo() { 24 global $sitename, $slogan, $db, $prefix, $module_name, $site_logo, $Default_Theme; 25 if (file_exists("themes/$Default_Theme/images/logo.gif")) { 26 $avantgo_logo = "themes/$Default_Theme/images/logo.gif"; 27 } elseif (file_exists("images/$site_logo")) { 28 $avantgo_logo = "images/$site_logo"; 29 } elseif (file_exists("images/logo.gif")) { 30 $avantgo_logo = "images/logo.gif"; 31 } else { 32 $avantgo_logo = ""; 33 } 34 header("Content-Type: text/html"); 35 echo "<html>\n" 36 ."<head>\n" 37 ."<title>$sitename - AvantGo</title>\n" 38 ."<meta name=\"HandheldFriendly\" content=\"True\">\n" 39 ."</head>\n" 40 ."<body>\n\n\n" 41 ."<div align=\"center\">\n"; 42 $result = $db->sql_query("SELECT sid, title, time FROM ".$prefix."_stories ORDER BY sid DESC LIMIT 10"); 43 if (empty($result)) { 44 echo "An error occured"; 45 } else { 46 echo "\t<a href=\"index.php\"><img src=\"$avantgo_logo\" alt=\"$slogan\" title=\"$slogan\" border=\"0\"></a><br><br>\r\n" 47 ."\t<table border=\"0\" align=\"center\">\r\n" 48 ."\t\t<tr>\r\n" 49 ."\t\t\t<td bgcolor=\"#efefef\">"._TITLE."</td>\r\n" 50 ."\t\t\t<td bgcolor=\"#efefef\">"._DATE."</td>\r\n" 51 ."\t\t</tr>\r\n"; 52 for ($m=0; $m < $db->sql_numrows($result); $m++) { 53 $row = $db->sql_fetchrow($result); 54 $sid = intval($row['sid']); 55 $title = filter($row['title'], "nohtml"); 56 $time = $row['time']; 57 echo "\t\t<tr>\r\n" 58 ."\t\t\t<td><a href=\"modules.php?name=$module_name&op=ReadStory&sid=$sid\">$title</a></td>\r\n" 59 ."\t\t\t<td>$time</td>\r\n" 60 ."\t\t</tr>\r\n"; 61 } 62 echo"\t</table>\r\n"; 63 } 64 echo "</body>\n" 65 ."</html>"; 66 include ("includes/counter.php"); 67 die(); 68 } 69 70 function ReadStory($sid) { 71 global $site_logo, $nukeurl, $sitename, $datetime, $prefix, $db, $module_name; 72 $sid = intval($sid); 73 $num = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_stories WHERE sid='$sid'")); 74 if ($num == 0) { 75 Header("Location: modules.php?name=$module_name"); 76 die(); 77 } 78 $sid = intval(trim($sid)); 79 $row = $db->sql_fetchrow($db->sql_query("SELECT title, time, hometext, bodytext, topic, notes FROM ".$prefix."_stories WHERE sid='$sid'")); 80 $title = filter($row['title'], "nohtml"); 81 $time = $row['time']; 82 $hometext = filter($row['hometext']); 83 $bodytext = filter($row['bodytext']); 84 $topic = intval($row['topic']); 85 $notes = filter($row['notes']); 86 $row2 = $db->sql_fetchrow($db->sql_query("SELECT topictext FROM ".$prefix."_topics WHERE topicid='$topic'")); 87 $topictext = filter($row2['topictext'], "nohtml"); 88 formatTimestamp($time); 89 echo " 90 <html> 91 <head> 92 <title>$sitename - $title</title> 93 <meta name=\"HandheldFriendly\" content=\"True\"> 94 </head> 95 <body bgcolor=\"#ffffff\" text=\"#000000\"> 96 <table border=\"0\" align=\"center\"><tr><td> 97 <table border=\"0\" width=\"640\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#000000\"><tr><td> 98 <table border=\"0\" width=\"640\" cellpadding=\"20\" cellspacing=\"1\" bgcolor=\"#ffffff\"><tr><td> 99 <center> 100 <img src=\"images/$site_logo\" border=\"0\" alt=\"\"><br><br> 101 <font class=\"content\"> 102 <b>$title</b></font><br> 103 <font class=tiny><b>"._PDATE."</b> $datetime<br><b>"._PTOPIC."</b> $topictext</font><br><br> 104 </center> 105 <font class=\"content\"> 106 $hometext<br><br> 107 $bodytext<br><br> 108 $notes<br><br> 109 </font> 110 </td></tr></table></td></tr></table> 111 <br><br><center> 112 <font class=\"content\"> 113 "._COMESFROM." $sitename<br> 114 <a href=\"$nukeurl\">$nukeurl</a><br><br> 115 "._THEURL."<br> 116 <a href=\"$nukeurl/modules.php?name=News&file=article&sid=$sid\">$nukeurl/modules.php?name=News&file=article&sid=$sid</a> 117 </font> 118 </td></tr></table> 119 </body> 120 </html> 121 "; 122 } 123 124 switch($op) { 125 126 case "ReadStory": 127 ReadStory($sid); 128 break; 129 130 default: 131 avtgo(); 132 break; 133 } 134 135 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 11:11:59 2007 | par Balluche grâce à PHPXref 0.7 |