function getModuleDescription ($mode, $wht, $column = 'what') {
// Fix empty 'what'
if (empty($wht)) {
- $wht = "welcome";
+ $wht = 'welcome';
if (getConfig('index_home') != '') $wht = getConfig('index_home');
} // END - if
// Default is not found
- $ret = "??? (".$wht.')';
+ $ret = '??? (' . $wht . ')';
// Look for title
$result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE %s='%s' LIMIT 1",
case 'sponsor':
case 'guest':
case 'member':
- $modCheck = $GLOBALS['module'];
+ $modCheck = getModule();
break;
}
$AND = " AND (`what`='' OR `what` IS NULL)";
case 'guest':
case 'member':
- $modCheck = $GLOBALS['module'];
+ $modCheck = getModule();
if (!IS_ADMIN()) {
$AND = " AND `visible`='Y' AND `locked`='N'";
}
// Sponsor / engine menu
$type = 'what';
$search = $file;
- $modCheck = $GLOBALS['module'];
+ $modCheck = getModule();
$AND = '';
} else {
// Other
$type = "menu";
$search = $file;
- $modCheck = $GLOBALS['module'];
+ $modCheck = getModule();
$AND = '';
}
// Begin the navigation line
if ((!isset($GLOBALS['nav_depth'])) && (!$return)) {
$GLOBALS['nav_depth'] = 0;
- $prefix = "<div class=\"you_are_here\">{--YOU_ARE_HERE--} <strong><a class=\"you_are_here\" href=\"{!URL!}/modules.php?module=".$GLOBALS['module'].$LINK_ADD."\">Home</a></strong>";
+ $prefix = "<div class=\"you_are_here\">{--YOU_ARE_HERE--} <strong><a class=\"you_are_here\" href=\"{!URL!}/modules.php?module=".getModule().$LINK_ADD."\">Home</a></strong>";
} else {
if (!$return) $GLOBALS['nav_depth']++;
$prefix = '';
$OUT = $prefix."<strong><a class=\"you_are_here\" href=\"{!URL!}/modules.php?module=".$modCheck.'&'.$type.'='.$search.$LINK_ADD."\">".$ret."</a></strong>\n";
// Can we close the you-are-here navigation?
- //* DEBUG: */ echo __LINE__."*".$type.'/'.$GLOBALS['what']."*<br />\n";
- if (($type == 'what') || (($type == 'action') && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview")))) {
+ //* DEBUG: */ echo __LINE__."*".$type.'/'.getWhat()."*<br />\n";
+ if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
//* DEBUG: */ echo __LINE__.'+'.$type."+<br />\n";
// Add closing div and br-tag
$OUT .= "</div><br />\n";
// Load SQL data and add the menu to the output stream...
$result_main = SQL_QUERY_ESC("SELECT title, action FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE (`what`='' OR `what` IS NULL)".$AND." ORDER BY `sort`",
array($mode), __FUNCTION__, __LINE__);
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$main_action.'/'.$sub_what.':'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$main_action.'/'.$sub_what.':'.getWhat()."*<br />\n";
if (SQL_NUMROWS($result_main) > 0) {
OUTPUT_HTML("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"".$mode."_menu\">");
// There are menus available, so we simply display them... :)
while ($content = SQL_FETCHARRAY($result_main)) {
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$sub_what.':'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$sub_what.':'.getWhat()."*<br />\n";
// Init variables
$GLOBALS['block_mode'] = false;
$act = $content['action'];
}
// Navigation link
- $OUT .= "<a name=\"menu\" class=\"menu_blur\" href=\"{!URL!}/modules.php?module=".$GLOBALS['module']."&what=".$content['sub_what']."\" target=\"_self\">";
+ $OUT .= "<a name=\"menu\" class=\"menu_blur\" href=\"{!URL!}/modules.php?module=".getModule()."&what=".$content['sub_what']."\" target=\"_self\">";
} else {
$OUT .= "<em>";
}
if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML("<tr>
<td class=\"".$mode."_menu_whats\">");
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
loadInclude($INC_BLOCK);
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML(" </td>
</tr>");
}
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
}
$main_cnt++;
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
if (SQL_NUMROWS($result_main) > $main_cnt) {
OUTPUT_HTML("<tr><td class=\"".$mode."_menu_seperator\"></td></tr>");
} // END - if
SQL_FREERESULT($result_main);
// Close table
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
OUTPUT_HTML("</table>");
}
}
// Update guest or member menu
$sql = SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_%s_menu` SET counter=counter+1 WHERE `action`='%s' AND `what`='%s'".$add." LIMIT 1",
array($mode, $act, $wht), __FUNCTION__, __LINE__, false);
- } elseif (($wht != "overview") && (!empty($wht))) {
+ } elseif (($wht != 'overview') && (!empty($wht))) {
// Other actions
$sql = SQL_QUERY_ESC("SELECT id, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND `what`='%s'".$add." ORDER BY action DESC LIMIT 1",
array($mode, $act, $wht), __FUNCTION__, __LINE__, false);
}
// Get action value from mode (admin/guest/member) and what-value
-function getModeAction ($mode, &$wht) {
+function getModeAction ($mode, $wht) {
// Init status
$ret = '';
- //* DEBUG: */ echo __LINE__.'='.$mode.'/'.$wht.'/'.$GLOBALS['action']."=<br />";
+ //* DEBUG: */ echo __LINE__.'='.$mode.'/'.$wht.'/'.getAction()."=<br />";
if ((empty($wht)) && ($mode != 'admin')) {
- $wht = "welcome";
+ $wht = 'welcome';
if (getConfig('index_home') != '') $wht = getConfig('index_home');
} // END - if
if (REQUEST_ISSET_GET('action')) {
// Use from request!
return REQUEST_GET('action');
- } elseif (!empty($GLOBALS['action'])) {
+ } elseif (isActionSet()) {
// Get it directly from URL
- return $GLOBALS['action'];
- } elseif (($wht == "overview") || (empty($GLOBALS['what']))) {
+ return getAction();
+ } elseif (($wht == 'overview') || (!isWhatSet())) {
// Default value for admin area
- $ret = "login";
+ $ret = 'login';
}
- } elseif (!empty($GLOBALS['action'])) {
+ } elseif (isActionSet()) {
// Get it directly from URL
- return $GLOBALS['action'];
+ return getAction();
}
//* DEBUG: */ echo __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ret=".$ret."<br />\n";
// Rewriting modules to menu
switch ($mode) {
case 'index': $mode = 'guest'; break;
- case "login": $mode = 'member'; break;
+ case 'login': $mode = 'member'; break;
} // END - switch
- // Guest and member menu is "main" as the default
- if (empty($ret)) $ret = "main";
+ // Guest and member menu is 'main' as the default
+ if (empty($ret)) $ret = 'main';
// Load from database
$result = SQL_QUERY_ESC("SELECT action FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `what`='%s' LIMIT 1",
// Update config entries
function updateConfiguration ($entries, $values, $updateMode='') {
// Do not update config in CSS mode
- if (($GLOBALS['output_mode'] == '1') || ($GLOBALS['output_mode'] == -1)) {
+ if ((getOutputMode() == '1') || (getOutputMode() == -1)) {
return;
} // END - if