[ 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('BLOCK_FILE') ) { 16 Header("Location: ../index.php"); 17 die(); 18 } 19 20 global $prefix, $db, $admin, $language, $currentlang; 21 22 $ThemeSel = get_theme(); 23 if (file_exists("themes/$ThemeSel/module.php")) { 24 include("themes/".$ThemeSel."/module.php"); 25 if (is_active($default_module) AND file_exists("modules/$default_module/index.php")) { 26 $def_module = $default_module; 27 } else { 28 $def_module = ""; 29 } 30 } 31 32 $row = $db->sql_fetchrow($db->sql_query("SELECT main_module FROM ".$prefix."_main")); 33 $main_module = filter($row['main_module'], "nohtml"); 34 35 /* If the module doesn't exist, it will be removed from the database automaticaly */ 36 $result2 = $db->sql_query("SELECT title FROM " . $prefix . "_modules"); 37 while ($row2 = $db->sql_fetchrow($result2)) { 38 $title = filter($row2['title'], "nohtml"); 39 $a = 0; 40 $handle=opendir('modules'); 41 while ($file = readdir($handle)) { 42 if ($file == $title) { 43 $a = 1; 44 } 45 } 46 closedir($handle); 47 if ($a == 0) { 48 $db->sql_query("DELETE FROM ".$prefix."_modules WHERE title='$title'"); 49 } 50 } 51 52 /* Now we make the Modules block with the correspondent links */ 53 54 $content .= "<strong><big>·</big></strong> <a href=\"index.php\">"._HOME."</a><br>\n"; 55 $result3 = $db->sql_query("SELECT title, custom_title, view FROM " . $prefix . "_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC"); 56 while ($row3 = $db->sql_fetchrow($result3)) { 57 $m_title = filter($row3['title'], "nohtml"); 58 $custom_title = filter($row3['custom_title'], "nohtml"); 59 $view = intval($row3['view']); 60 $m_title2 = ereg_replace("_", " ", $m_title); 61 if ($custom_title != "") { 62 $m_title2 = $custom_title; 63 } 64 if ($m_title != $main_module) { 65 if ((is_admin($admin) AND $view == 2) OR $view != 2) { 66 $content .= "<strong><big>·</big></strong> <a href=\"modules.php?name=$m_title\">$m_title2</a><br>\n"; 67 } 68 } 69 } 70 71 /* If you're Admin you and only you can see Inactive modules and test it */ 72 /* If you copied a new module is the /modules/ directory, it will be added to the database */ 73 74 if (is_admin($admin)) { 75 $handle=opendir('modules'); 76 while ($file = readdir($handle)) { 77 if ( (!ereg("[.]",$file)) ) { 78 $modlist .= "$file "; 79 } 80 } 81 closedir($handle); 82 $modlist = explode(" ", $modlist); 83 sort($modlist); 84 for ($i=0; $i < sizeof($modlist); $i++) { 85 if($modlist[$i] != "") { 86 $row4 = $db->sql_fetchrow($db->sql_query("SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'")); 87 $mid = intval($row4['mid']); 88 $mod_uname = ereg_replace("_", " ", $modlist[$i]); 89 if ($mid == "") { 90 $db->sql_query("INSERT INTO ".$prefix."_modules VALUES (NULL, '$modlist[$i]', '$mod_uname', '0', '0', '1', '0')"); 91 } 92 } 93 } 94 $content .= "<br><center><b>"._INVISIBLEMODULES."</b><br>"; 95 $content .= "<font class=\"tiny\">"._ACTIVEBUTNOTSEE."</font></center><br>"; 96 $result5 = $db->sql_query("SELECT title, custom_title FROM ".$prefix."_modules WHERE active='1' AND inmenu='0' ORDER BY title ASC"); 97 while ($row5 = $db->sql_fetchrow($result5)) { 98 $mn_title = filter($row5['title'], "nohtml"); 99 $custom_title = filter($row5['custom_title'], "nohtml"); 100 $mn_title2 = ereg_replace("_", " ", $mn_title); 101 if ($custom_title != "") { 102 $mn_title2 = $custom_title; 103 } 104 if ($mn_title2 != "") { 105 $content .= "<strong><big>·</big></strong> <a href=\"modules.php?name=$mn_title\">$mn_title2</a><br>\n"; 106 $dummy = 1; 107 } else { 108 $a = 1; 109 } 110 } 111 if ($a == 1 AND $dummy != 1) { 112 $content .= "<strong><big>·</big></strong> <i>"._NONE."</i><br>\n"; 113 } 114 $content .= "<br><center><b>"._NOACTIVEMODULES."</b><br>"; 115 $content .= "<font class=\"tiny\">"._FORADMINTESTS."</font></center><br>"; 116 $result6 = $db->sql_query("SELECT title, custom_title FROM ".$prefix."_modules WHERE active='0' ORDER BY title ASC"); 117 while ($row6 = $db->sql_fetchrow($result6)) { 118 $mn_title = filter($row6['title'], "nohtml"); 119 $custom_title = filter($row6['custom_title'], "nohtml"); 120 $mn_title2 = ereg_replace("_", " ", $mn_title); 121 if (!empty($custom_title)) { 122 $mn_title2 = $custom_title; 123 } 124 if (!empty($mn_title2)) { 125 $content .= "<strong><big>·</big></strong> <a href=\"modules.php?name=$mn_title\">$mn_title2</a><br>\n"; 126 $dummy = 1; 127 } else { 128 $a = 1; 129 } 130 } 131 if ($a == 1 AND $dummy != 1) { 132 $content .= "<strong><big>·</big></strong> <i>"._NONE."</i><br>\n"; 133 } 134 } 135 136 ?>
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 |