// Guest stats
switch (getConfig('guest_stats'))
{
- case "MEMBERS":
- define('__MEMBERS_RADIO', ' selected="selected"');
+ case 'MEMBERS':
+ define('__MEMBERS_RADIO', ' selected='selected'');
define('__MODULES_RADIO', '');
define('__INACTIVE_RADIO', '');
break;
- case "MODULES":
+ case 'MODULES':
define('__MEMBERS_RADIO', '');
- define('__MODULES_RADIO', ' selected="selected"');
+ define('__MODULES_RADIO', ' selected='selected'');
define('__INACTIVE_RADIO', '');
break;
- case "INACTIVE":
+ case 'INACTIVE':
define('__MEMBERS_RADIO', '');
define('__MODULES_RADIO', '');
- define('__INACTIVE_RADIO', ' selected="selected"');
+ define('__INACTIVE_RADIO', ' selected='selected'');
break;
}
define('__STATS_LIMIT', getConfig('stats_limit'));
// Load template
- LOAD_TEMPLATE("admin_config_stats");
+ LOAD_TEMPLATE('admin_config_stats');
}
//
// Check if logged in
if (IS_MEMBER()) {
// Is still logged in so we welcome him with his name
- $result = SQL_QUERY_ESC("SELECT surname, family FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `surname`, `family` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
array(getUserId()), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load surname and family's name and build the username
loadIncludeOnce('inc/header.php');
// Modules are by default not valid!
-$MOD_VALID = false; $check = 'failed';
-if ((getConfig('maintenance') == 'Y') && (!IS_ADMIN()) && ($GLOBALS['module'] != 'admin')) {
+$isModuleValid = false; $check = 'failed';
+if ((getConfig('maintenance') == 'Y') && (!IS_ADMIN()) && (getModule() != 'admin')) {
// Maintain mode is active and you are no admin
addFatalMessage(__FILE__, __LINE__, getMessage('LANG_DOWN_MAINTAINCE'));
} elseif ((SQL_IS_LINK_UP()) && (getTotalFatalErrors() == 0)) {
// Construct module name
- define('__MODULE', sprintf("inc/modules/%s.php", SQL_ESCAPE($GLOBALS['module'])));
+ $GLOBALS['module_inc'] = sprintf("inc/modules/%s.php", SQL_ESCAPE(getModule()));
// Did we found the module listed in allowed modules and are we successfully connected?
- $check = checkModulePermissions($GLOBALS['module']);
- switch ($check)
- {
+ $check = checkModulePermissions(getModule());
+ switch ($check) {
case 'cache_miss': // The cache is gone
case 'admin_only': // Admin-only access
case 'mem_only': // Member-only access
case 'done': // All fine!
// Does the module exists on local file system?
- if ((isFileReadable(constant('__MODULE'))) && (getTotalFatalErrors() == 0)) {
+ if ((isFileReadable($GLOBALS['module_inc'])) && (getTotalFatalErrors() == 0)) {
// Module is valid, active and located on the local disc...
- $MOD_VALID = true;
+ $isModuleValid = true;
} elseif (!empty($URL)) {
// An URL was specified so we load the de-referrer module
redirectToUrl(DEREFERER($URL));
} elseif (getTotalFatalErrors() == 0) {
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), $GLOBALS['module']));
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), getModule()));
}
break;
case '404':
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), $GLOBALS['module']));
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), getModule()));
break;
case 'locked':
- if (!isFileReadable(constant('__MODULE'))) {
+ if (!isFileReadable($GLOBALS['module_inc'])) {
// Module does addionally not exists
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), $GLOBALS['module']));
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), getModule()));
} // END - if
// Add fatal message
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_LOCKED'), $GLOBALS['module']));
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_LOCKED'), getModule()));
break;
default:
- DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s return from module check. Module=%s", $check, $GLOBALS['module']));
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s return from module check. Module=%s", $check, getModule()));
addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_UNKNOWN'), $check));
break;
}
addFatalMessage(__FILE__, __LINE__, getMessage('MYSQL_ERRORS'));
}
-if (($MOD_VALID) && (defined('__MODULE'))) {
+if (($isModuleValid === true) && (isset($GLOBALS['module_inc']))) {
/////////////////////////////////////////////
// Main including line DO NOT REMOVE/EDIT! //
/////////////////////////////////////////////
//
// Everything is okay so we can load the module
- loadIncludeOnce(constant('__MODULE'));
+ loadIncludeOnce($GLOBALS['module_inc']);
} // END - if
// Next-to-end add the footer
if (((REQUEST_ISSET_GET('user')) || (REQUEST_ISSET_GET('reseller'))) && (REQUEST_ISSET_GET('banner'))) {
// for later things... ;-)
- $result = SQL_QUERY_ESC("SELECT url FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE `id`=%s LIMIT 1",
- array(bigintval(REQUEST_GET('banner'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `url` FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE `id`=%s LIMIT 1",
+ array(bigintval(REQUEST_GET('banner'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
list($url) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refbanner` SET counter=counter+1 WHERE `id`=%s LIMIT 1",
- array(bigintval(REQUEST_GET('banner'))), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refbanner` SET `counter`=`counter`+1 WHERE `id`=%s LIMIT 1",
+ array(bigintval(REQUEST_GET('banner'))), __FILE__, __LINE__);
$type = substr($url, -3);
sendHeader('Content-Type: image/' . $type);