| [ 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 $pagetitle = "- "._ACTIVETOPICS.""; 23 include ("header.php"); 24 OpenTable(); 25 26 global $db, $prefix, $tipath; 27 $ThemeSel = get_theme(); 28 $sql = "SELECT t.topicid, t.topicimage, t.topictext, count(s.sid) AS stories, SUM(s.counter) AS reads FROM ".$prefix."_topics t LEFT JOIN ".$prefix."_stories s ON (s.topic = t.topicid) GROUP BY t.topicid, t.topicimage, t.topictext ORDER BY t.topictext"; 29 $result = $db->sql_query($sql); 30 if ($db->sql_numrows($result) > 0) { 31 $output = "<center><font class=\"title\"><b>"._ACTIVETOPICS."</b></font><br>\n"; 32 $output .= "<font class=\"content\">"._CLICK2LIST."</font><br><br>\n"; 33 $output .= "<form action=\"modules.php?name=Search\" method=\"post\">"; 34 $output .= "<input type=\"name\" name=\"query\" size=\"30\"> "; 35 $output .= "<input type=\"submit\" value=\""._SEARCH."\">"; 36 $output .= "</form></center><br><br>"; 37 echo $output; 38 while ($row = $db->sql_fetchrow($result)) { 39 $topicid = intval($row['topicid']); 40 $topicimage = stripslashes($row['topicimage']); 41 $topictext = stripslashes(check_html($row['topictext'], "nohtml")); 42 if(file_exists("themes/".$ThemeSel."/images/topics/".$topicimage)) { 43 $t_image = "themes/".$ThemeSel."/"; 44 } else { 45 $t_image = ""; 46 } 47 $t_image = $t_image.$tipath.$topicimage; 48 title($topictext); 49 $output = "<table border=\"1\" width=\"100%\" align=\"center\" cellpadding=\"2\">\n"; 50 $output .= "<tr><td valign=\"top\" width=\"25%\">"; 51 $output .= "<a href=modules.php?name=News&topic=$topicid><img src=\"$t_image\" border=\"0\" alt=\"$topictext\" title=\"$topictext\" hspace='5' vspace='5'></a><br><br>\n"; 52 $output .= "<font class=\"content\">"; 53 $output .= "<big><strong>·</strong></big> <b>"._TOPIC.":</b> $topictext<br>\n"; 54 $output .= "<big><strong>·</strong></big> <b>"._TOTNEWS.":</b> ".$row['stories']."<br>\n"; 55 $output .= "<big><strong>·</strong></big> <b>"._TOTREADS.":</b> ".(isset($row['reads']) ? $row['reads'] : 0)."</font>"; 56 $output .= "</td><td valign=\"top\">"; 57 echo $output; 58 59 if ($row['stories'] > 0) { 60 $sql2 = "SELECT s.sid, s.catid, s.title, c.title AS cat_title FROM ".$prefix."_stories s LEFT JOIN ".$prefix."_stories_cat c ON s.catid=c.catid WHERE s.topic='$topicid' ORDER BY s.sid DESC LIMIT 0,10"; 61 $result2 = $db->sql_query($sql2); 62 while ($row2 = $db->sql_fetchrow($result2)) { 63 $cat_link = (intval($row2['catid']) > 0) ? "<a href=\"modules.php?name=News&catid=".intval($row2['catid'])."\"><strong>".stripslashes(check_html($row2['cat_title'], "nohtml"))."</strong></a>: " : ""; 64 echo "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" /> $cat_link<a href=\"modules.php?name=News&file=article&sid=".intval($row2['sid'])."\">".htmlentities($row2['title'])."</a><br>"; 65 } 66 if ($row['stories'] > 10) { 67 echo "<div align=\"right\"><strong>·</strong> <a href=\"modules.php?name=News&topic=".$topicid."\"><strong>"._MORE." --></strong></a></div>"; 68 } 69 } else { 70 echo "<i>"._NONEWSYET."</i>"; 71 } 72 echo "</td></tr></table><br><br>"; 73 } 74 } else { 75 echo "<i>"._NONEWSYET."</i>"; 76 } 77 78 CloseTable(); 79 include ("footer.php"); 80 81 ?>
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 |