| [ 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 $pagetitle = "- $module_name"; 24 25 function showpage($pid, $page=0) { 26 global $prefix, $db, $sitename, $admin, $module_name; 27 include ("header.php"); 28 OpenTable(); 29 $pid = intval($pid); 30 $mypage = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_pages WHERE pid='$pid'")); 31 $myactive = intval($mypage['active']); 32 $mytitle = filter($mypage['title'], "nohtml"); 33 $mysubtitle = filter($mypage['subtitle'], "nohtml"); 34 $mypage_header = filter($mypage['page_header']); 35 $mytext = filter($mypage['text']); 36 $mypage_footer = filter($mypage['page_footer']); 37 $mysignature = filter($mypage['signature']); 38 $mydate = $mypage['date']; 39 $mycounter = intval($mypage['counter']); 40 if (($myactive == 0) AND (!is_admin($admin))) { 41 echo "Sorry... This page doesn't exist."; 42 } else { 43 $db->sql_query("UPDATE ".$prefix."_pages SET counter=counter+1 WHERE pid='$pid'"); 44 $date = explode(" ", $mydate); 45 echo "<font class=\"title\">$mytitle</font><br>" 46 ."<font class=\"content\">$mysubtitle<br><br><br><br>"; 47 $contentpages = explode( "[--pagebreak--]", $mytext ); 48 $pageno = count($contentpages); 49 if ( empty($page) || $page < 1 ) 50 $page = 1; 51 if ( $page > $pageno ) 52 $page = $pageno; 53 $arrayelement = (int)$page; 54 $arrayelement --; 55 if ($pageno > 1) { 56 echo ""._PAGE.": $page/$pageno<br>"; 57 } 58 if ($page == 1) { 59 echo "<p align=\"justify\">".nl2br($mypage_header)."</p><br>"; 60 } 61 echo "<p align=\"justify\">$contentpages[$arrayelement]</p>"; 62 if($page >= $pageno) { 63 $next_page = ""; 64 } else { 65 $next_pagenumber = $page + 1; 66 if ($page != 1) { 67 $next_page .= "- "; 68 } 69 $next_page .= "<a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid&page=$next_pagenumber\">"._NEXT." ($next_pagenumber/$pageno)</a> <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid&page=$next_pagenumber\"><img src=\"images/right.gif\" border=\"0\" alt=\""._NEXT."\" title=\""._NEXT."\"></a>"; 70 } 71 if ($page == $pageno) { 72 echo "<br><p align=\"justify\">".nl2br($mypage_footer)."</p><br><br>"; 73 } 74 if($page <= 1) { 75 $previous_page = ""; 76 } else { 77 $previous_pagenumber = $page - 1; 78 $previous_page = "<a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid&page=$previous_pagenumber\"><img src=\"images/left.gif\" border=\"0\" alt=\""._PREVIOUS."\" title=\""._PREVIOUS."\"></a> <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid&page=$previous_pagenumber\">"._PREVIOUS." ($previous_pagenumber/$pageno)</a>"; 79 } 80 echo "<br><br><br><center>$previous_page $next_page</center><br><br>"; 81 if ($page == $pageno) { 82 echo "<p align=\"right\">".nl2br($mysignature)."</p>" 83 ."<p align=\"right\">"._COPYRIGHT." $sitename "._COPYRIGHT2."</p>" 84 ."<p align=\"right\"><font class=\"tiny\">"._PUBLISHEDON.": $date[0] ($mycounter "._READS.")</font></p>" 85 ."<center>"._GOBACK."</center>"; 86 } 87 } 88 CloseTable(); 89 include ("footer.php"); 90 } 91 92 function list_pages() { 93 global $prefix, $db, $sitename, $admin, $multilingual, $module_name, $admin_file; 94 include ("header.php"); 95 title("$sitename: "._PAGESLIST.""); 96 OpenTable(); 97 echo "<center><font class=\"content\">"._LISTOFCONTENT." $sitename:</center><br><br>"; 98 $result = $db->sql_query("SELECT * FROM ".$prefix."_pages_categories"); 99 $numrows = $db->sql_numrows($result); 100 $numrows2 = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_pages WHERE cid!='0' AND active='1'")); 101 if ($numrows > 0 AND $numrows2 > 0) { 102 echo "<center>"._CONTENTCATEGORIES."</center><br><br>" 103 ."<table border=\"1\" align=\"center\" width=\"95%\">"; 104 while ($row = $db->sql_fetchrow($result)) { 105 $cid = intval($row['cid']); 106 $title = filter($row['title'], "nohtml"); 107 $description = filter($row['description']); 108 $numrows3 = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_pages WHERE cid='$cid'")); 109 if ($numrows3 > 0) { 110 echo "<tr><td valign=\"top\"> <a href=\"modules.php?name=$module_name&pa=list_pages_categories&cid=$cid\">$title</a> </td><td align=\"left\">$description</td></tr>"; 111 } 112 } 113 echo "</td></tr></table><br><br>" 114 ."<center>"._NONCLASSCONT."</center><br><br>"; 115 } 116 $result4 = $db->sql_query("SELECT pid, title, subtitle, clanguage FROM ".$prefix."_pages WHERE active='1' AND cid='0' ORDER BY date"); 117 echo "<blockquote>"; 118 while ($row4 = $db->sql_fetchrow($result4)) { 119 $pid = intval($row4['pid']); 120 $title = filter($row4['title'], "nohtml"); 121 $subtitle = filter($row4['subtitle'], "nohtml"); 122 $clanguage = $row4['clanguage']; 123 if ($multilingual == 1) { 124 $the_lang = "<img src=\"images/language/flag-".$clanguage.".png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\">"; 125 } else { 126 $the_lang = ""; 127 } 128 if (!empty($subtitle)) { 129 $subtitle = " ($subtitle)"; 130 } else { 131 $subtitle = ""; 132 } 133 if (is_admin($admin)) { 134 echo "<strong><big>·</big></strong> $the_lang <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid\">$title</a> $subtitle [ <a href=\"".$admin_file.".php?op=content_edit&pid=$pid\">"._EDIT."</a> | <a href=\"".$admin_file.".php?op=content_change_status&pid=$pid&active=1\">"._DEACTIVATE."</a> | <a href=\"".$admin_file.".php?op=content_delete&pid=$pid\">"._DELETE."</a> ]<br>"; 135 } else { 136 echo "<strong><big>·</big></strong> $the_lang <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid\">$title</a> $subtitle<br>"; 137 } 138 } 139 echo "</blockquote>"; 140 if (is_admin($admin)) { 141 $result5 = $db->sql_query("SELECT pid, cid, title, subtitle, clanguage FROM ".$prefix."_pages WHERE active='0' ORDER BY date"); 142 echo "<br><br><center><b>"._YOURADMINLIST."</b></center><br><br>"; 143 echo "<blockquote>"; 144 while ($row5 = $db->sql_fetchrow($result5)) { 145 $pid = intval($row5['pid']); 146 $cid = intval($row5['cid']); 147 $title = filter($row5['title'], "nohtml"); 148 $subtitle = filter($row5['subtitle'], "nohtml"); 149 $clanguage = $row5['clanguage']; 150 if ($multilingual == 1) { 151 $the_lang = "<img src=\"images/language/flag-".$clanguage.".png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\">"; 152 } else { 153 $the_lang = ""; 154 } 155 if (!empty($subtitle)) { 156 $subtitle = " ($subtitle) "; 157 } else { 158 $subtitle = " "; 159 } 160 echo "<strong><big>·</big></strong> $the_lang <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid\">$title</a> $subtitle [ <a href=\"".$admin_file.".php?op=content_edit&pid=$pid\">"._EDIT."</a> | <a href=\"".$admin_file.".php?op=content_change_status&pid=$pid&active=0\">"._ACTIVATE."</a> | <a href=\"".$admin_file.".php?op=content_delete&pid=$pid\">"._DELETE."</a> ]<br>"; 161 } 162 echo "</blockquote>"; 163 } 164 CloseTable(); 165 include ("footer.php"); 166 } 167 168 function list_pages_categories($cid) { 169 global $prefix, $db, $sitename, $admin, $multilingual, $module_name, $admin_file; 170 include ("header.php"); 171 title("$sitename: "._PAGESLIST.""); 172 OpenTable(); 173 echo "<center><font class=\"content\">"._LISTOFCONTENT." $sitename:</center><br><br>"; 174 $cid = intval($cid); 175 $result = $db->sql_query("SELECT pid, title, subtitle, clanguage FROM ".$prefix."_pages WHERE active='1' AND cid='$cid' ORDER BY date"); 176 echo "<blockquote>"; 177 while ($row = $db->sql_fetchrow($result)) { 178 $pid = intval($row['pid']); 179 $title = filter($row['title'], "nohtml"); 180 $subtitle = filter($row['subtitle'], "nohtml"); 181 $clanguage = $row['clanguage']; 182 if ($multilingual == 1) { 183 $the_lang = "<img src=\"images/language/flag-".$clanguage.".png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\">"; 184 } else { 185 $the_lang = ""; 186 } 187 if (!empty($subtitle)) { 188 $subtitle = " ($subtitle)"; 189 } else { 190 $subtitle = ""; 191 } 192 if (is_admin($admin)) { 193 echo "<strong><big>·</big></strong> $the_lang <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid\">$title</a> $subtitle [ <a href=\"".$admin_file.".php?op=content_edit&pid=$pid\">"._EDIT."</a> | <a href=\"".$admin_file.".php?op=content_change_status&pid=$pid&active=1\">"._DEACTIVATE."</a> | <a href=\"".$admin_file.".php?op=content_delete&pid=$pid\">"._DELETE."</a> ]<br>"; 194 } else { 195 echo "<strong><big>·</big></strong> $the_lang <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid\">$title</a> $subtitle<br>"; 196 } 197 } 198 echo "</blockquote>"; 199 if (is_admin($admin)) { 200 $result2 = $db->sql_query("SELECT pid, title, subtitle, clanguage FROM ".$prefix."_pages WHERE active='0' AND cid='$cid' ORDER BY date"); 201 echo "<br><br><center><b>"._YOURADMINLIST."</b></center><br><br>"; 202 echo "<blockquote>"; 203 while ($row2 = $db->sql_fetchrow($result2)) { 204 $pid = intval($row2['pid']); 205 $title = filter($row2['title'], "nohtml"); 206 $subtitle = filter($row2['subtitle'], "nohtml"); 207 $clanguage = $row2['clanguage']; 208 if ($multilingual == 1) { 209 $the_lang = "<img src=\"images/language/flag-".$clanguage.".png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\">"; 210 } else { 211 $the_lang = ""; 212 } 213 if (!empty($subtitle)) { 214 $subtitle = " ($subtitle) "; 215 } else { 216 $subtitle = " "; 217 } 218 echo "<strong><big>·</big></strong> $the_lang <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid\">$title</a> $subtitle [ <a href=\"".$admin_file.".php?op=content_edit&pid=$pid\">"._EDIT."</a> | <a href=\"".$admin_file.".php?op=content_change_status&pid=$pid&active=0\">"._ACTIVATE."</a> | <a href=\"".$admin_file.".php?op=content_delete&pid=$pid\">"._DELETE."</a> ]<br>"; 219 } 220 echo "</blockquote>"; 221 } 222 echo "<center>"._GOBACK."</center>"; 223 CloseTable(); 224 include ("footer.php"); 225 } 226 227 if (!isset($page)) { $page = ""; } 228 if (!isset($pa)) { $pa = ""; } 229 230 switch($pa) { 231 232 case "showpage": 233 showpage($pid, $page); 234 break; 235 236 case "list_pages_categories": 237 list_pages_categories($cid); 238 break; 239 240 default: 241 list_pages(); 242 break; 243 244 } 245 246 ?>
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 |