From 8d70e4a3ccb69541151ba6842a18950843f5f7b9 Mon Sep 17 00:00:00 2001 From: quix0r Date: Sat, 21 Feb 2009 03:03:11 +0000 Subject: [PATCH] Script rewritten to setConfigEntry(), getConfig() and incrementConfigEntry() --- inc/databases.php | 2 +- inc/db/lib-mysql3.php | 30 ++++++++++++------------- inc/doubler_send.php | 2 +- inc/extensions/ext-sql_patches.php | 14 ++++++------ inc/functions.php | 15 ++++++++++--- inc/gen_sql_patches.php | 12 ++++++---- inc/libs/bonus_functions.php | 7 ++---- inc/libs/rallye_functions.php | 2 +- inc/libs/surfbar_functions.php | 8 +++---- inc/libs/wernis_functions.php | 2 +- inc/libs/yoomedia_functions.php | 10 ++++----- inc/modules/admin.php | 2 +- inc/modules/admin/what-config_beg.php | 6 ++--- inc/modules/admin/what-config_bonus.php | 6 ++--- inc/modules/admin/what-list_user.php | 2 +- inc/modules/admin/what-theme_edit.php | 2 +- inc/modules/guest/action-online.php | 2 -- inc/modules/guest/what-stats.php | 20 ++++++++++++++--- inc/modules/member/what-points.php | 2 +- inc/monthly/monthly_surfbar.php | 1 - inc/mysql-manager.php | 8 +++++++ inc/patch-system.php | 4 ++-- inc/reset/reset_surfbar.php | 4 ++-- inc/stylesheet.php | 2 +- inc/weekly/weekly_surfbar.php | 1 - index.php | 4 ++-- 26 files changed, 98 insertions(+), 72 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index d50dd36e3e..df92e0ae1f 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -86,7 +86,7 @@ $REPLACER = array( ); // One day -$_CONFIG['one_day'] = 60*60*24; +setConfigEntry('one_day', (60*60*24)); // // Timestamp for yesterday, today ... all at 00:00 am diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index 90db1da0b7..58bdc436b2 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { // SQL queries function SQL_QUERY ($sql_string, $F, $L) { - global $link, $CSS, $_CONFIG, $OK; + global $link, $CSS, $OK; // Link is up? if (!is_resource($link)) return false; @@ -67,7 +67,7 @@ Query string:
$queryTime = $querytimeAfter - $querytimeBefore; // Save last successfull query - $_CONFIG['db_last_query'] = $sql_string; + setConfigEntry('db_last_query', $sql_string); // Count this query incrementConfigEntry('sql_count'); @@ -92,10 +92,10 @@ Query string:
// Count DB hits if (getConfig('db_hits_run') == null) { // Count in dummy variable - $_CONFIG['db_hits_run'] = 1; + setConfigEntry('db_hits_run', 1); } else { // Count to config array - $_CONFIG['db_hits_run']++; + incrementConfigEntry('db_hits_run'); } // Return the result @@ -176,28 +176,26 @@ function SQL_FETCHARRAY($res, $nr=0, $remove_numerical=true) { } // SQL result -function SQL_RESULT($res, $row, $field) { +function SQL_RESULT ($res, $row, $field) { $result = mysql_result($res, $row, $field); return $result; } // SQL connect -function SQL_CONNECT($host, $login, $password, $F, $L) { +function SQL_CONNECT ($host, $login, $password, $F, $L) { $connect = mysql_connect($host, $login, $password) or addFatalMessage($F." (".$L."):".mysql_error()); return $connect; } // SQL select database -function SQL_SELECT_DB($dbName, $link, $F, $L) { - $select = false; - if (is_resource($link)) { - $select = mysql_select_db($dbName, $link) or addFatalMessage($F." (".$L."):".mysql_error()); - } - return $select; +function SQL_SELECT_DB ($dbName, $link, $F, $L) { + // Is there still a valid link? If not, skip it. + if (!is_resource($link)) return false; + + return mysql_select_db($dbName, $link) or addFatalMessage($F." (".$L."):".mysql_error()); } // SQL close link -function SQL_CLOSE(&$link, $F, $L) { - global $_CONFIG, $cacheInstance, $cacheArray; +function SQL_CLOSE (&$link, $F, $L) { + global $cacheInstance, $cacheArray; - // Is there still a valid link? if (!is_resource($link)) { // Skip double close return false; @@ -207,7 +205,7 @@ function SQL_CLOSE(&$link, $F, $L) { //* DEBUG: */ echo "DB=".getConfig('db_hits').",CACHE=".getConfig('cache_hits')."
\n"; if ((GET_EXT_VERSION("cache") >= "0.0.7") && (getConfig('db_hits') > 0) && (getConfig('cache_hits') > 0) && (is_object($cacheInstance))) { // Add new hits - $_CONFIG['db_hits'] += getConfig('db_hits_run'); + incrementConfigEntry('db_hits', getConfig('db_hits_run')); // Update counter for db/cache UPDATE_CONFIG(array("db_hits", "cache_hits"), array(bigintval(getConfig('db_hits')), bigintval(getConfig('cache_hits')))); diff --git a/inc/doubler_send.php b/inc/doubler_send.php index bdf6d7b282..1fd505799d 100644 --- a/inc/doubler_send.php +++ b/inc/doubler_send.php @@ -133,7 +133,7 @@ if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) } // END - if // Update variables to prevent errors - $_CONFIG['doubler_used'] += $points; + incrementConfigEntry('doubler_used', $points); $DOUBLER_POINTS -= $points; // Prepare array diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index fb72b89c8b..80a91853bf 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -727,7 +727,7 @@ default: // Do stuff when extension is loaded // When the sql_patches is not installed we cannot load it's configuration... *sigh* if (GET_EXT_VERSION("sql_patches") != '') { // Init key - $_CONFIG['secret_key'] = ""; + setConfigEntry('secret_key', ""); // Read key from secret file if ((getConfig('file_hash') == "") || (getConfig('master_salt') == "") || (getConfig('pass_scramble') == "")) { @@ -753,7 +753,7 @@ default: // Do stuff when extension is loaded $hashFile = sprintf("%sinc/.secret/.%s", constant('PATH'), getConfig('file_hash')); if (FILE_READABLE($hashFile)) { // Read file - $_CONFIG['secret_key'] = READ_FILE($hashFile); + setConfigEntry('secret_key', READ_FILE($hashFile)); } else { // Remove it from database UPDATE_CONFIG("file_hash", ""); @@ -771,11 +771,11 @@ default: // Do stuff when extension is loaded define('_MAX' , getConfig('rand_no')); } else { // Set some lame ( ;-) ) default settings - $_CONFIG['def_refid'] = 0; - $_CONFIG['enable_title_deco'] = "N"; - $_CONFIG['title_mod_show'] = "Y"; - $_CONFIG['title_middle'] = "-"; - // @TODO Can we remove this? $_CONFIG['verbose_sql'] = "N"; + setConfigEntry('def_refid'] = 0; + setConfigEntry('enable_title_deco', = "N"); + setConfigEntry('title_mod_show' , = "Y"); + setConfigEntry('title_middle' , = "-"); + // @TODO Can we remove this? setConfigEntry('verbose_sql' , "N"); define('MT_WORD' , DEFAULT_MT_WORD ); define('MT_WORD2', DEFAULT_MT_WORD2); define('MT_WORD3', DEFAULT_MT_WORD3); diff --git a/inc/functions.php b/inc/functions.php index 6f668fc188..492bd3e90c 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -583,10 +583,8 @@ function MAKE_DATETIME ($time, $mode="0") // Translates the american decimal dot into a german comma function TRANSLATE_COMMA ($dotted, $cut=true, $max=0) { - global $_CONFIG; - // Default is 3 you can change this in admin area "Misc -> Misc Options" - if (getConfig('max_comma') == null) $_CONFIG['max_comma'] = "3"; + if (getConfig('max_comma') == null) setConfigEntry('max_comma', "3"); // Use from config is default $maxComma = getConfig('max_comma'); @@ -2867,6 +2865,17 @@ function getConfig ($entry) { return $value; } +// Setter for $_CONFIG entries +function setConfigEntry ($entry, $value) { + global $_CONFIG; + + // Secure the entry name + $entry = SQL_ESCAPE($entry); + + // And set it + $_CONFIG[$entry] = $value; +} + // @TODO Rewrite all language constants to this function. // "Getter" for language strings function getMessage ($messageId) { diff --git a/inc/gen_sql_patches.php b/inc/gen_sql_patches.php index 0c9afaab5c..1a7c1fc795 100644 --- a/inc/gen_sql_patches.php +++ b/inc/gen_sql_patches.php @@ -50,7 +50,7 @@ if (getConfig('pass_scramble') == "") { array($scrambleString), __FILE__, __LINE__); // Also remember it in config - $_CONFIG['pass_scramble'] = $scrambleString; + setConfigEntry('pass_scramble', $scrambleString); unset($scrambleString); } // END - if @@ -65,7 +65,7 @@ if (getConfig('master_salt') == "") { array($masterSalt), __FILE__, __LINE__); // Also remember it in config - $_CONFIG['master_salt'] = $masterSalt; + setConfigEntry('master_salt', $masterSalt); unset($masterSalt); } // END - if @@ -109,8 +109,12 @@ if (getConfig('file_hash') == "") { } // END - if // Also update configuration - $_CONFIG['secret_key'] = $secretKey; unset($secretKey); - $_CONFIG['file_hash'] = $file_hash; unset($file_hash); + setConfigEntry('secret_key', $secretKey); + setConfigEntry('file_hash' , $file_hash); + + // Remove variables + unset($secretKey); + unset($file_hash); } // END - if } // END - if diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index 68ac09ada8..5ceee13249 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -195,11 +195,8 @@ function BONUS_POINTS_HANDLER ($MODE) { // Switch to jackpot-mode when no UID is supplied but userid-mode is selected if ((getConfig('bonus_mode') == "UID") && (getConfig('bonus_uid') == "0")) { - // Update database - UPDATE_CONFIG(array('bonus_mode'), array("JACKPOT")); - - // Update configuration - $_CONFIG['bonus_mode'] = "JACKPOT"; + // Update database & config + UPDATE_CONFIG('bonus_mode', "JACKPOT"); } // END - if if ($MODE == "login_bonus") { diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index 25146a04db..c09d6c5d6d 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -517,7 +517,7 @@ function RALLYE_LOAD_USERS_ARRAY ($rallye) { global $_CONFIG; // Fix zero points to 0.00000 - if (getConfig('ref_payout') == "0") $_CONFIG['ref_payout'] = "0.00000"; + if (getConfig('ref_payout') == "0") setConfigEntry('ref_payout', "0.00000"); // Init multi array $users = array( diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index d981c7bf56..2dffd31ac9 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -1048,10 +1048,10 @@ function SURFBAR_UPDATE_INSERT_STATS_RECORD () { } // END - if // Update total/daily/weekly/monthly counter - $_CONFIG['surfbar_total_counter']++; - $_CONFIG['surfbar_daily_counter']++; - $_CONFIG['surfbar_weekly_counter']++; - $_CONFIG['surfbar_monthly_counter']++; + incrementConfigEntry('surfbar_total_counter'); + incrementConfigEntry('surfbar_daily_counter'); + incrementConfigEntry('surfbar_weekly_counter'); + incrementConfigEntry('surfbar_monthly_counter'); // Update config as well UPDATE_CONFIG(array("surfbar_total_counter", "surfbar_daily_counter", "surfbar_weekly_counter", "surfbar_monthly_counter"), array(1,1,1,1), "+"); diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index 0fbc50f3fa..7809ce6461 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -274,7 +274,7 @@ function WERNIS_EXECUTE_PAYOUT ($wdsId, $amount) { $requestData = array( 'sub_request' => "send", 't_uid' => getConfig('wernis_refid'), - 't_md5' => $_CONFIG['wernis_pass_md5'], + 't_md5' => getConfig('wernis_pass_md5'), 'r_uid' => bigintval($wdsId), 'amount' => bigintval($amount), 'purpose' => urlencode(base64_encode($purpose)) diff --git a/inc/libs/yoomedia_functions.php b/inc/libs/yoomedia_functions.php index 08334e4ef3..4b234a2463 100644 --- a/inc/libs/yoomedia_functions.php +++ b/inc/libs/yoomedia_functions.php @@ -51,11 +51,11 @@ function YOOMEDIA_TEST_CONFIG ($data) { $_CONFIG = merge_array($_CONFIG, $data); // Temporary allow maximum - $_CONFIG['yoomedia_tm_max_reload'] = 1000; - $_CONFIG['yoomedia_tm_min_wait'] = 0; - $_CONFIG['yoomedia_tm_clicks_remain'] = 10; - $_CONFIG['yoomedia_tm_min_pay'] = 0; - $_CONFIG['yoomedia_erotic_allowed'] = 1; + setConfigEntry('yoomedia_tm_max_reload' , 1000); + setConfigEntry('yoomedia_tm_min_wait' , 0); + setConfigEntry('yoomedia_tm_clicks_remain', 10); + setConfigEntry('yoomedia_tm_min_pay' , 0); + setConfigEntry('yoomedia_erotic_allowed' , 1); // Query the API with a test request without couting it // If zero reply comes back the data is invalid! diff --git a/inc/modules/admin.php b/inc/modules/admin.php index f61c4edc50..30d4372fbc 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -344,7 +344,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) { define('__ACL_ALLOW', RUN_FILTER('check_admin_acl')); // When type of admin menu is not set fallback to old menu system - if (getConfig('admin_menu') == null) $_CONFIG['admin_menu'] = "OLD"; + if (getConfig('admin_menu') == null) setConfigEntry('admin_menu', "OLD"); // Check for version and switch between old menu system and new "intelligent menu system" if ((ADMIN_CHECK_MENU_MODE() == "NEW") && (FILE_READABLE(PATH."inc/modules/admin/lasys-inc.php"))) { diff --git a/inc/modules/admin/what-config_beg.php b/inc/modules/admin/what-config_beg.php index c17cde08f6..6bc51b7e8d 100644 --- a/inc/modules/admin/what-config_beg.php +++ b/inc/modules/admin/what-config_beg.php @@ -50,9 +50,9 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); // Remember new settings - $_CONFIG['beg_rallye'] = $_POST['beg_rallye']; - $_CONFIG['beg_ral_en_notify'] = $_POST['beg_ral_en_notify']; - $_CONFIG['beg_ral_di_notify'] = $_POST['beg_ral_di_notify']; + setConfigEntry('beg_rallye' , $_POST['beg_rallye']); + setConfigEntry('beg_ral_en_notify', $_POST['beg_ral_en_notify']); + setConfigEntry('beg_ral_di_notify', $_POST['beg_ral_di_notify']); } else { // Prepare constants for the template define('__BEG_POINTS' , TRANSLATE_COMMA(getConfig('beg_points') , false)); diff --git a/inc/modules/admin/what-config_bonus.php b/inc/modules/admin/what-config_bonus.php index eacf938ace..b50b55ee0a 100644 --- a/inc/modules/admin/what-config_bonus.php +++ b/inc/modules/admin/what-config_bonus.php @@ -64,9 +64,9 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); // Remember new settings - $_CONFIG['bonus_active'] = $_POST['bonus_active']; - $_CONFIG['bonus_en_notify'] = $_POST['bonus_en_notify']; - $_CONFIG['bonus_di_notify'] = $_POST['bonus_di_notify']; + setConfigEntry('bonus_active' , $_POST['bonus_active']); + setConfigEntry('bonus_en_notify', $_POST['bonus_en_notify']); + setConfigEntry('bonus_di_notify', $_POST['bonus_di_notify']); } else { // Prepare contants for the template define('__LOGIN_VALUE' , TRANSLATE_COMMA(getConfig('login_bonus') , false)); diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php index 5dd9832419..9e5e57b192 100644 --- a/inc/modules/admin/what-list_user.php +++ b/inc/modules/admin/what-list_user.php @@ -237,7 +237,7 @@ LIMIT 1", // Calculate page count (0.5 fixes a bug with page count) if (getConfig('user_limit') == 0) { - $_CONFIG['user_limit'] = 100; + setConfigEntry('user_limit', 100); LOAD_TEMPLATE("admin_settings_saved", false, EXTENSION_WARNING_USER_LIMIT); } // END - if diff --git a/inc/modules/admin/what-theme_edit.php b/inc/modules/admin/what-theme_edit.php index 47d341b66f..6270d149aa 100644 --- a/inc/modules/admin/what-theme_edit.php +++ b/inc/modules/admin/what-theme_edit.php @@ -87,7 +87,7 @@ if ($SEL > 0) { // Set it in config and current theme as well global $currTheme; $currTheme = $POST['default_theme']; - $_CONFIG['default_theme'] = $POST['default_theme']; + setConfigEntry('default_theme', $POST['default_theme']); // Save theme ADMIN_SAVE_SETTINGS($POST); diff --git a/inc/modules/guest/action-online.php b/inc/modules/guest/action-online.php index 3cc337bc61..a9be0cc9d6 100644 --- a/inc/modules/guest/action-online.php +++ b/inc/modules/guest/action-online.php @@ -52,8 +52,6 @@ $total = SQL_NUMROWS($result_guests) + SQL_NUMROWS($result_members) + SQL_N if (getConfig('mad_count') < $total) { // Update counter UPDATE_CONFIG(array("mad_timestamp", "mad_count"), array(time(), $total)); - $_CONFIG['mad_count'] = $total; - $_CONFIG['last_mad'] = time(); } // END - if // Put all values in constants for the template diff --git a/inc/modules/guest/what-stats.php b/inc/modules/guest/what-stats.php index 495e4e0ff7..1348afd9ee 100644 --- a/inc/modules/guest/what-stats.php +++ b/inc/modules/guest/what-stats.php @@ -43,9 +43,23 @@ ADD_DESCR("guest", __FILE__); // Derterminate which stats we want and set mode and title for the link below stats block if (!isset($_GET['mode'])) $_GET['mode'] = strtolower(getConfig('guest_stats')); switch ($_GET['mode']) { - case "members" : $_CONFIG['guest_stats'] = "MEMBERS"; $lmode = "modules"; $ltitle = GUEST_STATS_MODULES; break; - case "modules" : $_CONFIG['guest_stats'] = "MODULES"; $lmode = "members"; $ltitle = GUEST_STATS_MEMBERS; break; - case "inactive": $_CONFIG['guest_stats'] = "INACTIVE"; $lmode = "inactive"; $ltitle = GUEST_STATS_INACTIVE; break; + case "members" : + setConfigEntry('guest_stats', "MEMBERS"); + $lmode = "modules"; + $ltitle = getMessage('GUEST_STATS_MODULES'); + break; + + case "modules" : + setConfigEntry('guest_stats', "MODULES"); + $lmode = "members"; + $ltitle = getMessage('GUEST_STATS_MEMBERS'); + break; + + case "inactive": + setConfigEntry('guest_stats', "INACTIVE"); + $lmode = "inactive"; + $ltitle = getMessage('GUEST_STATS_INACTIVE'); + break; } switch (getConfig('guest_stats')) diff --git a/inc/modules/member/what-points.php b/inc/modules/member/what-points.php index 8480ee81b9..da7b330b7f 100644 --- a/inc/modules/member/what-points.php +++ b/inc/modules/member/what-points.php @@ -137,7 +137,7 @@ define('__TREF_VALUE' , $TREF); define('__TLOCK_VALUE', TRANSLATE_COMMA($TLOCK)); // Fixes a bug when there is no bonus extension installed -if (EXT_VERSION_IS_OLDER("bonus", "0.4.4")) $_CONFIG['bonus_active'] = "X"; +if (EXT_VERSION_IS_OLDER("bonus", "0.4.4")) setConfigEntry('bonus_active', "X"); // Display login bonus and turbo-click bonus if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && (getConfig('bonus_active') == "Y")) { diff --git a/inc/monthly/monthly_surfbar.php b/inc/monthly/monthly_surfbar.php index 6584443439..1a099824b6 100644 --- a/inc/monthly/monthly_surfbar.php +++ b/inc/monthly/monthly_surfbar.php @@ -45,7 +45,6 @@ if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; // Reset surfbar counter UPDATE_CONFIG("surfbar_monthly_counter", "0"); -$_CONFIG['surfbar_monthly_counter'] = 0; // ?> diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 1539e82f8a..6413d76687 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -1707,6 +1707,7 @@ function UPDATE_CONFIG ($entries, $values, $updateMode="") { // Update mode set? if (!empty($updateMode)) { // Update entry + // @TODO Find a way for updating $_CONFIG here $all .= sprintf("%s=%s%s%s,", $entry, $entry, $updateMode, (float)$values[$idx]); } else { // Check if string or number @@ -1721,14 +1722,21 @@ function UPDATE_CONFIG ($entries, $values, $updateMode="") { $all .= sprintf("%s='%s',", $entry, SQL_ESCAPE($values[$idx])); } } + + // Set it in $_CONFIG as well + setConfigEntry($entry, $values[$idx]); } // END - foreach // Remove last comma $entries = substr($all, 0, -1); } elseif (!empty($updateMode)) { // Update mode set + // @TODO Find a way for updating $_CONFIG here $entries .= sprintf("=%s%s%s", $entries, $updateMode, (float)$values); } else { + // Set it in $_CONFIG first + setConfigEntry($entries, $values); + // Regular entry to update $entries .= sprintf("='%s'", SQL_ESCAPE($values)); } diff --git a/inc/patch-system.php b/inc/patch-system.php index e9be455191..939f15ee62 100644 --- a/inc/patch-system.php +++ b/inc/patch-system.php @@ -41,8 +41,8 @@ if (!defined('__SECURITY')) { if ((CURR_SVN_REVISION > getConfig('patch_level')) || (getConfig('patch_level') == "CURR_SVN_REVISION") || (getConfig('patch_ctime') == "UNIX_TIMES")) { // Update database and CONFIG array UPDATE_CONFIG(array("patch_level", "patch_ctime"), array(CURR_SVN_REVISION, "UNIX_TIMESTAMP()")); - $_CONFIG['patch_level'] = CURR_SVN_REVISION; - $_CONFIG['patch_ctime'] = time(); + setConfigEntry('patch_level', CURR_SVN_REVISION); + setConfigEntry('patch_ctime', time()); } // END - if // diff --git a/inc/reset/reset_surfbar.php b/inc/reset/reset_surfbar.php index 98d5c5600a..dcd49ba3a1 100644 --- a/inc/reset/reset_surfbar.php +++ b/inc/reset/reset_surfbar.php @@ -45,8 +45,8 @@ if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; // Reset surfbar counter UPDATE_CONFIG(array("surfbar_daily_counter", "surfbar_yester_counter"), array(0, getConfig('surfbar_daily_counter'))); -$_CONFIG['surfbar_yester_counter'] = getConfig('surfbar_daily_counter'); -$_CONFIG['surfbar_daily_counter'] = 0; +setConfigEntry('surfbar_yester_counter', getConfig('surfbar_daily_counter')); +setConfigEntry('surfbar_daily_counter' , 0); // ?> diff --git a/inc/stylesheet.php b/inc/stylesheet.php index 4840655c26..5c56b56320 100644 --- a/inc/stylesheet.php +++ b/inc/stylesheet.php @@ -46,7 +46,7 @@ $STYLES = array( if ((basename($_SERVER['PHP_SELF']) == "install.php") || (!isBooleanConstantAndTrue('mxchange_installed')) || (isset($_GET['installing']))) $STYLES[] = "install.css"; // When no CSS output-mode is set, set it to file-output -if (getConfig('css_php') == "") $_CONFIG['css_php'] = "FILE"; +if (getConfig('css_php') == null) setConfigEntry('css_php', "FILE"); // Output CSS files or content or link to css.php ? if (($CSS == "1") || (getConfig('css_php') == "DIRECT")) { diff --git a/inc/weekly/weekly_surfbar.php b/inc/weekly/weekly_surfbar.php index 7ff1ff3659..098df63e95 100644 --- a/inc/weekly/weekly_surfbar.php +++ b/inc/weekly/weekly_surfbar.php @@ -45,7 +45,6 @@ if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; // Reset the surfbar counter UPDATE_CONFIG("surfbar_weekly_counter", "0"); -$_CONFIG['surfbar_weekly_counter'] = 0; // ?> diff --git a/index.php b/index.php index 9142d90b42..aed7b1e9c5 100644 --- a/index.php +++ b/index.php @@ -51,8 +51,8 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { LOAD_INC("inc/header.php"); // Fix missing array elements here - if (getConfig('index_delay') == null) $_CONFIG['index_delay'] = 0; - if (getConfig('index_cookie') == null) $_CONFIG['index_cookie'] = 0; + if (getConfig('index_delay') == null) setConfigEntry('index_delay' , 0); + if (getConfig('index_cookie') == null) setConfigEntry('index_cookie', 0); // Check for cookies if ((isSessionVariableSet('visited')) || (getConfig('index_delay') == 0) || (getConfig('index_cookie') == 0)) { -- 2.39.2