From: Roland Häder Date: Tue, 28 Jul 2009 18:50:32 +0000 (+0000) Subject: 'what','action','module' and 'output_mode' wrapped into functions (WARNUNG: Code... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=03f62d0b89aa9276ac37f4d616d940fae184d850;p=mailer.git 'what','action','module' and 'output_mode' wrapped into functions (WARNUNG: Code may be broken) --- diff --git a/inc/check-reset.php b/inc/check-reset.php index 56ffcadbbc..b6d315ce7e 100644 --- a/inc/check-reset.php +++ b/inc/check-reset.php @@ -44,7 +44,7 @@ if (!defined('__SECURITY')) { // Shall we run the reset scripts? If a day has changed, maybe also a week/month has changed... Simple! :D // 01 2 3 32 2 3321 1 221 1 221 1 221 1 23 321 1 10 -if ((date('d', getConfig('last_update')) != date('d', time())) && (!isInstalling()) && (isInstalled()) && (isAdminRegistered()) && (!REQUEST_ISSET_GET(('register'))) && ($GLOBALS['output_mode'] != 1)) { +if ((date('d', getConfig('last_update')) != date('d', time())) && (!isInstalling()) && (isInstalled()) && (isAdminRegistered()) && (!REQUEST_ISSET_GET(('register'))) && (getOutputMode() != 1)) { // Tell every module we are in reset-mode! enableResetMode(); diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index b62e913284..ccdfd8e9f7 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -90,14 +90,14 @@ Query string:
// Debug output //* DEBUG: */ print "Query=
".$sql_string."
, affected=".SQL_AFFECTEDROWS().", numrows=".SQL_NUMROWS($result)."
\n"; - if (($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1') && (isDebugModeEnabled()) && (getConfig('DEBUG_SQL') == 'Y')) { + if ((getOutputMode() != '1') && (getOutputMode() != '-1') && (isDebugModeEnabled()) && (getConfig('DEBUG_SQL') == 'Y')) { // // Debugging stuff... // $fp = fopen(constant('PATH') . 'inc/cache/mysql.log', 'a') or app_die(__FILE__, __LINE__, "Cannot write mysql.log!"); if (!isset($GLOBALS['sql_first_entry'])) { // Write first entry - fwrite($fp, 'Module=' . $GLOBALS['module'] . "\n"); + fwrite($fp, 'Module=' . getModule() . "\n"); $GLOBALS['sql_first_entry'] = true; } // END - if fwrite($fp, $F."(LINE=".$L."|NUM=".SQL_NUMROWS($result)."|AFFECTED=".SQL_AFFECTEDROWS()."|QUERYTIME:".$queryTime."): ".str_replace("\r", '', str_replace("\n", " ", $sql_string))."\n"); diff --git a/inc/extensions/ext-autopurge.php b/inc/extensions/ext-autopurge.php index ff38a3f649..cbad4cbfed 100644 --- a/inc/extensions/ext-autopurge.php +++ b/inc/extensions/ext-autopurge.php @@ -257,7 +257,7 @@ switch ($EXT_LOAD_MODE) default: // Do stuff when extension is loaded // Do we have a daily-reset-run? - if (isResetModeEnabled() && (!isDebugModeEnabled()) && ($GLOBALS['output_mode'] != 1)) { + if (isResetModeEnabled() && (!isDebugModeEnabled()) && (getOutputMode() != 1)) { // Yes, we have. So let's auto-purge some campaigns, inactive users and unconfirmed accounts ADD_INC_TO_POOL(sprintf("%sinc/autopurge.php", constant('PATH'))); } diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index c8485ca186..25c62db6e2 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -550,7 +550,7 @@ WHERE `last_online` < ".$mark." ORDER BY `userid` ASC"); break; default: // Do stuff when extension is loaded - if (isResetModeEnabled() && (!isDebugModeEnabled()) && ($GLOBALS['output_mode'] != 1)) { + if (isResetModeEnabled() && (!isDebugModeEnabled()) && (getOutputMode() != 1)) { // Daily reset was run so let's check if active rallye is activated if (getConfig('bonus_active') == 'Y') { // Run active rallye diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php index d3c1a6528b..28bc122871 100644 --- a/inc/extensions/ext-newsletter.php +++ b/inc/extensions/ext-newsletter.php @@ -172,7 +172,7 @@ switch ($EXT_LOAD_MODE) '2','3','4','5','6','7','8','9' ); - if (isResetModeEnabled() && (!isDebugModeEnabled()) && ($GLOBALS['output_mode'] != 1)) { + if (isResetModeEnabled() && (!isDebugModeEnabled()) && (getOutputMode() != 1)) { // Daily reset was run so let's check out for expired newsletter orders ADD_INC_TO_POOL(sprintf("%sinc/monthly/monthly_newsletter.php", constant('PATH'))); } diff --git a/inc/extensions/ext-profile.php b/inc/extensions/ext-profile.php index 8edcb43f20..0947f988cc 100644 --- a/inc/extensions/ext-profile.php +++ b/inc/extensions/ext-profile.php @@ -128,7 +128,7 @@ switch ($EXT_LOAD_MODE) default: // Do stuff when extension is loaded // Do we have a daily-reset-run? - if (isResetModeEnabled() && (!isDebugModeEnabled()) && ($GLOBALS['output_mode'] != 1)) { + if (isResetModeEnabled() && (!isDebugModeEnabled()) && (getOutputMode() != 1)) { // So let's check for profiles which needs an update ADD_INC_TO_POOL(sprintf("%sinc/profile-updte.php", constant('PATH'))); } diff --git a/inc/extensions/ext-rallye.php b/inc/extensions/ext-rallye.php index 694a984d3c..8d2f9dd419 100644 --- a/inc/extensions/ext-rallye.php +++ b/inc/extensions/ext-rallye.php @@ -329,7 +329,7 @@ Zudem sollten Sie mindestens folgende Templates (in templates/".getLangu default: // Do stuff when extension is loaded // Do stuff only when not in CSS mode - if (($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1') && ($GLOBALS['cache_mode'] != 'init')) { + if ((getOutputMode() != '1') && (getOutputMode() != '-1') && ($GLOBALS['cache_mode'] != 'init')) { // Get total member count $total = GET_TOTAL_DATA('CONFIRMED', 'user_data', 'userid', 'status', true); diff --git a/inc/filters.php b/inc/filters.php index 6d92d6a654..6d02e30e84 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -329,8 +329,8 @@ function FILTER_CALL_HANDLER_LOGIN_FAILTURES ($data) { $content = $data; // Handle failed logins here if not in guest - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):type={$data['type']},action={$GLOBALS['action']},what={$GLOBALS['what']},lvl={$data['access_level']}
\n"; - if ((($data['type'] == 'what') || ($data['type'] == 'action') && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview") || ($GLOBALS['what'] == getConfig('index_home')))) && ($data['access_level'] != 'guest') && ((GET_EXT_VERSION('sql_patches') >= '0.4.7') || (GET_EXT_VERSION('admins') >= '0.7.0'))) { + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):type={$data['type']},action={getAction()},what={getWhat()},lvl={$data['access_level']}
\n"; + if ((($data['type'] == 'what') || ($data['type'] == 'action') && ((!isWhatSet()) || (getWhat() == 'overview') || (getWhat() == getConfig('index_home')))) && ($data['access_level'] != 'guest') && ((GET_EXT_VERSION('sql_patches') >= '0.4.7') || (GET_EXT_VERSION('admins') >= '0.7.0'))) { // Handle failure $content['content'] .= HANDLE_LOGIN_FAILTURES($data['access_level']); } // END - if @@ -468,7 +468,7 @@ function FILTER_UPDATE_LOGIN_DATA () { list($mod, $onl) = SQL_FETCHROW($result); // Maybe first login time? - if (empty($mod)) $mod = "login"; + if (empty($mod)) $mod = 'login'; // This will be displayed on welcome page! :-) if (empty($GLOBALS['last']['module'])) { @@ -476,15 +476,15 @@ function FILTER_UPDATE_LOGIN_DATA () { } // END - if // 'what' not set? - if (empty($GLOBALS['what'])) { + if (!isWhatSet()) { // Fix it to default - $GLOBALS['what'] = "welcome"; - if (getConfig('index_home') != '') $GLOBALS['what'] = getConfig('index_home'); + setWhat('welcome'); + if (getConfig('index_home') != '') setWhatFromConfig('index_home'); } // END - if // Update last module / online time SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `last_module`='%s', last_online=UNIX_TIMESTAMP(), REMOTE_ADDR='%s' WHERE userid=%s LIMIT 1", - array($GLOBALS['what'], detectRemoteAddr(), getUserId()), __FUNCTION__, __LINE__); + array(getWhat(), detectRemoteAddr(), getUserId()), __FUNCTION__, __LINE__); } else { // Destroy session, we cannot update! destroyUserSession(); @@ -502,14 +502,14 @@ function FILTER_CHECK_ADMIN_ACL () { // Ok, Cookie-Update done if ((GET_EXT_VERSION('admins') >= '0.3.0') && (EXT_IS_ACTIVE('admins'))) { // Check if action GET variable was set - $action = SQL_ESCAPE($GLOBALS['action']); - if (!empty($GLOBALS['what'])) { + $action = getAction(); + if (isWhatSet()) { // Get action value by what-value - $action = getModeAction('admin', $GLOBALS['what']); + $action = getModeAction('admin', getWhat()); } // END - if // Check for access control line of current menu entry - $ret = adminsCheckAdminAcl($action, $GLOBALS['what']); + $ret = adminsCheckAdminAcl($action, getWhat()); } // END - if // Return result diff --git a/inc/footer.php b/inc/footer.php index e691b2ce62..f35efd9cbf 100644 --- a/inc/footer.php +++ b/inc/footer.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { // Footer disabled or already sent? // 1234 5 54 45 5 5 543 3 321 -if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != '1') && ($GLOBALS['footer_sent'] != '2'))) && ($GLOBALS['output_mode'] != '1'))) { +if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != '1') && ($GLOBALS['footer_sent'] != '2'))) && (getOutputMode() != '1'))) { // Output the generated HTML code or do nothing in direct-mode if (getTotalFatalErrors() > 0) { // Output fatal error messages diff --git a/inc/functions.php b/inc/functions.php index ab9fec7b50..16a7194b80 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -114,7 +114,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) { sendHeader('Connection: Close'); // Extension 'rewrite' installed? - if ((EXT_IS_ACTIVE('rewrite')) && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) { + if ((EXT_IS_ACTIVE('rewrite')) && (getOutputMode() != '1') && (getOutputMode() != '-1')) { $OUTPUT = rewriteLinksInCode($OUTPUT); } // END - if @@ -137,7 +137,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) { outputRawCode($OUTPUT); } elseif ((getConfig('OUTPUT_MODE') == 'render') && (!empty($OUTPUT))) { // Rewrite links when rewrite extension is active - if ((EXT_IS_ACTIVE('rewrite')) && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) { + if ((EXT_IS_ACTIVE('rewrite')) && (getOutputMode() != '1') && (getOutputMode() != '-1')) { $OUTPUT = rewriteLinksInCode($OUTPUT); } // END - if @@ -300,13 +300,13 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) { //////////////////////// $FQFN = $basePath . $mode . $template . '.tpl'; - if ((!empty($GLOBALS['what'])) && ((strpos($template, '_header') > 0) || (strpos($template, '_footer') > 0)) && (($mode == 'guest/') || ($mode == 'member/') || ($mode == 'admin/'))) { + if ((isWhatSet()) && ((strpos($template, '_header') > 0) || (strpos($template, '_footer') > 0)) && (($mode == 'guest/') || ($mode == 'member/') || ($mode == 'admin/'))) { // Select what depended header/footer template file for admin/guest/member area $file2 = sprintf("%s%s%s_%s.tpl", $basePath, $mode, $template, - SQL_ESCAPE($GLOBALS['what']) + getWhat() ); // Probe for it... @@ -1671,7 +1671,7 @@ function ADD_EMAIL_NAV ($PAGES, $offset, $show_form, $colspan, $return=false) { $NAV .= "-"; } else { // Open anchor tag and add base URL - $NAV .= "'); + if (getOutputMode() != '1') OUTPUT_HTML(''); $GLOBALS['header_sent'] = 1; } // END - if // Load body or not -if (($GLOBALS['module'] != 'frametester') || (($GLOBALS['module'] == 'frametester') && (REQUEST_ISSET_GET('frame'))) || (($GLOBALS['header_sent'] == '1') && (REQUEST_ISSET_GET('frame'))) && ($GLOBALS['output_mode'] != '1')) { +if ((getModule() != 'frametester') || ((getModule() == 'frametester') && (REQUEST_ISSET_GET('frame'))) || (($GLOBALS['header_sent'] == '1') && (REQUEST_ISSET_GET('frame'))) && (getOutputMode() != '1')) { // Is the header sent and the script is not the mail confirmation script and not a CSS? - if (($GLOBALS['header_sent'] == '1') && (basename($_SERVER['PHP_SELF']) != 'mailid.php') && ($GLOBALS['output_mode'] != '1')) { + if (($GLOBALS['header_sent'] == '1') && (basename($_SERVER['PHP_SELF']) != 'mailid.php') && (getOutputMode() != '1')) { // Add BODY tag LOAD_TEMPLATE('page_body'); $GLOBALS['header_sent'] = 2; diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index bc63f76e2c..2d143e4824 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -45,8 +45,8 @@ if (!defined('__SECURITY')) { // Check ACL for menu combination function adminsCheckAdminAcl ($act, $wht) { // If action is login or logout allow allways! - $default = "allow"; - if (($act == "login") || ($act == "logout")) return true; + $default = 'allow'; + if (($act == 'login') || ($act == 'logout')) return true; // Default is deny $ret = false; @@ -109,7 +109,7 @@ function adminsCheckAdminAcl ($act, $wht) { } // Check ACL and (maybe) allow - if (($default == "allow") || (($default == "deny") && ($acl_mode == "allow")) || ($parent === true)) { + if (($default == 'allow') || (($default == 'deny') && ($acl_mode == 'allow')) || ($parent === true)) { // Access is granted $ret = true; } // END - if @@ -193,7 +193,7 @@ function adminsChangeAdminAccount ($POST) { $default = getAdminDefaultAcl(getCurrentAdminId()); // Update admin account - if ($default == "allow") { + if ($default == 'allow') { // Allow changing default ACL SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET login='%s'".$add.", @@ -267,24 +267,24 @@ function adminsEditAdminAccount ($POST) { $content['id'] = $id; // Shall we allow changing default ACL? - if ($currMode == "allow") { + if ($currMode == 'allow') { // Allow chaning it - $content['mode'] = generateOptionList('/ARRAY/', array("allow", "deny"), array(constant('ADMINS_ALLOW_MODE'), constant('ADMINS_DENY_MODE')), $content['mode']); + $content['mode'] = generateOptionList('/ARRAY/', array('allow', 'deny'), array(constant('ADMINS_ALLOW_MODE'), constant('ADMINS_DENY_MODE')), $content['mode']); } else { // Don't allow it $content['mode'] = ' '; } - $content['la_mode'] = generateOptionList('/ARRAY/', array("global", "OLD", "NEW"), array(ADMINS_GLOBAL_LA_SETTING, ADMINS_OLD_LA_SETTING, ADMINS_NEW_LA_SETTING), $content['la_mode']); + $content['la_mode'] = generateOptionList('/ARRAY/', array('global', 'OLD', 'NEW'), array(ADMINS_GLOBAL_LA_SETTING, ADMINS_OLD_LA_SETTING, ADMINS_NEW_LA_SETTING), $content['la_mode']); // Load row template and switch color - $OUT .= LOAD_TEMPLATE("admin_edit_admins_row", true, $content); + $OUT .= LOAD_TEMPLATE('admin_edit_admins_row', true, $content); $SW = 3 - $SW; } } define('__ADMINS_ROWS', $OUT); // Load template - LOAD_TEMPLATE("admin_edit_admins"); + LOAD_TEMPLATE('admin_edit_admins'); } // Delete given admin accounts @@ -315,14 +315,14 @@ function adminsDeleteAdminAccount ($POST) { $content['id'] = $id; // Load row template and switch color - $OUT .= LOAD_TEMPLATE("admin_del_admins_row", true, $content); + $OUT .= LOAD_TEMPLATE('admin_del_admins_row', true, $content); $SW = 3 - $SW; } } define('__ADMINS_ROWS', $OUT); // Load template - LOAD_TEMPLATE("admin_del_admins"); + LOAD_TEMPLATE('admin_del_admins'); } else { // Cannot delete last account! LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_ADMINS_CANNOT_DELETE_LAST')); @@ -372,7 +372,7 @@ function adminsListAdminAccounts() { $content['email_link'] = generateMemberEmailLink($content['id']); // Load row template and switch color - $OUT .= LOAD_TEMPLATE("admin_list_admins_row", true, $content); + $OUT .= LOAD_TEMPLATE('admin_list_admins_row', true, $content); $SW = 3 - $SW; } @@ -381,7 +381,7 @@ function adminsListAdminAccounts() { define('__ADMINS_ROWS', $OUT); // Load template - LOAD_TEMPLATE("admin_list_admins"); + LOAD_TEMPLATE('admin_list_admins'); } // Filter for adding extra data to the query diff --git a/inc/libs/online_functions.php b/inc/libs/online_functions.php index 7d1eb61339..51c0662aa1 100644 --- a/inc/libs/online_functions.php +++ b/inc/libs/online_functions.php @@ -92,32 +92,30 @@ timestamp=UNIX_TIMESTAMP(), ip='%s' WHERE sid='%s' LIMIT 1", array( - $GLOBALS['module'], - $GLOBALS['action'], - $GLOBALS['what'], - $uid, - $rid, - $MEM, - $ADMIN, - detectRemoteAddr(), - session_id() - ), __FUNCTION__, __LINE__ - ); + getModule(), + getAction(), + getWhat(), + $uid, + $rid, + $MEM, + $ADMIN, + detectRemoteAddr(), + session_id() + ), __FUNCTION__, __LINE__); } else { // No entry does exists so we simply add it! SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_online` (module, action, what, userid, refid, is_member, is_admin, timestamp, sid, ip) VALUES ('%s','%s','%s', %s, %s, '%s','%s', UNIX_TIMESTAMP(), '%s','%s')", array( - $GLOBALS['module'], - $GLOBALS['action'], - $GLOBALS['what'], - $uid, - $rid, - $MEM, - $ADMIN, - session_id(), - detectRemoteAddr() - ), __FUNCTION__, __LINE__ - ); + getModule(), + getAction(), + getWhat(), + $uid, + $rid, + $MEM, + $ADMIN, + session_id(), + detectRemoteAddr() + ), __FUNCTION__, __LINE__); } // Free result diff --git a/inc/libs/rewrite_functions.php b/inc/libs/rewrite_functions.php index 467e6babfb..561d281f4e 100644 --- a/inc/libs/rewrite_functions.php +++ b/inc/libs/rewrite_functions.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { // Rewrite links in HTML for better SEO (ugly part of mx!) function rewriteLinksInCode ($HTML) { // Skip rewriting for configured modules - if (eregi($GLOBALS['module'], getConfig('rewrite_skip')) !== false) return $HTML; + if (eregi(getModule(), getConfig('rewrite_skip')) !== false) return $HTML; // Generate target URL $target = "{!URL!}/cms/"; diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index 531741c3e2..3c8a36d811 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -80,7 +80,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array() // Is a sponsor alread in the db? if (SQL_NUMROWS($result) == 1) { // Yes, he is! - if (($GLOBALS['what'] == 'add_sponsor') || ($NO_UPDATE)) { + if ((getWhat() == 'add_sponsor') || ($NO_UPDATE)) { // Already found! $ALREADY = true; } else { @@ -146,7 +146,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array() // Add new sponsor, first add more data $DATA['keys'][] = "sponsor_created"; $DATA['values'][] = time(); $DATA['keys'][] = 'status'; - if ((!$NO_UPDATE) && (IS_ADMIN()) && ($GLOBALS['what'] == "add_sponsor")) { + if ((!$NO_UPDATE) && (IS_ADMIN()) && (getWhat() == "add_sponsor")) { // Only allowed for admin $DATA['values'][] = 'PENDING'; } else { @@ -439,7 +439,7 @@ function SPONSOR_SAVE_DATA ($POST, $content) { $DATA[] = getSession('sponsorpass'); // Saving data was completed... ufff... - switch ($GLOBALS['what']) + switch (getWhat()) { case "account": // Change account data if ($EMAIL === true) { @@ -465,8 +465,8 @@ function SPONSOR_SAVE_DATA ($POST, $content) { break; default: // Unknown sponsor what value! - DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown sponsor module (what) %s detected.", $GLOBALS['what'])); - $message = sprintf(getMessage('SPONSOR_UNKNOWN_WHAT'), $GLOBALS['what']); + DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown sponsor module (what) %s detected.", getWhat())); + $message = sprintf(getMessage('SPONSOR_UNKNOWN_WHAT'), getWhat()); $templ = ''; $subj = ''; break; } @@ -495,7 +495,7 @@ function SPONSOR_SAVE_DATA ($POST, $content) { // to the old address // First to old address - switch ($GLOBALS['what']) + switch (getWhat()) { case "account": // Change account data $email_msg = LOAD_EMAIL_TEMPLATE("sponsor_change_data", $content); diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index 1d39e644e8..0737b412fd 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -58,7 +58,7 @@ function alpha ($sortby, $colspan, $return=false) { $OUT .= "".$ltr.""; } else { // Output link to letter - $OUT .= "".$ltr.""; } @@ -160,7 +160,7 @@ function ADD_PAGENAV ($PAGES, $offset, $show_form, $colspan,$return=false) { if (!REQUEST_ISSET_GET('sortby')) REQUEST_SET_GET('sortby', 'userid'); // Base link - $OUT .= " 0) && ((($GLOBALS['cache_mode'] == 'init') && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) || ($GLOBALS['cache_mode'] == 'no'))) { +if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($GLOBALS['cache_mode'] == 'init') && (getOutputMode() != '1') && (getOutputMode() != '-1')) || ($GLOBALS['cache_mode'] == 'no'))) { // Extensions are registered so we load them while ($content = SQL_FETCHARRAY($res_ext_crt)) { // Get menu entry diff --git a/inc/loader/load_cache-admin.php b/inc/loader/load_cache-admin.php index 93280c2a56..11d80fe511 100644 --- a/inc/loader/load_cache-admin.php +++ b/inc/loader/load_cache-admin.php @@ -84,7 +84,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('admins')) && ($GLOBALS['cache_in $GLOBALS['cache_instance']->destroyCacheFile(); unset($GLOBALS['cache_array']['admins']); } -} elseif ((getConfig('cache_admins') == 'Y') && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) { +} elseif ((getConfig('cache_admins') == 'Y') && (getOutputMode() != '1') && (getOutputMode() != '-1')) { // Create cache file $GLOBALS['cache_instance']->init('ADMINS'); $GLOBALS['cache_instance']->storeExtensionVersion('admins'); @@ -117,7 +117,7 @@ if (GET_EXT_VERSION('admins') >= '0.3') { if (($GLOBALS['cache_instance']->loadCacheFile('admins_acls')) && ($GLOBALS['cache_instance']->extensionVersionMatches('admins'))) { // Load referal system from cache $GLOBALS['cache_array']['admin_acls'] = $GLOBALS['cache_instance']->getArrayFromCache(); - } elseif ((getConfig('cache_acls') == 'Y') && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) { + } elseif ((getConfig('cache_acls') == 'Y') && (getOutputMode() != '1') && (getOutputMode() != '-1')) { // Create cache file here $GLOBALS['cache_instance']->init('ADMINS_ACLS'); $GLOBALS['cache_instance']->storeExtensionVersion('admins'); diff --git a/inc/loader/load_cache-config.php b/inc/loader/load_cache-config.php index cbb44999bb..b0e9f29117 100644 --- a/inc/loader/load_cache-config.php +++ b/inc/loader/load_cache-config.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { if (($GLOBALS['cache_instance']->loadCacheFile('config', true)) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) { // Load config from cache $GLOBALS['cache_array']['config'] = $GLOBALS['cache_instance']->getArrayFromCache(); -} elseif ((getConfig('cache_config') == 'Y') && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) { +} elseif ((getConfig('cache_config') == 'Y') && (getOutputMode() != '1') && (getOutputMode() != '-1')) { // Create cache file here $GLOBALS['cache_instance']->init('CONFIG'); $GLOBALS['cache_instance']->storeExtensionVersion('sql_patches'); diff --git a/inc/loader/load_cache-modreg.php b/inc/loader/load_cache-modreg.php index 92be2dfe84..b37d67f017 100644 --- a/inc/loader/load_cache-modreg.php +++ b/inc/loader/load_cache-modreg.php @@ -68,7 +68,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('modreg')) && ($GLOBALS['cache_in } // END - if } // END - foreach unset($modArray); -} elseif ((getConfig('cache_modreg') == 'Y') && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) { +} elseif ((getConfig('cache_modreg') == 'Y') && (getOutputMode() != '1') && (getOutputMode() != '-1')) { // Create cache file here $GLOBALS['cache_instance']->init('MODULES'); $GLOBALS['cache_instance']->storeExtensionVersion('sql_patches'); diff --git a/inc/loader/load_cache-refdepths.php b/inc/loader/load_cache-refdepths.php index 6414981688..ced42c3c41 100644 --- a/inc/loader/load_cache-refdepths.php +++ b/inc/loader/load_cache-refdepths.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { if (($GLOBALS['cache_instance']->loadCacheFile('refdepths')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) { // Load referal system from cache $GLOBALS['cache_array']['ref_depths'] = $GLOBALS['cache_instance']->getArrayFromCache(); -} elseif ((getConfig('cache_refdepth') == 'Y') && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) { +} elseif ((getConfig('cache_refdepth') == 'Y') && (getOutputMode() != '1') && (getOutputMode() != '-1')) { // Create cache file here $GLOBALS['cache_instance']->init('REFDEPTHS'); $GLOBALS['cache_instance']->storeExtensionVersion('sql_patches'); diff --git a/inc/loader/load_cache-refsystem.php b/inc/loader/load_cache-refsystem.php index 8a8b50f8c4..8aa48c2699 100644 --- a/inc/loader/load_cache-refsystem.php +++ b/inc/loader/load_cache-refsystem.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { if (($GLOBALS['cache_instance']->loadCacheFile('refsystem')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) { // Load referal system from cache $GLOBALS['cache_array']['refsystem'] = $GLOBALS['cache_instance']->getArrayFromCache(); -} elseif ((getConfig('cache_refsys') == 'Y') && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) { +} elseif ((getConfig('cache_refsys') == 'Y') && (getOutputMode() != '1') && (getOutputMode() != '-1')) { // Create cache file here $GLOBALS['cache_instance']->init('REFSYSTEM'); $GLOBALS['cache_instance']->storeExtensionVersion('sql_patches'); diff --git a/inc/loader/load_cache-revision.php b/inc/loader/load_cache-revision.php index 564429cc83..1c2f3971fa 100644 --- a/inc/loader/load_cache-revision.php +++ b/inc/loader/load_cache-revision.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { if (($GLOBALS['cache_instance']->loadCacheFile('revision', true))) { // Load revision from cache $GLOBALS['cache_array']['revision'] = $GLOBALS['cache_instance']->getArrayFromCache(); -} elseif (($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) { +} elseif ((getOutputMode() != '1') && (getOutputMode() != '-1')) { // Create cache file here $GLOBALS['cache_instance']->init('revision'); diff --git a/inc/loader/load_cache-them.php b/inc/loader/load_cache-them.php index 382be5c04e..87dd7a1c0d 100644 --- a/inc/loader/load_cache-them.php +++ b/inc/loader/load_cache-them.php @@ -69,7 +69,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('themes')) && ($GLOBALS['cache_in // Remove dummy array unset($cache); -} elseif ((getConfig('cache_themes') == 'Y') && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) { +} elseif ((getConfig('cache_themes') == 'Y') && (getOutputMode() != '1') && (getOutputMode() != '-1')) { // Create cache file here $GLOBALS['cache_instance']->init('THEMES'); $GLOBALS['cache_instance']->storeExtensionVersion('theme'); diff --git a/inc/mails/_mails.php b/inc/mails/_mails.php index 0576148bd5..9b0e67c412 100644 --- a/inc/mails/_mails.php +++ b/inc/mails/_mails.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode -if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled())) return; // ?> diff --git a/inc/mails/beg_mails.php b/inc/mails/beg_mails.php index 9a9872f746..424d1ccba4 100644 --- a/inc/mails/beg_mails.php +++ b/inc/mails/beg_mails.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode -if ($GLOBALS['output_mode'] == 1) return; +if (getOutputMode() == 1) return; // Create timemark from saved month $mark = mktime(0, 0, 0, getConfig('last_month'), date('d', time()), date('Y', time())); @@ -53,35 +53,28 @@ $sql = ''; $mode = ''; // Shall I sent activation or deactivation mail? $sql = "SELECT userid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE (beg_ral_notify "; -switch (getConfig('beg_rallye')) -{ +switch (getConfig('beg_rallye')) { case 'Y': // Begging rallye is activated - if (getConfig('beg_ral_en_notify') == 'Y') - { + if (getConfig('beg_ral_en_notify') == 'Y') { // Okay, let's check for member accounts $sql .= "= 0 OR (beg_ral_notify > 0 AND beg_ral_en_notify < beg_ral_di_notify)"; $mode = "en"; + } else { + // Do not notify! + $sql = ''; } - else - { - // Do not notify! - $sql = ''; - } - break; + break; case 'N': // Begging rallye is deactivated - if (getConfig('beg_ral_di_notify') == 'Y') - { + if (getConfig('beg_ral_di_notify') == 'Y') { // Okay, let's check for member accounts $sql .= " > 0 AND beg_ral_di_notify < beg_ral_en_notify"; $mode = "di"; + } else { + // Do not notify! + $sql = ''; } - else - { - // Do not notify! - $sql = ''; - } - break; + break; } if (!empty($sql)) { @@ -92,13 +85,10 @@ if (!empty($sql)) { define('__BEG_MIN_POINTS' , translateComma(getConfig('beg_points'))); define('__BEG_MAX_POINTS' , translateComma(getConfig('beg_points_max'))); define('__BEG_MAX_WINNERS', round(getConfig('beg_ranks'))); - if (getConfig('beg_ip_timeout') == 0) - { + if (getConfig('beg_ip_timeout') == 0) { // No IP locking setuped! define('__BEG_IP_LOCKER', getMessage('BEG_NO_LIMITATION')); - } - else - { + } else { // Create timemark define('__BEG_IP_LOCKER', createFancyTime(getConfig('beg_ip_timeout'))); } diff --git a/inc/mails/birthday_mails.php b/inc/mails/birthday_mails.php index 4cc3ef182b..a1e81587ab 100644 --- a/inc/mails/birthday_mails.php +++ b/inc/mails/birthday_mails.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode -if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled())) return; // Get current day (01 to 31), month (01 to 12) and year (4-digits year) $day = date('d', time()); diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index 620488d25b..da5d22c512 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode -if ($GLOBALS['output_mode'] == 1) return; +if (getOutputMode() == 1) return; // Create timemark from saved month $mark = mktime(0, 0, 0, getConfig('last_month'), date('d', time()), date('Y', time())); diff --git a/inc/modules/admin.php b/inc/modules/admin.php index da1be6a77c..cb12054662 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -222,13 +222,13 @@ if (!isAdminRegistered()) { $URL = 'modules.php?module=admin&'; // Rewrite overview module - if ($GLOBALS['what'] == 'overview') { - $GLOBALS['action'] = getModeAction($GLOBALS['module'], $GLOBALS['what']); + if (getWhat() == 'overview') { + setAction(getModeAction(getModule(), getWhat())); } // END - if // Add data to URL - if (!empty($GLOBALS['what'])) $URL .= 'what='.$GLOBALS['what']; - elseif (!empty($GLOBALS['action'])) $URL .= 'action='.$GLOBALS['action']; + if (isWhatSet()) $URL .= 'what='.getWhat(); + elseif (isActionSet()) $URL .= 'action='.getAction(); elseif (REQUEST_ISSET_GET('area')) $URL .= 'area='.REQUEST_GET('area'); // Load URL @@ -295,13 +295,13 @@ if (!isAdminRegistered()) { } // Load login form - if (!empty($GLOBALS['what'])) { + if (isWhatSet()) { // Restore old what value - $content = array('target' => 'what', 'value' => $GLOBALS['what']); - } elseif (!empty($GLOBALS['action'])) { - if ($GLOBALS['action'] != 'logout') { + $content = array('target' => 'what', 'value' => getWhat()); + } elseif (isActionSet()) { + if (getAction() != 'logout') { // Restore old action value - $content = array('target' => 'action', 'value' => $GLOBALS['action']); + $content = array('target' => 'action', 'value' => getAction()); } else { // Set default values $content = array('target' => 'action', 'value' => 'login'); @@ -368,11 +368,11 @@ if (!isAdminRegistered()) { loadIncludeOnce('inc/modules/admin/lasys-inc.php'); // Create new-style menu system will logical areas - ADMIN_LOGICAL_AREA_SYSTEM($area, $act, $GLOBALS['what']); + ADMIN_LOGICAL_AREA_SYSTEM($area, $act, getWhat()); } else { // This little call constructs the whole default old and lacky menu system // on left side. It also renders the content on right side - ADMIN_DO_ACTION($GLOBALS['what']); + ADMIN_DO_ACTION(getWhat()); } break; diff --git a/inc/modules/admin/action- b/inc/modules/admin/action- index 1200c49dc9..1f76fd3313 100644 --- a/inc/modules/admin/action- +++ b/inc/modules/admin/action- @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('ADMIN_404_ACTION', getWhat()))); } // diff --git a/inc/modules/admin/action-admins.php b/inc/modules/admin/action-admins.php index 56ae370c46..d470716f45 100644 --- a/inc/modules/admin/action-admins.php +++ b/inc/modules/admin/action-admins.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-bank.php b/inc/modules/admin/action-bank.php index 0a5ddf70fe..7d531bfdaf 100644 --- a/inc/modules/admin/action-bank.php +++ b/inc/modules/admin/action-bank.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-country.php b/inc/modules/admin/action-country.php index 4c08cfac0b..54df02e525 100644 --- a/inc/modules/admin/action-country.php +++ b/inc/modules/admin/action-country.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-doubler.php b/inc/modules/admin/action-doubler.php index 327dddc125..175fbf3a77 100644 --- a/inc/modules/admin/action-doubler.php +++ b/inc/modules/admin/action-doubler.php @@ -46,13 +46,13 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { // "what file" not found - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-email.php b/inc/modules/admin/action-email.php index 8db1b0de02..315df5c1be 100644 --- a/inc/modules/admin/action-email.php +++ b/inc/modules/admin/action-email.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-holiday.php b/inc/modules/admin/action-holiday.php index 891af6a815..798fba3f45 100644 --- a/inc/modules/admin/action-holiday.php +++ b/inc/modules/admin/action-holiday.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-login.php b/inc/modules/admin/action-login.php index 1a9cf120d6..594a50a313 100644 --- a/inc/modules/admin/action-login.php +++ b/inc/modules/admin/action-login.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-logout.php b/inc/modules/admin/action-logout.php index 95ede33f3a..d31da7d870 100644 --- a/inc/modules/admin/action-logout.php +++ b/inc/modules/admin/action-logout.php @@ -48,7 +48,7 @@ ADD_DESCR('admin', __FILE__); if (REQUEST_ISSET_POST('no')) { // Do not logout now redirectToUrl('admin.php'); -} elseif ((REQUEST_ISSET_POST(('yes'))) && ($GLOBALS['action'] == 'logout')) { +} elseif ((REQUEST_ISSET_POST(('yes'))) && (getAction() == 'logout')) { // Redirect to logout link redirectToUrl('modules.php?module=admin&logout=1'); } diff --git a/inc/modules/admin/action-menu.php b/inc/modules/admin/action-menu.php index 292f283744..eb7f1fa800 100644 --- a/inc/modules/admin/action-menu.php +++ b/inc/modules/admin/action-menu.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-misc.php b/inc/modules/admin/action-misc.php index 311dd77aa4..c8a688e198 100644 --- a/inc/modules/admin/action-misc.php +++ b/inc/modules/admin/action-misc.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-mods.php b/inc/modules/admin/action-mods.php index 1de455a49a..3f31c0adb8 100644 --- a/inc/modules/admin/action-mods.php +++ b/inc/modules/admin/action-mods.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-newsletter.php b/inc/modules/admin/action-newsletter.php index 605c6a41f0..e20ac2a733 100644 --- a/inc/modules/admin/action-newsletter.php +++ b/inc/modules/admin/action-newsletter.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-payouts.php b/inc/modules/admin/action-payouts.php index 73340586a1..f61f6fa133 100644 --- a/inc/modules/admin/action-payouts.php +++ b/inc/modules/admin/action-payouts.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-primera.php b/inc/modules/admin/action-primera.php index f97366a69b..55134ed1c6 100644 --- a/inc/modules/admin/action-primera.php +++ b/inc/modules/admin/action-primera.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-rallye.php b/inc/modules/admin/action-rallye.php index b77fae2428..14facb5b59 100644 --- a/inc/modules/admin/action-rallye.php +++ b/inc/modules/admin/action-rallye.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-repair.php b/inc/modules/admin/action-repair.php index e5a8165bca..77a5132f84 100644 --- a/inc/modules/admin/action-repair.php +++ b/inc/modules/admin/action-repair.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-setup.php b/inc/modules/admin/action-setup.php index 2f9d38f0f9..fd20b86d27 100644 --- a/inc/modules/admin/action-setup.php +++ b/inc/modules/admin/action-setup.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-sponsor.php b/inc/modules/admin/action-sponsor.php index c05bb77f7b..1f527dced7 100644 --- a/inc/modules/admin/action-sponsor.php +++ b/inc/modules/admin/action-sponsor.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // ?> diff --git a/inc/modules/admin/action-stats.php b/inc/modules/admin/action-stats.php index bd662bc6e9..7a58414c74 100644 --- a/inc/modules/admin/action-stats.php +++ b/inc/modules/admin/action-stats.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-surfbar.php b/inc/modules/admin/action-surfbar.php index 5e4a8ea3e4..9fba2e4ea4 100644 --- a/inc/modules/admin/action-surfbar.php +++ b/inc/modules/admin/action-surfbar.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-task.php b/inc/modules/admin/action-task.php index 8897cf7619..bdc3fe5402 100644 --- a/inc/modules/admin/action-task.php +++ b/inc/modules/admin/action-task.php @@ -49,12 +49,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-theme.php b/inc/modules/admin/action-theme.php index 48e2d96df8..c4ab6ced5a 100644 --- a/inc/modules/admin/action-theme.php +++ b/inc/modules/admin/action-theme.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-transfer.php b/inc/modules/admin/action-transfer.php index 64375b4434..ef4c9680a8 100644 --- a/inc/modules/admin/action-transfer.php +++ b/inc/modules/admin/action-transfer.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-user.php b/inc/modules/admin/action-user.php index 86b97c7dc6..6d481f6ed6 100644 --- a/inc/modules/admin/action-user.php +++ b/inc/modules/admin/action-user.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/action-wernis.php b/inc/modules/admin/action-wernis.php index 94308609b3..12c9a9c556 100644 --- a/inc/modules/admin/action-wernis.php +++ b/inc/modules/admin/action-wernis.php @@ -46,12 +46,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Load the include file -$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/admin/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the admin action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat()); } // diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 9a9eab41e0..bdb9dedaf6 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -239,19 +239,19 @@ function CHECK_ADMIN_COOKIES ($admin_login, $password) { // function ADMIN_DO_ACTION ($wht) { global $DATA; - //* DEBUG: */ echo __LINE__."*".$wht.'/'.$GLOBALS['module'].'/'.$GLOBALS['action'].'/'.$GLOBALS['what']."*
\n"; + //* DEBUG: */ echo __LINE__."*".$wht.'/'.getModule().'/'.getAction().'/'.getWhat()."*
\n"; // Remove any spaces from variable if (empty($wht)) { // Default admin action is the overview page - $wht = "overview"; + $wht = 'overview'; } else { // Compile out some chars $wht = COMPILE_CODE($wht, false, false, false); } // Get action value - $act = getModeAction($GLOBALS['module'], $wht); + $act = getModeAction(getModule(), $wht); // Define admin login name and ID number define('__ADMIN_LOGIN', getSession('admin_login')); @@ -259,15 +259,15 @@ function ADMIN_DO_ACTION ($wht) { // Preload templates if (EXT_IS_ACTIVE('admins')) { - define('__ADMIN_WELCOME', LOAD_TEMPLATE("admin_welcome_admins", true)); + define('__ADMIN_WELCOME', LOAD_TEMPLATE('admin_welcome_admins', true)); } else { - define('__ADMIN_WELCOME', LOAD_TEMPLATE("admin_welcome", true)); + define('__ADMIN_WELCOME', LOAD_TEMPLATE('admin_welcome', true)); } - define('__ADMIN_FOOTER' , LOAD_TEMPLATE("admin_footer" , true)); + define('__ADMIN_FOOTER' , LOAD_TEMPLATE('admin_footer' , true)); define('__ADMIN_MENU' , ADD_ADMIN_MENU($act, $wht, true)); // Tableset header - LOAD_TEMPLATE("admin_main_header"); + LOAD_TEMPLATE('admin_main_header'); // Check if action/what pair is valid $result_action = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admin_menu` @@ -281,16 +281,16 @@ LIMIT 1", array($act, $wht, $wht), __FUNCTION__, __LINE__); loadInclude($INC); } elseif ($GLOBALS['acl_allow'] === false) { // Access denied - LOAD_TEMPLATE("admin_menu_failed", false, getMessage('ADMIN_ACCESS_DENIED')); + LOAD_TEMPLATE('admin_menu_failed', false, getMessage('ADMIN_ACCESS_DENIED')); addFatalMessage(__FUNCTION__, __LINE__, getMessage('ADMIN_ACCESS_DENIED')); } else { // Include file not found! :-( - LOAD_TEMPLATE("admin_menu_failed", false, sprintf(getMessage('ADMIN_ACTION_404'), $act)); + LOAD_TEMPLATE('admin_menu_failed', false, sprintf(getMessage('ADMIN_ACTION_404'), $act)); addFatalMessage(__FUNCTION__, __LINE__, getMessage('ADMIN_ACTION_404'), $act); } } else { // Invalid action/what pair found! - LOAD_TEMPLATE("admin_menu_failed", false, sprintf(getMessage('ADMIN_ACTION_INVALID'), $act.'/'.$wht)); + LOAD_TEMPLATE('admin_menu_failed', false, sprintf(getMessage('ADMIN_ACTION_INVALID'), $act.'/'.$wht)); addFatalMessage(__FUNCTION__, __LINE__, getMessage('ADMIN_ACTION_INVALID'), $act.'/'.$wht); } @@ -298,7 +298,7 @@ LIMIT 1", array($act, $wht, $wht), __FUNCTION__, __LINE__); SQL_FREERESULT($result_action); // Tableset footer - LOAD_TEMPLATE("admin_main_footer"); + LOAD_TEMPLATE('admin_main_footer'); } // @@ -314,7 +314,7 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) { // Is there a cache instance? if ((isCacheInstanceValid()) && (getConfig('cache_admin_menu') == 'Y')) { // Create cache name - $cacheName = "admin_".$act."_".$wht."_".getLanguage()."_".strtolower(getSession('admin_login')); + $cacheName = 'admin_' . $act . '_' . $wht . '_' . getLanguage() . '_' . strtolower(getSession('admin_login')); // Is that cache there? if ($GLOBALS['cache_instance']->loadCacheFile($cacheName)) { @@ -345,7 +345,7 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) { if ((EXT_IS_ACTIVE('admins')) && (GET_EXT_VERSION('admins') > '0.2.0')) { $ACL = adminsCheckAdminAcl($menu, ''); } else { - // ACL is "allow"... hmmm + // @TODO ACL is 'allow'... hmmm $ACL = true; } @@ -393,7 +393,7 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) { if ((EXT_IS_ACTIVE('admins')) && (GET_EXT_VERSION('admins') > '0.2.0')) { $ACL = adminsCheckAdminAcl('', $wht_sub); } else { - // ACL is "allow"... hmmm + // @TODO ACL is 'allow'... hmmm $ACL = true; } @@ -488,7 +488,7 @@ function ADD_MEMBER_SELECTION_BOX ($def='0', $add_all=false, $return=false, $non // USe this only for adding points (e.g. adding refs really makes no sence ;-) ) if ($add_all === true) $OUT = " \n"; - elseif ($none === true) $OUT = " \n"; + elseif ($none === true) $OUT = " \n"; while ($content = SQL_FETCHARRAY($result)) { $OUT .= " \n"; } - $OUT .= generateOptionList('admins', 'id', "login", $content['admin_id'], 'email'); + $OUT .= generateOptionList('admins', 'id', 'login', $content['admin_id'], 'email'); $OUT .= "\n
\n"; $aid2 = $content['admin_id']; $id2 = $content['id']; } diff --git a/inc/modules/admin/what-config_admin.php b/inc/modules/admin/what-config_admin.php index 9c7eb830f1..7d2b9aba6a 100644 --- a/inc/modules/admin/what-config_admin.php +++ b/inc/modules/admin/what-config_admin.php @@ -49,21 +49,20 @@ if (isFormSent()) { ADMIN_SAVE_SETTINGS_POST(); } else { // Prepare data for the template - switch (getConfig('admin_menu')) - { - case "NEW": - define('__ADMIN_MENU_NEW', ' checked="checked"'); + switch (getConfig('admin_menu')) { + case 'NEW': + define('__ADMIN_MENU_NEW', ' checked='checked''); define('__ADMIN_MENU_OLD' , ''); break; - case "OLD": + case 'OLD': define('__ADMIN_MENU_NEW', ''); - define('__ADMIN_MENU_OLD' , ' checked="checked"'); + define('__ADMIN_MENU_OLD' , ' checked='checked''); break; } // Display form - LOAD_TEMPLATE("admin_config_admin"); + LOAD_TEMPLATE('admin_config_admin'); } // diff --git a/inc/modules/admin/what-config_bonus.php b/inc/modules/admin/what-config_bonus.php index 84912169d5..8f0a376d8b 100644 --- a/inc/modules/admin/what-config_bonus.php +++ b/inc/modules/admin/what-config_bonus.php @@ -61,10 +61,10 @@ if (isFormSent()) { if (!empty($rate)) $RATES[] = $rate; } REQUEST_SET_POST('turbo_rates', trim(implode(';', $RATES))); - REQUEST_UNSET_POST(('rate')); + REQUEST_UNSET_POST('rate'); // Automatically calculate bonus points for ranks 2 and 3 when not set - if (!REQUEST_ISSET_POST(('turbo_rates'))) REQUEST_SET_POST('turbo_rates', "".round(getConfig('turbo_bonus') / 2).';'.round(getConfig('turbo_bonus') / 4).""); + if (!REQUEST_ISSET_POST(('turbo_rates'))) REQUEST_SET_POST('turbo_rates', ''.round(getConfig('turbo_bonus') / 2).';'.round(getConfig('turbo_bonus') / 4).''); // Save data ADMIN_SAVE_SETTINGS_POST(); @@ -85,7 +85,7 @@ if (isFormSent()) { define('__TLINES_VALUE', getConfig('bonus_lines')); // Transfer options to template __MEMBER_SELECTION - define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('bonus_uid'), false, true, true, "bonus_uid")); + define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('bonus_uid'), false, true, true, 'bonus_uid')); // Initialize array for the points list //die("*".getConfig('turbo_rates')."*"); diff --git a/inc/modules/admin/what-config_payouts.php b/inc/modules/admin/what-config_payouts.php index 19b350a141..ef1973fbe4 100644 --- a/inc/modules/admin/what-config_payouts.php +++ b/inc/modules/admin/what-config_payouts.php @@ -45,8 +45,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { // Add description as navigation point ADD_DESCR('admin', __FILE__); - -if (REQUEST_ISSET_POST(('rate'))) REQUEST_SET_POST('rate', convertCommaToDot(REQUEST_POST('rate'))); +if (REQUEST_ISSET_POST('rate')) REQUEST_SET_POST('rate', convertCommaToDot(REQUEST_POST('rate'))); if ((REQUEST_ISSET_POST('add')) && (REQUEST_ISSET_POST('title')) && (REQUEST_POST('rate') > 0)) { // Add new payout type @@ -58,17 +57,19 @@ if ((REQUEST_ISSET_POST('add')) && (REQUEST_ISSET_POST('title')) && (REQUEST_POS (type, rate, min_points, from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url) VALUES ('%s', %d, %d,'%s','%s','%s','%s','%s','%s','%s')", array( - REQUEST_POST('title'), - bigintval(REQUEST_POST('rate')), - bigintval(REQUEST_POST('mpoi')), - REQUEST_POST('yacc'), - REQUEST_POST('ypass'), - REQUEST_POST('yurl'), - REQUEST_POST('yrdone'), - REQUEST_POST('yrfailed'), - REQUEST_POST('ytrans'), - REQUEST_POST('allow_url'), + REQUEST_POST('title'), + bigintval(REQUEST_POST('rate')), + bigintval(REQUEST_POST('mpoi')), + REQUEST_POST('yacc'), + REQUEST_POST('ypass'), + REQUEST_POST('yurl'), + REQUEST_POST('yrdone'), + REQUEST_POST('yrfailed'), + REQUEST_POST('ytrans'), + REQUEST_POST('allow_url'), ), __FILE__, __LINE__); + + // Get message $msg = getMessage('ADMIN_PAYOUT_TYPE_ADDED'); } else { // Free memory @@ -85,7 +86,7 @@ $result_mem = SQL_QUERY("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE $display = true; if ((REQUEST_ISSET_POST('edit')) && (countPostSelection() > 0)) { // Edit payout types - if ((REQUEST_ISSET_GET('ok')) && (REQUEST_GET('ok') == "ok")) { + if ((REQUEST_ISSET_GET('ok')) && (REQUEST_GET('ok') == 'ok')) { // Init SQLs INIT_SQLS(); @@ -104,10 +105,10 @@ min_points=%s, allow_url='%s' WHERE `id`='".$id."' LIMIT 1", array( - REQUEST_POST('title', $id), - convertCommaToDot(REQUEST_POST('rate', $id)), - convertCommaToDot(REQUEST_POST('mpoi' , $id)), - REQUEST_POST('allow', $id), + REQUEST_POST('title', $id), + convertCommaToDot(REQUEST_POST('rate', $id)), + convertCommaToDot(REQUEST_POST('mpoi' , $id)), + REQUEST_POST('allow', $id), ),__FILE__, __LINE__, false)); } } @@ -138,7 +139,7 @@ WHERE `id`='".$id."' LIMIT 1", ); // Load row template and switch color - $OUT .= LOAD_TEMPLATE("admin_config_payouts_edit_row", true, $content); + $OUT .= LOAD_TEMPLATE('admin_config_payouts_edit_row', true, $content); $SW = 3 - $SW; } @@ -146,11 +147,11 @@ WHERE `id`='".$id."' LIMIT 1", define('__PAYOUT_ROWS', $OUT); // Load main template - LOAD_TEMPLATE("admin_config_payouts_edit"); + LOAD_TEMPLATE('admin_config_payouts_edit'); } } elseif ((REQUEST_ISSET_POST('del')) && (countPostSelection() > 0)) { // Delete payout types - if ((REQUEST_ISSET_GET('ok')) && (REQUEST_GET('ok') == "ok")) { + if ((REQUEST_ISSET_GET('ok')) && (REQUEST_GET('ok') == 'ok')) { // Init SQLs INIT_SQLS(); @@ -188,13 +189,13 @@ WHERE `id`='".$id."' LIMIT 1", ); // Load row template and switch color - $OUT .= LOAD_TEMPLATE("admin_config_payouts_del_row", true, $content); + $OUT .= LOAD_TEMPLATE('admin_config_payouts_del_row', true, $content); $SW = 3 - $SW; } define('__PAYOUT_ROWS', $OUT); // Load main template - LOAD_TEMPLATE("admin_config_payouts_del"); + LOAD_TEMPLATE('admin_config_payouts_del'); } } @@ -221,7 +222,7 @@ if ((SQL_NUMROWS($result_type) > 0) && ($display)) { ); // Load row template and switch color - $OUT .= LOAD_TEMPLATE("admin_config_payouts_row", true, $content); + $OUT .= LOAD_TEMPLATE('admin_config_payouts_row', true, $content); $SW = 3 - $SW; } @@ -232,7 +233,7 @@ if ((SQL_NUMROWS($result_type) > 0) && ($display)) { define('__PAYOUT_ROWS', $OUT); // Load main template - LOAD_TEMPLATE("admin_config_payouts"); + LOAD_TEMPLATE('admin_config_payouts'); } // Does your members request payouts? @@ -248,7 +249,7 @@ if ((SQL_NUMROWS($result_mem) > 0) && ($display)) { SQL_FREERESULT($result_mem); // Add new paypout type -if ($display) LOAD_TEMPLATE("admin_payout_add_new"); +if ($display === true) LOAD_TEMPLATE('admin_payout_add_new'); // ?> diff --git a/inc/modules/admin/what-config_points.php b/inc/modules/admin/what-config_points.php index 51aef758e7..4c10dafb62 100644 --- a/inc/modules/admin/what-config_points.php +++ b/inc/modules/admin/what-config_points.php @@ -51,15 +51,14 @@ $message = ''; // Is the 'sub' parameter set? if (REQUEST_ISSET_GET('sub')) { // Yes, then do some sanity-checks - switch (REQUEST_GET('sub')) - { - case "points": + switch (REQUEST_GET('sub')) { + case 'points': if ((!REQUEST_ISSET_POST(('points_register'))) || (!REQUEST_ISSET_POST(('points_ref')))) { REQUEST_UNSET_POST('ok'); } break; - case "ref": + case 'ref': if (REQUEST_ISSET_GET('do')) { if (((!REQUEST_ISSET_POST(('lvl'))) || (!REQUEST_ISSET_POST(('perc')))) && (REQUEST_GET('do') == 'add')) { REQUEST_UNSET_POST('ok'); @@ -69,18 +68,17 @@ if (REQUEST_ISSET_GET('sub')) { } } else { // Display overview - REQUEST_SET_GET('sub', "overview"); + REQUEST_SET_GET('sub', 'overview'); } if (isFormSent()) { INIT_SQLS(); - switch (REQUEST_GET('sub')) - { - case "points": + switch (REQUEST_GET('sub')) { + case 'points': ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_config` SET points_register='".REQUEST_POST('points_register')."', points_ref='".REQUEST_POST('points_ref')."' WHERE config=0 LIMIT 1"); break; - case "ref": + case 'ref': switch (REQUEST_GET('do')) { case 'add': diff --git a/inc/modules/admin/what-extensions.php b/inc/modules/admin/what-extensions.php index be7cc1d23b..68849e0a63 100644 --- a/inc/modules/admin/what-extensions.php +++ b/inc/modules/admin/what-extensions.php @@ -235,7 +235,7 @@ if (REQUEST_ISSET_GET(('active'))) { // Case selection switch ($do) { - case "overview": // List all registered extensions + case 'overview': // List all registered extensions if (GET_EXT_VERSION('sql_patches') >= '0.0.6') { // Load extension data with CSS informations $result = SQL_QUERY("SELECT id AS ext_id, ext_name, ext_active, ext_has_css AS ext_css, ext_version diff --git a/inc/modules/admin/what-list_doubler.php b/inc/modules/admin/what-list_doubler.php index f27255b666..c6ffdd6749 100644 --- a/inc/modules/admin/what-list_doubler.php +++ b/inc/modules/admin/what-list_doubler.php @@ -47,7 +47,7 @@ ADD_DESCR('admin', __FILE__); if (!REQUEST_ISSET_GET('mode')) { // Chosse the overview page as default - REQUEST_GET('mode', "overview"); + REQUEST_GET('mode', 'overview'); } else { // Set table title automatically if (!REQUEST_ISSET_GET(('select'))) REQUEST_GET('select', "all"); @@ -61,7 +61,7 @@ switch (REQUEST_GET('mode')) case "already": // Already payed out points break; - case "overview": // General overview page + case 'overview': // General overview page $SUM_ALREADY = 0; $SUM_WAITING = 0; // Number of direct already payouts and referal $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='Y' AND is_ref='N'", __FILE__, __LINE__); diff --git a/inc/modules/admin/what-logs.php b/inc/modules/admin/what-logs.php index df3a5872f0..f2fded4921 100644 --- a/inc/modules/admin/what-logs.php +++ b/inc/modules/admin/what-logs.php @@ -100,7 +100,7 @@ if (REQUEST_ISSET_GET('access')) { // We currenly only like files with "access" as prefix, should be more flexible! if (substr($file, 0, 6) == 'access') { // Okay, let us print it out - OUTPUT_HTML("
  • ".$file."
  • "); + OUTPUT_HTML("
  • ".$file."
  • "); } } closedir($handle); diff --git a/inc/modules/admin/what-overview.php b/inc/modules/admin/what-overview.php index 6772774289..e3204cb0d0 100644 --- a/inc/modules/admin/what-overview.php +++ b/inc/modules/admin/what-overview.php @@ -52,7 +52,7 @@ $jobsDone = true; $taskExt = false; // Default is that 'task' is not installed // When the admin is logging in check several things first (new jobs to complete and so on) -if ($GLOBALS['action'] == "login") { +if (getAction() == 'login') { if (EXT_IS_ACTIVE('task')) { // When task extension is registered output advanced overview page $jobsDone = OUTPUT_ADVANCED_OVERVIEW($result_tasks); // This function is provided by the extension 'task' @@ -64,9 +64,9 @@ if ($GLOBALS['action'] == "login") { } // END - if // Are we in 'welcome' page and are there jobs to be done? -if (!ifAdminMenuHasEntries($GLOBALS['action'])) { +if (!ifAdminMenuHasEntries(getAction())) { // This menu is empty and so no content is displayed - LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_MENU_IS_EMPTY'), $GLOBALS['action'])); + LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_MENU_IS_EMPTY'), getAction())); } elseif ($jobsDone === true) { // Generate overview of all main menus if ((is_array($GLOBALS['menu']['description'])) && (count($GLOBALS['menu']['description']) > 0)) { diff --git a/inc/modules/admin/what-theme_check.php b/inc/modules/admin/what-theme_check.php index 993ecc443b..f7023c2402 100644 --- a/inc/modules/admin/what-theme_check.php +++ b/inc/modules/admin/what-theme_check.php @@ -46,7 +46,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Normally we want the overview of all registered theme_check -$mode = "overview"; +$mode = 'overview'; $SEL = 0; // Get response from our server diff --git a/inc/modules/admin/what-usage.php b/inc/modules/admin/what-usage.php index 70d433eb40..a90fc640de 100644 --- a/inc/modules/admin/what-usage.php +++ b/inc/modules/admin/what-usage.php @@ -93,11 +93,11 @@ if ((!empty($FQFN)) && (isFileReadable($FQFN))) { // Until here... // Replace URLs - $content = str_replace("usage.png", "{!URL!}/modules.php?module=admin&what=".$GLOBALS['what']."&type=usage&image=usage", $content); - $content = str_replace("daily_usage_", "{!URL!}/modules.php?module=admin&what=".$GLOBALS['what']."&type=daily&image=", $content); - $content = str_replace("hourly_usage_", "{!URL!}/modules.php?module=admin&what=".$GLOBALS['what']."&type=hourly&image=", $content); - $content = str_replace("ctry_usage_", "{!URL!}/modules.php?module=admin&what=".$GLOBALS['what']."&type=ctry&image=", $content); - $content = str_replace("usage_", "{!URL!}/modules.php?module=admin&what=".$GLOBALS['what']."&usage=", str_replace(".html", '', $content)); + $content = str_replace("usage.png", "{!URL!}/modules.php?module=admin&what=".getWhat()."&type=usage&image=usage", $content); + $content = str_replace("daily_usage_", "{!URL!}/modules.php?module=admin&what=".getWhat()."&type=daily&image=", $content); + $content = str_replace("hourly_usage_", "{!URL!}/modules.php?module=admin&what=".getWhat()."&type=hourly&image=", $content); + $content = str_replace("ctry_usage_", "{!URL!}/modules.php?module=admin&what=".getWhat()."&type=ctry&image=", $content); + $content = str_replace("usage_", "{!URL!}/modules.php?module=admin&what=".getWhat()."&usage=", str_replace(".html", '', $content)); // Disabled due to too much trouble //$content = str_replace("HREF=\'http://', "href=\"{!URL!}/modules.php?module=loader&url=http://", $content); diff --git a/inc/modules/guest/action- b/inc/modules/guest/action- index 1dcd93d11e..cf4f43962a 100644 --- a/inc/modules/guest/action- +++ b/inc/modules/guest/action- @@ -52,14 +52,14 @@ if (!defined('__SECURITY')) { ADD_DESCR('guest', __FILE__); // Load the include file -$INC = sprintf("inc/modules/guest/what-%s.php", $GLOBALS['what']); +$INC = sprintf("inc/modules/guest/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the guest action module loadInclude($INC); } elseif ($IS_VALID) { - addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('GUEST_404_ACTION'), getWhat())); } else { - addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('GUEST_LOCKED_ACTION'), SQL_ESCAPE($GLOBALS['what']))); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('GUEST_LOCKED_ACTION'), getWhat())); } // diff --git a/inc/modules/guest/action-admin.php b/inc/modules/guest/action-admin.php index a28716c644..844be918d2 100644 --- a/inc/modules/guest/action-admin.php +++ b/inc/modules/guest/action-admin.php @@ -46,12 +46,12 @@ if (!defined('__SECURITY')) { } // Only when one admin link is clicked... -$INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/guest/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the guest action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), getWhat()); } // diff --git a/inc/modules/guest/action-main.php b/inc/modules/guest/action-main.php index a555c07e79..2515ae59d8 100644 --- a/inc/modules/guest/action-main.php +++ b/inc/modules/guest/action-main.php @@ -49,12 +49,12 @@ if (!defined('__SECURITY')) { ADD_DESCR('guest', __FILE__); // Load the include file -$INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/guest/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the guest action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), getWhat()); } // diff --git a/inc/modules/guest/action-members.php b/inc/modules/guest/action-members.php index feed98a8b3..c98d8569e5 100644 --- a/inc/modules/guest/action-members.php +++ b/inc/modules/guest/action-members.php @@ -49,12 +49,12 @@ if (!defined('__SECURITY')) { ADD_DESCR('guest', __FILE__); // Load the include file -$INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/guest/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the guest action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), getWhat()); } // diff --git a/inc/modules/guest/action-sponsor.php b/inc/modules/guest/action-sponsor.php index b53694dd7a..948fbf7cdf 100644 --- a/inc/modules/guest/action-sponsor.php +++ b/inc/modules/guest/action-sponsor.php @@ -51,12 +51,12 @@ if (!defined('__SECURITY')) { ADD_DESCR('guest', __FILE__); // Load the include file -$INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/guest/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the guest action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), getWhat()); } // diff --git a/inc/modules/guest/action-themes.php b/inc/modules/guest/action-themes.php index 80210b2543..52e22c9fd9 100644 --- a/inc/modules/guest/action-themes.php +++ b/inc/modules/guest/action-themes.php @@ -54,8 +54,8 @@ $num_themes = SQL_NUMROWS($result_themes); if ($num_themes > 1) { // If more than 1 is installed output selection box $act = ''; - if (!empty($GLOBALS['action'])) $act = SQL_ESCAPE($GLOBALS['action']); - $OUT = generateThemeSelectionBox('index', $act, $GLOBALS['what'], $result_themes); + if (isActionSet()) $act = getAction(); + $OUT = generateThemeSelectionBox('index', $act, getWhat(), $result_themes); } elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0))) { // If there's only one just print it's name define('__THEME_NAME', getCurrentThemeName()); diff --git a/inc/modules/index.php b/inc/modules/index.php index 28bb48b2a3..10525b30e9 100644 --- a/inc/modules/index.php +++ b/inc/modules/index.php @@ -58,18 +58,18 @@ handleCodeMessage(); LOAD_TEMPLATE('guest_menu_td'); // When no what value is provided take the "home" value -if (empty($GLOBALS['what'])) $GLOBALS['what'] = getConfig('index_home'); +if (!isWhatSet()) setWhatFromConfig('index_home'); // Adding the main content module here -if (empty($GLOBALS['action'])) { +if (!isActionSet()) { // Get action value from what value - $GLOBALS['action'] = getModeAction('guest', $GLOBALS['what']); + setAction(getModeAction('guest', getWhat())); } // END - if // Add the guest's menu here... if ((getConfig('guest_menu') == 'Y') || (!EXT_IS_ACTIVE('sql_patches', true))) { // Show only when guest menu is active - ADD_MENU('guest', $GLOBALS['action'], $GLOBALS['what']); + ADD_MENU('guest', getAction(), getWhat()); } // END - if // TDs between menu and content @@ -79,10 +79,10 @@ LOAD_TEMPLATE('guest_menu_content'); $GLOBALS['block_mode'] = false; // Construct FQFN -$INC = sprintf("inc/modules/guest/action-%s.php", $GLOBALS['action']); +$INC = sprintf("inc/modules/guest/action-%s.php", getAction()); // Is the file there? -if ((isIncludeReadable($INC)) && (isMenuActionValid('guest', $GLOBALS['action'], $GLOBALS['what']))) { +if ((isIncludeReadable($INC)) && (isMenuActionValid('guest', getAction(), getWhat()))) { // Requested module is available so we load it loadIncludeOnce($INC); } else { diff --git a/inc/modules/login.php b/inc/modules/login.php index 90a768f922..67b049ad2e 100644 --- a/inc/modules/login.php +++ b/inc/modules/login.php @@ -42,7 +42,7 @@ if (!defined('__SECURITY')) { require($INC); } elseif (!IS_MEMBER()) { $URL = 'modules.php?module=index'; - if ($check == 'mem_only') $URL .= '&msg='.getCode('MODULE_MEM_ONLY') . '&mod='.$GLOBALS['module']; + if ($check == 'mem_only') $URL .= '&msg='.getCode('MODULE_MEM_ONLY') . '&mod='.getModule(); redirectToUrl($URL); } @@ -68,15 +68,15 @@ OUTPUT_HTML(" "); // Adding the main content module here -if (empty($GLOBALS['action'])) { - if (empty($GLOBALS['what'])) $GLOBALS['what'] = 'welcome'; +if (!isActionSet()) { + if (!isWhatSet()) setWhat('welcome'); } else { - $act = SQL_ESCAPE($GLOBALS['action']); + $act = getAction(); } // Add the member's menu here... if ((getConfig('member_menu') == 'Y') || (!EXT_IS_ACTIVE('sql_patches', true))) { - ADD_MENU('member', getModeAction('member', $GLOBALS['what']), $GLOBALS['what']); + ADD_MENU('member', getModeAction('member', getWhat()), getWhat()); } // END - if // Menu -> content @@ -84,7 +84,7 @@ OUTPUT_HTML(" "); $INC = sprintf("inc/modules/member/action-%s.php", $act); -if ((isIncludeReadable($INC)) && (isMenuActionValid('member', $GLOBALS['action'], $GLOBALS['what']))) { +if ((isIncludeReadable($INC)) && (isMenuActionValid('member', getAction(), getWhat()))) { // Requested module is available so we load it loadInclude($INC); } else { diff --git a/inc/modules/member/action- b/inc/modules/member/action- index e238f6d920..da78c8466d 100644 --- a/inc/modules/member/action- +++ b/inc/modules/member/action- @@ -54,12 +54,12 @@ if (!defined('__SECURITY')) { ADD_DESCR('member', __FILE__); // Load the include file -$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/member/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the member action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what'])); + addFatalMessage(__FILE__, __LINE__, getMessage('MEMBER_404_ACTION'), getWhat()); } // diff --git a/inc/modules/member/action-account.php b/inc/modules/member/action-account.php index 24c6e8e6f7..2fb0d256ca 100644 --- a/inc/modules/member/action-account.php +++ b/inc/modules/member/action-account.php @@ -51,12 +51,12 @@ if (!defined('__SECURITY')) { ADD_DESCR('member', __FILE__); // Load the include file -$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/member/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the member action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what'])); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), getWhat())); } // diff --git a/inc/modules/member/action-bank.php b/inc/modules/member/action-bank.php index dbf88b3647..6fb577f5fd 100644 --- a/inc/modules/member/action-bank.php +++ b/inc/modules/member/action-bank.php @@ -54,12 +54,12 @@ if (!defined('__SECURITY')) { ADD_DESCR('member', __FILE__); // Load the include file -$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/member/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the member action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what'])); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), getWhat())); } // diff --git a/inc/modules/member/action-extras.php b/inc/modules/member/action-extras.php index aa719fd1c5..80760aee9b 100644 --- a/inc/modules/member/action-extras.php +++ b/inc/modules/member/action-extras.php @@ -51,12 +51,12 @@ if (!defined('__SECURITY')) { ADD_DESCR('member', __FILE__); // Load the include file -$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/member/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the member action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what'])); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), getWhat())); } // diff --git a/inc/modules/member/action-logout.php b/inc/modules/member/action-logout.php index f641c9c9ff..4c3ee15933 100644 --- a/inc/modules/member/action-logout.php +++ b/inc/modules/member/action-logout.php @@ -51,12 +51,12 @@ if (!defined('__SECURITY')) { ADD_DESCR('member', __FILE__); // Load the include file -$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/member/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the member action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what'])); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), getWhat())); } // diff --git a/inc/modules/member/action-main.php b/inc/modules/member/action-main.php index 0bfcec04f7..ad1179d414 100644 --- a/inc/modules/member/action-main.php +++ b/inc/modules/member/action-main.php @@ -51,12 +51,12 @@ if (!defined('__SECURITY')) { ADD_DESCR('member', __FILE__); // Load the include file -$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/member/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the member action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what'])); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), getWhat())); } // diff --git a/inc/modules/member/action-order.php b/inc/modules/member/action-order.php index 756a6b232e..71fb41b0b8 100644 --- a/inc/modules/member/action-order.php +++ b/inc/modules/member/action-order.php @@ -54,12 +54,12 @@ if (!defined('__SECURITY')) { ADD_DESCR('member', __FILE__); // Load the include file -$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/member/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the member action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what'])); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), getWhat())); } // diff --git a/inc/modules/member/action-rals.php b/inc/modules/member/action-rals.php index 083aa8b71e..3a3c1681ec 100644 --- a/inc/modules/member/action-rals.php +++ b/inc/modules/member/action-rals.php @@ -51,12 +51,12 @@ if (!defined('__SECURITY')) { ADD_DESCR('member', __FILE__); // Load the include file -$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/member/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the member action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what'])); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), getWhat())); } // diff --git a/inc/modules/member/action-stats.php b/inc/modules/member/action-stats.php index ed3ec0f80c..3e47e7fe83 100644 --- a/inc/modules/member/action-stats.php +++ b/inc/modules/member/action-stats.php @@ -51,12 +51,12 @@ if (!defined('__SECURITY')) { ADD_DESCR('member', __FILE__); // Load the include file -$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/member/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the member action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what'])); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), getWhat())); } // diff --git a/inc/modules/member/action-surfbar.php b/inc/modules/member/action-surfbar.php index 24945ce4f0..a1e5c7719b 100644 --- a/inc/modules/member/action-surfbar.php +++ b/inc/modules/member/action-surfbar.php @@ -54,12 +54,12 @@ if (!defined('__SECURITY')) { ADD_DESCR('member', __FILE__); // Load the include file -$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); +$INC = sprintf("inc/modules/member/what-%s.php", getWhat()); if (isIncludeReadable($INC)) { // Ok, we finally load the member action module loadInclude($INC); } else { - addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what'])); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), getWhat())); } // diff --git a/inc/modules/member/action-themes.php b/inc/modules/member/action-themes.php index 2bce462e88..46acae9c4e 100644 --- a/inc/modules/member/action-themes.php +++ b/inc/modules/member/action-themes.php @@ -56,13 +56,13 @@ $num_themes = SQL_NUMROWS($result_themes); if ($num_themes > 1) { // If more than 1 is installed output selection box $act = ''; $wht = ''; - if (!empty($GLOBALS['action'])) $act = SQL_ESCAPE($GLOBALS['action']); - if (!empty($GLOBALS['what'])) $wht = SQL_ESCAPE($GLOBALS['what']); - $OUT = generateThemeSelectionBox("login", $act, $wht, $result_themes); + if (isActionSet()) $act = getAction(); + if (isWhatSet()) $wht = getWhat(); + $OUT = generateThemeSelectionBox('login', $act, $wht, $result_themes); } elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0))) { // If there's only one just print it's name define('__THEME_NAME', getCurrentThemeName()); - $OUT = LOAD_TEMPLATE("theme_one", true); + $OUT = LOAD_TEMPLATE('theme_one', true); } elseif (IS_ADMIN()) { // If there is no theme installed and there's an admin notify him! $OUT = LOAD_TEMPLATE('admin_settings_saved', true, "
    {--ADMIN_NO_THEME_INSTALLED_WARNING--}
    "); @@ -72,7 +72,7 @@ if ($num_themes > 1) { SQL_FREERESULT($result_themes); // Load final box template -LOAD_TEMPLATE("theme_select_box", false, $OUT); +LOAD_TEMPLATE('theme_select_box', false, $OUT); // ?> diff --git a/inc/modules/sponsor.php b/inc/modules/sponsor.php index d42bcc63db..4f88a06f9e 100644 --- a/inc/modules/sponsor.php +++ b/inc/modules/sponsor.php @@ -46,9 +46,9 @@ if (!defined('__SECURITY')) { // No sponsor! addFatalMessage(__FILE__, __LINE__, getMessage('SPONSOR_ONLY_AREA_ENTERED')); return; -} elseif (empty($GLOBALS['what'])) { +} elseif (!isWhatSet()) { // Empty what value detected! - $GLOBALS['what'] = "welcome"; + setWhat('welcome'); } // A valid sponsor login and we are allowed to enter this module so let's @@ -56,22 +56,22 @@ if (!defined('__SECURITY')) { UPDATE_SPONSOR_LOGIN(); // Generate menu -define('__SPONSOR_MENU', GENERATE_SPONSOR_MENU($GLOBALS['what'])); +define('__SPONSOR_MENU', GENERATE_SPONSOR_MENU(getWhat())); // Generate right-side output -define('__SPONSOR_CONTENT', GENERATE_SPONSOR_CONTENT($GLOBALS['what'])); +define('__SPONSOR_CONTENT', GENERATE_SPONSOR_CONTENT(getWhat())); // Load header template -define('__SPONSOR_HEADER', LOAD_TEMPLATE("sponsor_header", true)); +define('__SPONSOR_HEADER', LOAD_TEMPLATE('sponsor_header', true)); // Load footer template -define('__SPONSOR_FOOTER', LOAD_TEMPLATE("sponsor_footer", true)); +define('__SPONSOR_FOOTER', LOAD_TEMPLATE('sponsor_footer', true)); -// "You are here" navigation -define('__SPONSOR_YOURE_HERE', ADD_DESCR('sponsor', $GLOBALS['what'], false, false)); +// 'You are here' navigation +define('__SPONSOR_YOURE_HERE', ADD_DESCR('sponsor', getWhat(), false, false)); // Load main sponsor template -LOAD_TEMPLATE("sponsor_main"); +LOAD_TEMPLATE('sponsor_main'); // ?> diff --git a/inc/monthly/monthly_ b/inc/monthly/monthly_ index 8c1981f126..4b38382eec 100644 --- a/inc/monthly/monthly_ +++ b/inc/monthly/monthly_ @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($CSS == 1) || (isResetModeEnabled())) return; +if ((getOutputMode() == 1) || (isResetModeEnabled())) return; // ?> diff --git a/inc/monthly/monthly_beg.php b/inc/monthly/monthly_beg.php index 0b431b7428..d56d0108ba 100644 --- a/inc/monthly/monthly_beg.php +++ b/inc/monthly/monthly_beg.php @@ -45,14 +45,14 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled()) || (getConfig('beg_rallye') != 'Y')) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled()) || (getConfig('beg_rallye') != 'Y')) return; //* DEBUG: */ echo basename(__FILE__)."
    \n"; // Get current month (2 digits) $curr = date('m', time()); // Check if month is done -if (($curr != getConfig('last_month')) && (getConfig('last_month') > 0) && (getConfig('beg_ranks') > 0) && ($GLOBALS['output_mode'] != 1)) { +if (($curr != getConfig('last_month')) && (getConfig('last_month') > 0) && (getConfig('beg_ranks') > 0) && (getOutputMode() != 1)) { // Extension 'autopurge' is inactive or purging of inactive accounts is deactivated $whereStatement1 = ''; $whereStatement2 = getConfig(('beg_ranks')); diff --git a/inc/monthly/monthly_bonus.php b/inc/monthly/monthly_bonus.php index 1d6026ebb4..026bbd20a2 100644 --- a/inc/monthly/monthly_bonus.php +++ b/inc/monthly/monthly_bonus.php @@ -45,13 +45,13 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled())) return; //* DEBUG: */ echo basename(__FILE__)."
    \n"; // Get current month (2 digits) $curr = date('m', time()); -if (($curr != getConfig('last_month')) && (getConfig('bonus_ranks') > 0) && ($GLOBALS['output_mode'] != 1)) { +if (($curr != getConfig('last_month')) && (getConfig('bonus_ranks') > 0) && (getOutputMode() != 1)) { // Extension 'autopurge' is inactive or purging of inactive accounts is deactivated $whereStatement1 = "WHERE `status`='CONFIRMED'"; $whereStatement2 = getConfig(('bonus_ranks')); diff --git a/inc/monthly/monthly_newsletter.php b/inc/monthly/monthly_newsletter.php index 716079e381..6f734eb2d9 100644 --- a/inc/monthly/monthly_newsletter.php +++ b/inc/monthly/monthly_newsletter.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled())) return; //* DEBUG: */ echo basename(__FILE__)."
    \n"; // Get current month (2 digits) diff --git a/inc/monthly/monthly_surfbar.php b/inc/monthly/monthly_surfbar.php index 353bf62d3e..842c23bd95 100644 --- a/inc/monthly/monthly_surfbar.php +++ b/inc/monthly/monthly_surfbar.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled())) return; //* DEBUG: */ echo basename(__FILE__)."
    \n"; // Reset surfbar counter diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index 5ad12fcb5d..91dc03e9e2 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -78,8 +78,8 @@ if ((!isInstalling()) && (isInstalled())) { loadIncludeOnce('inc/load_config.php'); // Check for write-permission for config.php and inc directory - if (empty($GLOBALS['module'])) $GLOBALS['module'] = REQUEST_GET('module'); - if (empty($GLOBALS['module'])) $GLOBALS['module'] = 'index'; + if (!isModuleSet()) setModule(REQUEST_GET('module')); + if (!isModuleSet()) setModule('index'); // CSS array EXT_INIT_CSS_FILES(); @@ -125,41 +125,41 @@ if ((!isInstalling()) && (isInstalled())) { //* DEBUG: */ die(); // Get all values - if (($GLOBALS['output_mode'] != 1) && ($GLOBALS['output_mode'] != -1)) { - if (empty($GLOBALS['module'])) $GLOBALS['module'] = 'empty'; - if (empty($GLOBALS['what'])) $GLOBALS['what'] = getWhatFromModule($GLOBALS['module']); - if (empty($GLOBALS['action'])) $GLOBALS['action'] = getModeAction($GLOBALS['module'], $GLOBALS['what']); + if ((getOutputMode() != 1) && (getOutputMode() != -1)) { + if (!isModuleSet()) setModule('empty'); + if (!isWhatSet()) setWhat(getWhatFromModule(getModule())); + if (!isActionSet()) setAction(getModeAction(getModule(), getWhat())); } else { // Set action/what to empty - $GLOBALS['action'] = ''; - $GLOBALS['what'] = ''; + setAction(''); + setWhat(''); } // Run the init filter chain runFilterChain('init'); // Set default 'what' value - //* DEBUG: */ OUTPUT_HTML('-'.$GLOBALS['module'].'/'.$GLOBALS['what']."-
    "); - if ((empty($GLOBALS['what'])) && (empty($GLOBALS['action'])) && ($GLOBALS['output_mode'] != 1) && ($GLOBALS['output_mode'] != -1)) { - if ($GLOBALS['module'] == 'admin') { + //* DEBUG: */ OUTPUT_HTML('-'.getModule().'/'.getWhat()."-
    "); + if ((!isWhatSet()) && (!isActionSet()) && (getOutputMode() != 1) && (getOutputMode() != -1)) { + if (getModule() == 'admin') { // Set 'action' value to 'login' in admin menu - $GLOBALS['action'] = getModeAction($GLOBALS['module'], $GLOBALS['what']); - } elseif (($GLOBALS['module'] == 'index') || ($GLOBALS['module'] == 'login')) { + setAction(getModeAction(getModule(), getWhat())); + } elseif ((getModule() == 'index') || (getModule() == 'login')) { // Set 'what' value to 'welcome' in guest and member menu - $GLOBALS['what'] = 'welcome'; - if (getConfig('index_home') != '') $GLOBALS['what'] = getConfig('index_home'); + setWhat('welcome'); + if (getConfig('index_home') != '') setWhatFromConfig('index_home'); } else { // Anything else like begging link - $GLOBALS['what'] = ''; + setWhat(''); } } // END - if // Update sending pool - if (($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) loadIncludeOnce('inc/pool-update.php'); // Sends out mails in configureable steps + if ((getOutputMode() != '1') && (getOutputMode() != '-1')) loadIncludeOnce('inc/pool-update.php'); // Sends out mails in configureable steps // Load all active extension including language files when not upgrading. // Check module for testing and count one click - if (checkModulePermissions($GLOBALS['module']) == 'done') countModuleHit($GLOBALS['module']); + if (checkModulePermissions(getModule()) == 'done') countModuleHit(getModule()); // Shall we activate the exchange? if (getConfig('activate_xchange') > 0) activateExchange(); @@ -193,13 +193,13 @@ if ((!isInstalling()) && (isInstalled())) { setConfigEntry('OUTPUT_MODE', 'direct'); // This hack prevents a backtrace in CSS output - if ($GLOBALS['output_mode'] == '1') { + if (getOutputMode() == '1') { // Problem with config so set output mode setConfigEntry('OUTPUT_MODE', 'render'); } // END - if // Set other missing variables - if (!isset($GLOBALS['output_mode'])) $GLOBALS['output_mode'] = '0'; + if (!isOutputModeSet()) setOutputMode('0'); // Include databases.php loadIncludeOnce('inc/databases.php'); @@ -211,7 +211,7 @@ if ((!isInstalling()) && (isInstalled())) { loadIncludeOnce('inc/versions.php'); // Check if we are in installation routine - if ((!isInstalling()) && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != -1)) { + if ((!isInstalling()) && (getOutputMode() != '1') && (getOutputMode() != -1)) { // Redirect to the installation system redirectToUrl('install.php'); } // END - if @@ -246,7 +246,7 @@ loadIncludeOnce('inc/session.php'); // Load versions loadIncludeOnce('inc/versions.php'); -if ((getTotalFatalErrors() > 0) && (isInstalled()) && (!isInstalling()) && ($GLOBALS['output_mode'] != '1')) { +if ((getTotalFatalErrors() > 0) && (isInstalled()) && (!isInstalling()) && (getOutputMode() != '1')) { // One or more fatal error(s) occur during connect... loadIncludeOnce('inc/header.php'); loadIncludeOnce('inc/fatal_errors.php'); diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 84c5fd08fc..4fda5f3680 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -87,12 +87,12 @@ function getModuleTitle ($mod) { 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", @@ -278,7 +278,7 @@ function ADD_DESCR ($ACC_LVL, $FQFN, $return = false, $output = true) { case 'sponsor': case 'guest': case 'member': - $modCheck = $GLOBALS['module']; + $modCheck = getModule(); break; } $AND = " AND (`what`='' OR `what` IS NULL)"; @@ -294,7 +294,7 @@ function ADD_DESCR ($ACC_LVL, $FQFN, $return = false, $output = true) { case 'guest': case 'member': - $modCheck = $GLOBALS['module']; + $modCheck = getModule(); if (!IS_ADMIN()) { $AND = " AND `visible`='Y' AND `locked`='N'"; } @@ -306,20 +306,20 @@ function ADD_DESCR ($ACC_LVL, $FQFN, $return = false, $output = true) { // 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 = "
    {--YOU_ARE_HERE--} Home"; + $prefix = "
    {--YOU_ARE_HERE--} Home"; } else { if (!$return) $GLOBALS['nav_depth']++; $prefix = ''; @@ -351,8 +351,8 @@ function ADD_DESCR ($ACC_LVL, $FQFN, $return = false, $output = true) { $OUT = $prefix."".$ret."\n"; // Can we close the you-are-here navigation? - //* DEBUG: */ echo __LINE__."*".$type.'/'.$GLOBALS['what']."*
    \n"; - if (($type == 'what') || (($type == 'action') && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview")))) { + //* DEBUG: */ echo __LINE__."*".$type.'/'.getWhat()."*
    \n"; + if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) { //* DEBUG: */ echo __LINE__.'+'.$type."+
    \n"; // Add closing div and br-tag $OUT .= "

    \n"; @@ -399,12 +399,12 @@ function ADD_MENU ($mode, $act, $wht) { // 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']."*
    \n"; + //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$main_action.'/'.$sub_what.':'.getWhat()."*
    \n"; if (SQL_NUMROWS($result_main) > 0) { OUTPUT_HTML(""); // 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']."*
    \n"; + //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$sub_what.':'.getWhat()."*
    \n"; // Init variables $GLOBALS['block_mode'] = false; $act = $content['action']; @@ -441,7 +441,7 @@ function ADD_MENU ($mode, $act, $wht) { } // Navigation link - $OUT .= ""; + $OUT .= ""; } else { $OUT .= ""; } @@ -484,16 +484,16 @@ function ADD_MENU ($mode, $act, $wht) { if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML(""); } - //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*
    \n"; + //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*
    \n"; } $main_cnt++; - //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*
    \n"; + //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*
    \n"; if (SQL_NUMROWS($result_main) > $main_cnt) { OUTPUT_HTML("
    "); } // END - if @@ -503,7 +503,7 @@ function ADD_MENU ($mode, $act, $wht) { SQL_FREERESULT($result_main); // Close table - //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*
    \n"; + //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*
    \n"; OUTPUT_HTML("
    "); - //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*
    \n"; + //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*
    \n"; loadInclude($INC_BLOCK); - //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*
    \n"; + //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*
    \n"; if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML("
    "); } } @@ -731,7 +731,7 @@ function isMenuActionValid ($mode, $act, $wht, $UPDATE=false) { // 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); @@ -898,13 +898,13 @@ function countModuleHit($mod) { } // 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']."=
    "; + //* DEBUG: */ echo __LINE__.'='.$mode.'/'.$wht.'/'.getAction()."=
    "; if ((empty($wht)) && ($mode != 'admin')) { - $wht = "welcome"; + $wht = 'welcome'; if (getConfig('index_home') != '') $wht = getConfig('index_home'); } // END - if @@ -913,16 +913,16 @@ function getModeAction ($mode, &$wht) { 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__."(".__LINE__."): ret=".$ret."
    \n"; @@ -931,11 +931,11 @@ function getModeAction ($mode, &$wht) { // 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", @@ -1762,7 +1762,7 @@ function SUB_POINTS ($subject, $uid, $points) { // 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 diff --git a/inc/reset/reset_ b/inc/reset/reset_ index b1b4384da1..b3a9eaad84 100644 --- a/inc/reset/reset_ +++ b/inc/reset/reset_ @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($CSS == 1) || (!isResetModeEnabled())) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled())) return; // ?> diff --git a/inc/reset/reset_beg.php b/inc/reset/reset_beg.php index 58460c22c9..bd04234ba5 100644 --- a/inc/reset/reset_beg.php +++ b/inc/reset/reset_beg.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled()) || (getConfig('beg_rallye') == 'Y')) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled()) || (getConfig('beg_rallye') == 'Y')) return; //* DEBUG: */ echo basename(__FILE__)."
    \n"; // Reset accounts diff --git a/inc/reset/reset_bonus.php b/inc/reset/reset_bonus.php index 449a2c1f09..03fabd84c8 100644 --- a/inc/reset/reset_bonus.php +++ b/inc/reset/reset_bonus.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled())) return; //* DEBUG: */ echo basename(__FILE__)."
    \n"; // Purge expired entries in _bonus_turbo diff --git a/inc/reset/reset_daily.php b/inc/reset/reset_daily.php index 9eabcfd2df..87a9a10a63 100644 --- a/inc/reset/reset_daily.php +++ b/inc/reset/reset_daily.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled())) return; //* DEBUG: */ echo basename(__FILE__)."
    \n"; // Update user profiles diff --git a/inc/reset/reset_engine.php b/inc/reset/reset_engine.php index ff7988b91e..0b815c9b20 100644 --- a/inc/reset/reset_engine.php +++ b/inc/reset/reset_engine.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled())) return; //* DEBUG: */ echo basename(__FILE__)."
    \n"; // diff --git a/inc/reset/reset_holiday.php b/inc/reset/reset_holiday.php index c68de78391..b1fbc5d827 100644 --- a/inc/reset/reset_holiday.php +++ b/inc/reset/reset_holiday.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($GLOBALS['output_mode'] == 1) || ((!isResetModeEnabled()) && (getConfig('holiday_mode') == "RESET"))) return; +if ((getOutputMode() == 1) || ((!isResetModeEnabled()) && (getConfig('holiday_mode') == "RESET"))) return; //* DEBUG: */ echo basename(__FILE__)."
    \n"; // Check for holidays we need to enable and send email to user diff --git a/inc/reset/reset_surfbar.php b/inc/reset/reset_surfbar.php index ae7c8df0a0..fd5b6527ab 100644 --- a/inc/reset/reset_surfbar.php +++ b/inc/reset/reset_surfbar.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled())) return; //* DEBUG: */ echo basename(__FILE__)."
    \n"; // Reset surfbar counter diff --git a/inc/reset/reset_yoomedia.php b/inc/reset/reset_yoomedia.php index 9dcaf9989b..93810c7448 100644 --- a/inc/reset/reset_yoomedia.php +++ b/inc/reset/reset_yoomedia.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled())) return; // Simply reset the requests here updateConfiguration('yoomedia_requests_remain', getConfig('yoomedia_requests_total')); diff --git a/inc/session-functions.php b/inc/session-functions.php index a2d1e8c22b..495c36625f 100644 --- a/inc/session-functions.php +++ b/inc/session-functions.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { // Unset/set session variables function setSession ($var, $value) { // Abort in CSS mode here - if ($GLOBALS['output_mode'] == 1) return true; + if (getOutputMode() == 1) return true; // Trim value and session variable $var = trim(SQL_ESCAPE($var)); $value = trim($value); diff --git a/inc/stylesheet.php b/inc/stylesheet.php index 3748c130d1..0e2045ae02 100644 --- a/inc/stylesheet.php +++ b/inc/stylesheet.php @@ -54,7 +54,7 @@ if ((isInstalling()) || (!isInstalled())) $STYLES[] = 'install.css'; if (!isConfigEntrySet('css_php')) setConfigEntry('css_php', 'FILE'); // Output CSS files or content or link to css.php ? -if (($GLOBALS['output_mode'] == '1') || (getConfig('css_php') == 'DIRECT')) { +if ((getOutputMode() == '1') || (getConfig('css_php') == 'DIRECT')) { // Load CSS files $STYLES = merge_array($STYLES, EXT_GET_CSS_FILES()); diff --git a/inc/weekly/weekly_ b/inc/weekly/weekly_ index 708d507567..4b64b8208e 100644 --- a/inc/weekly/weekly_ +++ b/inc/weekly/weekly_ @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($CSS == 1) || (!isResetModeEnabled())) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled())) return; // ?> diff --git a/inc/weekly/weekly_surfbar.php b/inc/weekly/weekly_surfbar.php index 78770742b2..7527451607 100644 --- a/inc/weekly/weekly_surfbar.php +++ b/inc/weekly/weekly_surfbar.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return; +if ((getOutputMode() == 1) || (!isResetModeEnabled())) return; //* DEBUG: */ echo basename(__FILE__)."
    \n"; // Reset the surfbar counter diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index bbe9c0c879..7cc9c9ec6b 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -444,5 +444,154 @@ function isNicknameUsed ($userid) { return $isUsed; } +// Getter for 'what' value +function getWhat () { + // Default is null + $what = null; + + // Is the value set? + if (isWhatSet(true)) { + // Then use it + $what = $GLOBALS['what']; + } // END - if + + // Return it + return $what; +} + +// Setter for 'what' value +function setWhat ($newWhat) { + $GLOBALS['what'] = SQL_ESCAPE($newWhat); +} + +// Setter for 'what' from configuration +function setWhatFromConfig ($configEntry) { + // Get 'what' from config + $what = getConfig($configEntry); + + // Set it + setWhat($what); +} + +// Checks wether what is set and optionally aborts on miss +function isWhatSet ($abortOnMiss = false) { + // Check for it + $isset = (!empty($GLOBALS['what'])); + + // Should we abort here? + if (($abortOnMiss === true) && ($isset === false)) { + // Output backtrace + debug_report_bug('what is empty.'); + } // END - if + + // Return it + return $isset; +} + +// Getter for 'action' value +function getAction () { + // Default is null + $action = null; + + // Is the value set? + if (isActionSet(true)) { + // Then use it + $action = $GLOBALS['action']; + } // END - if + + // Return it + return $action; +} + +// Setter for 'action' value +function setAction ($newAction) { + $GLOBALS['action'] = SQL_ESCAPE($newAction); +} + +// Checks wether action is set and optionally aborts on miss +function isActionSet ($abortOnMiss = false) { + // Check for it + $isset = (!empty($GLOBALS['action'])); + + // Should we abort here? + if (($abortOnMiss === true) && ($isset === false)) { + // Output backtrace + debug_report_bug('action is empty.'); + } // END - if + + // Return it + return $isset; +} + +// Getter for 'module' value +function getModule () { + // Default is null + $module = null; + + // Is the value set? + if (isModuleSet(true)) { + // Then use it + $module = $GLOBALS['module']; + } // END - if + + // Return it + return $module; +} + +// Setter for 'module' value +function setModule ($newModule) { + $GLOBALS['module'] = SQL_ESCAPE($newModule); +} + +// Checks wether module is set and optionally aborts on miss +function isModuleSet ($abortOnMiss = false) { + // Check for it + $isset = (!empty($GLOBALS['module'])); + + // Should we abort here? + if (($abortOnMiss === true) && ($isset === false)) { + // Output backtrace + debug_report_bug('module is empty.'); + } // END - if + + // Return it + return $isset; +} + +// Getter for 'output_mode' value +function getOutputMode () { + // Default is null + $output_mode = null; + + // Is the value set? + if (isOutputModeSet(true)) { + // Then use it + $output_mode = $GLOBALS['output_mode']; + } // END - if + + // Return it + return $output_mode; +} + +// Setter for 'output_mode' value +function setOutputMode ($newOutputMode) { + $GLOBALS['output_mode'] = SQL_ESCAPE($newOutputMode); +} + +// Checks wether output_mode is set and optionally aborts on miss +function isOutputModeSet ($abortOnMiss = false) { + // Check for it + $isset = (isset($GLOBALS['output_mode'])); + + // Should we abort here? + if (($abortOnMiss === true) && ($isset === false)) { + // Output backtrace + debug_report_bug('output_mode is empty.'); + } // END - if + + // Return it + return $isset; +} + // [EOF] ?>