// 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();
// Debug output
//* DEBUG: */ print "Query=<pre>".$sql_string."</pre>, affected=<strong>".SQL_AFFECTEDROWS()."</strong>, numrows=<strong>".SQL_NUMROWS($result)."</strong><br />\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");
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')));
}
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
'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')));
}
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')));
}
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);
$content = $data;
// Handle failed logins here if not in guest
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):type={$data['type']},action={$GLOBALS['action']},what={$GLOBALS['what']},lvl={$data['access_level']}<br />\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__."(<font color=\"#0000aa\">".__LINE__."</font>):type={$data['type']},action={getAction()},what={getWhat()},lvl={$data['access_level']}<br />\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
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'])) {
} // 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();
// 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
// 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
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
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
////////////////////////
$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...
$NAV .= "<strong>-";
} else {
// Open anchor tag and add base URL
- $NAV .= "<a href=\"{!URL!}/modules.php?module=admin&what=" . $GLOBALS['what']."&page=" . $page."&offset=" . $offset;
+ $NAV .= "<a href=\"{!URL!}/modules.php?module=admin&what=" . getWhat()."&page=" . $page."&offset=" . $offset;
// Add userid when we shall show all mails from a single member
if ((REQUEST_ISSET_GET('uid')) && (bigintval(REQUEST_GET('uid')) > 0)) $NAV .= "&uid=".bigintval(REQUEST_GET('uid'));
// Fix it to default
$ret = 'default';
} // END - if
- } elseif ((!isInstalled()) && ((isInstalling()) || ($GLOBALS['output_mode'] == true)) && ((REQUEST_ISSET_GET('theme')) || (REQUEST_ISSET_POST('theme')))) {
+ } elseif ((!isInstalled()) && ((isInstalling()) || (getOutputMode() == true)) && ((REQUEST_ISSET_GET('theme')) || (REQUEST_ISSET_POST('theme')))) {
// Prepare FQFN for checking
$theme = sprintf("%stheme/%s/theme.php", constant('PATH'), REQUEST_GET('theme'));
// Log this message away
$fp = fopen(constant('PATH')."inc/cache/debug.log", 'a') or app_die(__FUNCTION__, __LINE__, "Cannot write logfile debug.log!");
- fwrite($fp, date("d.m.Y|H:i:s", time())."|" . $GLOBALS['module']."|".basename($funcFile)."|" . $line."|".strip_tags($message)."\n");
+ fwrite($fp, date("d.m.Y|H:i:s", time())."|" . getModule()."|".basename($funcFile)."|" . $line."|".strip_tags($message)."\n");
fclose($fp);
} // END - if
}
// Is the header already sent?
if (($GLOBALS['header_sent'] != '1') && ($GLOBALS['header_sent'] != '2')) {
// If not in CSS mode generate the header
- if (($GLOBALS['output_mode'] != '1')) {
+ if ((getOutputMode() != '1')) {
// Generate header
$TITLE = '';
$TITLE .= constant('MAIN_TITLE');
// Add title of module? (middle decoration will also be added!)
- if ((getConfig('enable_mod_title') == 'Y') || ((empty($GLOBALS['what'])) && (empty($GLOBALS['action']))) || ($GLOBALS['module'] == 'admin')) $TITLE .= " ".trim(getConfig('title_middle'))." ".getModuleTitle($GLOBALS['module']);
+ if ((getConfig('enable_mod_title') == 'Y') || ((!isWhatSet()) && (!isActionSet())) || (getModule() == 'admin')) {
+ $TITLE .= " ".trim(getConfig('title_middle'))." ".getModuleTitle(getModule());
+ } // END - if
// Add title from what file
$mode = '';
- if ($GLOBALS['module'] == "login") $mode = 'member';
- elseif ($GLOBALS['module'] == 'index') $mode = 'guest';
- if ((!empty($mode)) && (getConfig('enable_what_title') == 'Y')) $TITLE .= " ".trim(getConfig('title_middle'))." ".getModuleDescription($mode, $GLOBALS['what']);
+ if (getModule() == 'login') $mode = 'member';
+ elseif (getModule() == 'index') $mode = 'guest';
+ if ((!empty($mode)) && (getConfig('enable_what_title') == 'Y')) $TITLE .= " ".trim(getConfig('title_middle'))." ".getModuleDescription($mode, getWhat());
// Add title decorations? (right)
if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_right') != '')) $TITLE .= " ".trim(getConfig('title_right'));
LOAD_TEMPLATE('page_header');
// Include meta data in 'guest' module
- if ($GLOBALS['module'] == 'index') {
+ if (getModule() == 'index') {
// Load meta data template
LOAD_TEMPLATE('metadata');
// Add meta description to header
if ((isInstalled()) && (isAdminRegistered()) && (SQL_IS_LINK_UP())) {
// Add meta description not in admin and login module and when the script is installed
- generateMetaDescriptionCode($GLOBALS['module'], $GLOBALS['what']);
+ generateMetaDescriptionCode(getModule(), getWhat());
} // END - if
} // END - if
} // END - if
// Closing HEAD tag
- if ($GLOBALS['output_mode'] != '1') OUTPUT_HTML('</head>');
+ if (getOutputMode() != '1') OUTPUT_HTML('</head>');
$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;
// 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;
}
// 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
$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.",
$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
$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'));
$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;
}
define('__ADMINS_ROWS', $OUT);
// Load template
- LOAD_TEMPLATE("admin_list_admins");
+ LOAD_TEMPLATE('admin_list_admins');
}
// Filter for adding extra data to the query
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
// 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/";
// 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 {
// 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 {
$DATA[] = getSession('sponsorpass');
// Saving data was completed... ufff...
- switch ($GLOBALS['what'])
+ switch (getWhat())
{
case "account": // Change account data
if ($EMAIL === true) {
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;
}
// 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);
$OUT .= "<strong>".$ltr."</strong>";
} else {
// Output link to letter
- $OUT .= "<a href=\"{!URL!}/modules.php?module=admin&what=".$GLOBALS['what'];
+ $OUT .= "<a href=\"{!URL!}/modules.php?module=admin&what=".getWhat();
if (REQUEST_ISSET_GET('mode')) $OUT .= "&mode=".REQUEST_GET('mode');
$OUT .= "&letter=".$ltr."&sortby=".$sortby.$add."\">".$ltr."</a>";
}
if (!REQUEST_ISSET_GET('sortby')) REQUEST_SET_GET('sortby', 'userid');
// Base link
- $OUT .= "<a href=\"{!URL!}/modules.php?module=admin&what=".$GLOBALS['what'];
+ $OUT .= "<a href=\"{!URL!}/modules.php?module=admin&what=".getWhat();
// Add status or mode
if (REQUEST_ISSET_GET(('status'))) $OUT .= "&mode=".REQUEST_GET(('status'));
$DEL = array();
// At least one found?
-if ((SQL_NUMROWS($res_ext_crt) > 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
$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');
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');
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');
} // 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');
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');
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');
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');
// 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');
}
// Do not execute when script is in CSS mode
-if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return;
+if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
//
?>
}
// 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()));
// 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)) {
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')));
}
}
// 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());
}
// 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()));
$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
}
// 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');
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;
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())));
}
//
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());
}
//
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());
}
//
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());
}
//
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());
}
//
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());
}
//
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());
}
//
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());
}
//
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');
}
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());
}
//
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());
}
//
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());
}
//
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());
}
//
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());
}
//
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());
}
//
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());
}
//
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());
}
//
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());
}
//
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());
}
//
?>
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());
}
//
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());
}
//
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());
}
//
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());
}
//
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());
}
//
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());
}
//
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());
}
//
//
function ADMIN_DO_ACTION ($wht) {
global $DATA;
- //* DEBUG: */ echo __LINE__."*".$wht.'/'.$GLOBALS['module'].'/'.$GLOBALS['action'].'/'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__."*".$wht.'/'.getModule().'/'.getAction().'/'.getWhat()."*<br />\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'));
// 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`
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);
}
SQL_FREERESULT($result_action);
// Tableset footer
- LOAD_TEMPLATE("admin_main_footer");
+ LOAD_TEMPLATE('admin_main_footer');
}
//
// 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)) {
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;
}
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;
}
// USe this only for adding points (e.g. adding refs really makes no sence ;-) )
if ($add_all === true) $OUT = " <option value=\"all\">{--ALL_MEMBERS--}</option>\n";
- elseif ($none === true) $OUT = " <option value=\"0\">{--SELECT_NONE--}</option>\n";
+ elseif ($none === true) $OUT = " <option value=\"0\">{--SELECT_NONE--}</option>\n";
while ($content = SQL_FETCHARRAY($result)) {
$OUT .= " <option value=\"".bigintval($content['userid'])."\"";
define('__LANG_VALUE', getLanguage());
// Load template
- LOAD_TEMPLATE("admin_member_selection_box", false, $GLOBALS['what']);
+ LOAD_TEMPLATE('admin_member_selection_box', false, getWhat());
} else {
// Return content in selection frame
return "<select class=\"admin_select\" name=\"".$field."\" size=\"1\">\n".$OUT."</select>\n";
// Now, walk through all entries and prepare them for saving
foreach ($POST as $id => $val) {
// Process only formular field but not submit buttons ;)
- if ($id != "ok") {
+ if ($id != 'ok') {
// Do not save the ok value
convertSelectionsToTimestamp($POST, $DATA, $id, $skip);
$part = substr($part, 0, -4);
// Is that part different from the overview?
- if ($part != "overview") {
+ if ($part != 'overview') {
$OUT .= " <option value=\"".$part."\"";
if ($part == $default) $OUT .= ' selected="selected"';
$OUT .= ">".$part."</option>\n";
}
// Check what the admin wants and set it when it's not the global mode
- if ($ADMIN != "global") $mode = $ADMIN;
+ if ($ADMIN != 'global') $mode = $ADMIN;
// Return admin-menu's mode
return $mode;
// Checks wether if the admin menu has entries
function ifAdminMenuHasEntries ($action) {
return (
- ((
- isset($GLOBALS['admin_menu_has_entries'][$action])
- ) && (
- $GLOBALS['admin_menu_has_entries'][$action] === true
- )) || (
- $action == "login"
- )
+ ((
+ isset($GLOBALS['admin_menu_has_entries'][$action])
+ ) && (
+ $GLOBALS['admin_menu_has_entries'][$action] === true
+ )) || (
+ $action == 'login'
+ )
);
}
// Is the userid set correctly?
if ($uid > 0) {
// Create a link to that profile
- return "{!URL!}/modules.php?module=admin&what=list_user&uid=".bigintval($uid);
+ return '{!URL!}/modules.php?module=admin&what=list_user&uid='.bigintval($uid);
} // END - if
// Return a link to the user list
- return "{!URL!}/modules.php?module=admin&what=list_user";
+ return '{!URL!}/modules.php?module=admin&what=list_user';
}
//
$SEL = countPostSelection();
if ($SEL > 0) {
// Add option for events
- $GLOBALS['cache_array']['admins'] = generateOptionList('admins', 'id', "login", '', 'email');
+ $GLOBALS['cache_array']['admins'] = generateOptionList('admins', 'id', 'login', '', 'email');
$SW = 2; $rowNameS = '';
foreach (REQUEST_POST('sel') as $template => $sel) {
// First of all load data from DB
if ($content['admin_id'] == '-1') $OUT .= ' selected="selected"';
$OUT .= ">{--ADMINS_TO_USER_EVENTS--}</option>\n";
}
- $OUT .= generateOptionList('admins', 'id', "login", $content['admin_id'], 'email');
+ $OUT .= generateOptionList('admins', 'id', 'login', $content['admin_id'], 'email');
$OUT .= "</select>\n<br />\n";
$aid2 = $content['admin_id']; $id2 = $content['id'];
}
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');
}
//
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();
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')."*");
// 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
(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
$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();
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));
}
}
);
// 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;
}
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();
);
// 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');
}
}
);
// 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;
}
define('__PAYOUT_ROWS', $OUT);
// Load main template
- LOAD_TEMPLATE("admin_config_payouts");
+ LOAD_TEMPLATE('admin_config_payouts');
}
// Does your members request payouts?
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');
//
?>
// 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');
}
} 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':
// 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
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");
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__);
// 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("<li><a href=\"{!URL!}/modules.php?module=admin&what=".$GLOBALS['what']."&access=".urlencode($file)."\">".$file."</a></li>");
+ OUTPUT_HTML("<li><a href=\"{!URL!}/modules.php?module=admin&what=".getWhat()."&access=".urlencode($file)."\">".$file."</a></li>");
}
}
closedir($handle);
$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'
} // 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)) {
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
// 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);
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()));
}
//
}
// 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());
}
//
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());
}
//
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());
}
//
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());
}
//
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());
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
$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 {
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);
}
<td class=\"member_menu\">");
// 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
<td valign=\"top\" align=\"center\" rowspan=\"3\" class=\"member_content\">");
$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 {
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());
}
//
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()));
}
//
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()));
}
//
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()));
}
//
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()));
}
//
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()));
}
//
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()));
}
//
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()));
}
//
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()));
}
//
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()));
}
//
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, "<div class=\"admin_note\">{--ADMIN_NO_THEME_INSTALLED_WARNING--}</div>");
SQL_FREERESULT($result_themes);
// Load final box template
-LOAD_TEMPLATE("theme_select_box", false, $OUT);
+LOAD_TEMPLATE('theme_select_box', false, $OUT);
//
?>
// 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
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');
//
?>
}
// Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (isResetModeEnabled())) return;
+if ((getOutputMode() == 1) || (isResetModeEnabled())) return;
//
?>
}
// 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__)."<br />\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'));
}
// 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__)."<br />\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'));
}
// 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__)."<br />\n";
// Get current month (2 digits)
}
// 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__)."<br />\n";
// Reset surfbar counter
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();
//* 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']."-<br />");
- if ((empty($GLOBALS['what'])) && (empty($GLOBALS['action'])) && ($GLOBALS['output_mode'] != 1) && ($GLOBALS['output_mode'] != -1)) {
- if ($GLOBALS['module'] == 'admin') {
+ //* DEBUG: */ OUTPUT_HTML('-'.getModule().'/'.getWhat()."-<br />");
+ 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();
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');
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
// 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');
function getModuleDescription ($mode, $wht, $column = 'what') {
// Fix empty 'what'
if (empty($wht)) {
- $wht = "welcome";
+ $wht = 'welcome';
if (getConfig('index_home') != '') $wht = getConfig('index_home');
} // END - if
// Default is not found
- $ret = "??? (".$wht.')';
+ $ret = '??? (' . $wht . ')';
// Look for title
$result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE %s='%s' LIMIT 1",
case 'sponsor':
case 'guest':
case 'member':
- $modCheck = $GLOBALS['module'];
+ $modCheck = getModule();
break;
}
$AND = " AND (`what`='' OR `what` IS NULL)";
case 'guest':
case 'member':
- $modCheck = $GLOBALS['module'];
+ $modCheck = getModule();
if (!IS_ADMIN()) {
$AND = " AND `visible`='Y' AND `locked`='N'";
}
// Sponsor / engine menu
$type = 'what';
$search = $file;
- $modCheck = $GLOBALS['module'];
+ $modCheck = getModule();
$AND = '';
} else {
// Other
$type = "menu";
$search = $file;
- $modCheck = $GLOBALS['module'];
+ $modCheck = getModule();
$AND = '';
}
// Begin the navigation line
if ((!isset($GLOBALS['nav_depth'])) && (!$return)) {
$GLOBALS['nav_depth'] = 0;
- $prefix = "<div class=\"you_are_here\">{--YOU_ARE_HERE--} <strong><a class=\"you_are_here\" href=\"{!URL!}/modules.php?module=".$GLOBALS['module'].$LINK_ADD."\">Home</a></strong>";
+ $prefix = "<div class=\"you_are_here\">{--YOU_ARE_HERE--} <strong><a class=\"you_are_here\" href=\"{!URL!}/modules.php?module=".getModule().$LINK_ADD."\">Home</a></strong>";
} else {
if (!$return) $GLOBALS['nav_depth']++;
$prefix = '';
$OUT = $prefix."<strong><a class=\"you_are_here\" href=\"{!URL!}/modules.php?module=".$modCheck.'&'.$type.'='.$search.$LINK_ADD."\">".$ret."</a></strong>\n";
// Can we close the you-are-here navigation?
- //* DEBUG: */ echo __LINE__."*".$type.'/'.$GLOBALS['what']."*<br />\n";
- if (($type == 'what') || (($type == 'action') && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview")))) {
+ //* DEBUG: */ echo __LINE__."*".$type.'/'.getWhat()."*<br />\n";
+ if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
//* DEBUG: */ echo __LINE__.'+'.$type."+<br />\n";
// Add closing div and br-tag
$OUT .= "</div><br />\n";
// Load SQL data and add the menu to the output stream...
$result_main = SQL_QUERY_ESC("SELECT title, action FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE (`what`='' OR `what` IS NULL)".$AND." ORDER BY `sort`",
array($mode), __FUNCTION__, __LINE__);
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$main_action.'/'.$sub_what.':'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$main_action.'/'.$sub_what.':'.getWhat()."*<br />\n";
if (SQL_NUMROWS($result_main) > 0) {
OUTPUT_HTML("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"".$mode."_menu\">");
// There are menus available, so we simply display them... :)
while ($content = SQL_FETCHARRAY($result_main)) {
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$sub_what.':'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$sub_what.':'.getWhat()."*<br />\n";
// Init variables
$GLOBALS['block_mode'] = false;
$act = $content['action'];
}
// Navigation link
- $OUT .= "<a name=\"menu\" class=\"menu_blur\" href=\"{!URL!}/modules.php?module=".$GLOBALS['module']."&what=".$content['sub_what']."\" target=\"_self\">";
+ $OUT .= "<a name=\"menu\" class=\"menu_blur\" href=\"{!URL!}/modules.php?module=".getModule()."&what=".$content['sub_what']."\" target=\"_self\">";
} else {
$OUT .= "<em>";
}
if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML("<tr>
<td class=\"".$mode."_menu_whats\">");
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
loadInclude($INC_BLOCK);
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML(" </td>
</tr>");
}
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
}
$main_cnt++;
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
if (SQL_NUMROWS($result_main) > $main_cnt) {
OUTPUT_HTML("<tr><td class=\"".$mode."_menu_seperator\"></td></tr>");
} // END - if
SQL_FREERESULT($result_main);
// Close table
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
+ //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
OUTPUT_HTML("</table>");
}
}
// Update guest or member menu
$sql = SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_%s_menu` SET counter=counter+1 WHERE `action`='%s' AND `what`='%s'".$add." LIMIT 1",
array($mode, $act, $wht), __FUNCTION__, __LINE__, false);
- } elseif (($wht != "overview") && (!empty($wht))) {
+ } elseif (($wht != 'overview') && (!empty($wht))) {
// Other actions
$sql = SQL_QUERY_ESC("SELECT id, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND `what`='%s'".$add." ORDER BY action DESC LIMIT 1",
array($mode, $act, $wht), __FUNCTION__, __LINE__, false);
}
// Get action value from mode (admin/guest/member) and what-value
-function getModeAction ($mode, &$wht) {
+function getModeAction ($mode, $wht) {
// Init status
$ret = '';
- //* DEBUG: */ echo __LINE__.'='.$mode.'/'.$wht.'/'.$GLOBALS['action']."=<br />";
+ //* DEBUG: */ echo __LINE__.'='.$mode.'/'.$wht.'/'.getAction()."=<br />";
if ((empty($wht)) && ($mode != 'admin')) {
- $wht = "welcome";
+ $wht = 'welcome';
if (getConfig('index_home') != '') $wht = getConfig('index_home');
} // END - if
if (REQUEST_ISSET_GET('action')) {
// Use from request!
return REQUEST_GET('action');
- } elseif (!empty($GLOBALS['action'])) {
+ } elseif (isActionSet()) {
// Get it directly from URL
- return $GLOBALS['action'];
- } elseif (($wht == "overview") || (empty($GLOBALS['what']))) {
+ return getAction();
+ } elseif (($wht == 'overview') || (!isWhatSet())) {
// Default value for admin area
- $ret = "login";
+ $ret = 'login';
}
- } elseif (!empty($GLOBALS['action'])) {
+ } elseif (isActionSet()) {
// Get it directly from URL
- return $GLOBALS['action'];
+ return getAction();
}
//* DEBUG: */ echo __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ret=".$ret."<br />\n";
// Rewriting modules to menu
switch ($mode) {
case 'index': $mode = 'guest'; break;
- case "login": $mode = 'member'; break;
+ case 'login': $mode = 'member'; break;
} // END - switch
- // Guest and member menu is "main" as the default
- if (empty($ret)) $ret = "main";
+ // Guest and member menu is 'main' as the default
+ if (empty($ret)) $ret = 'main';
// Load from database
$result = SQL_QUERY_ESC("SELECT action FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `what`='%s' LIMIT 1",
// Update config entries
function updateConfiguration ($entries, $values, $updateMode='') {
// Do not update config in CSS mode
- if (($GLOBALS['output_mode'] == '1') || ($GLOBALS['output_mode'] == -1)) {
+ if ((getOutputMode() == '1') || (getOutputMode() == -1)) {
return;
} // END - if
}
// Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isResetModeEnabled())) return;
+if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
//
?>
}
// 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__)."<br />\n";
// Reset accounts
}
// 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__)."<br />\n";
// Purge expired entries in _bonus_turbo
}
// 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__)."<br />\n";
// Update user profiles
}
// 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__)."<br />\n";
//
}
// 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__)."<br />\n";
// Check for holidays we need to enable and send email to user
}
// 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__)."<br />\n";
// Reset surfbar counter
}
// 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'));
// 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);
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());
}
// Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isResetModeEnabled())) return;
+if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
//
?>
}
// 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__)."<br />\n";
// Reset the surfbar counter
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]
?>