From f9a9c09e1ae257449bfd98f8854e321efba1dc3c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 17 Dec 2008 21:15:53 +0000 Subject: [PATCH] Mahor rewrite: - Reads from array $_CONFIG are now fully rewritten to getConfig() - Some admin scripts are deprecated (replaced by others but not removed) - Some settings where not used in surfbar and other extensions - Missing settings added to surfbar - Several coding conventions applied - Misc fixes --- beg.php | 18 +-- birthday_confirm.php | 4 +- doubler.php | 34 ++-- inc/autopurge/purge-general.php | 8 +- inc/autopurge/purge-inact.php | 24 +-- inc/autopurge/purge-mails.php | 14 +- inc/autopurge/purge-tsks.php | 8 +- inc/autopurge/purge-unconfirmed.php | 10 +- inc/check-reset.php | 4 +- inc/databases.php | 6 +- inc/db/lib-mysql3.php | 12 +- inc/doubler_send.php | 18 +-- inc/extensions.php | 16 +- inc/extensions/ext-autopurge.php | 2 +- inc/extensions/ext-beg.php | 6 +- inc/extensions/ext-birthday.php | 2 +- inc/extensions/ext-bonus.php | 22 ++- inc/extensions/ext-booking.php | 2 +- inc/extensions/ext-cache.php | 2 +- inc/extensions/ext-debug.php | 2 +- inc/extensions/ext-doubler.php | 4 +- inc/extensions/ext-holiday.php | 2 +- inc/extensions/ext-primera.php | 1 + inc/extensions/ext-sponsor.php | 2 +- inc/extensions/ext-sql_patches.php | 22 +-- inc/extensions/ext-surfbar.php | 7 +- inc/extensions/ext-transfer.php | 8 +- inc/extensions/ext-user.php | 2 +- inc/footer.php | 2 +- inc/functions.php | 150 ++++++++++-------- inc/gen_sql_patches.php | 6 +- inc/header.php | 10 +- inc/install-inc.php | 2 +- inc/language/de.php | 3 +- inc/language/primera_de.php | 1 + inc/language/surfbar_de.php | 3 +- inc/libs/admins_functions.php | 2 +- inc/libs/beg_functions.php | 10 +- inc/libs/bonus_functions.php | 36 ++--- inc/libs/doubler_functions.php | 58 +++---- inc/libs/primera_functions.php | 2 +- inc/libs/rallye_functions.php | 12 +- inc/libs/register_functions.php | 2 +- inc/libs/removeip_functions.php | 30 ++-- inc/libs/rewrite_functions.php | 40 ++--- inc/libs/sponsor_functions.php | 2 +- inc/libs/surfbar_functions.php | 70 ++++---- inc/libs/task_functions.php | 30 ++-- inc/libs/theme_functions.php | 14 +- inc/libs/user_functions.php | 6 +- inc/libs/wernis_functions.php | 59 +++---- inc/libs/yoomedia_functions.php | 40 ++--- inc/load_extensions.php | 4 +- inc/loader/load_cache-admin.php | 4 +- inc/loader/load_cache-config.php | 2 +- inc/loader/load_cache-modreg.php | 2 +- inc/loader/load_cache-refdepths.php | 2 +- inc/loader/load_cache-refsystem.php | 2 +- inc/loader/load_cache-them.php | 2 +- inc/mails/beg_mails.php | 26 +-- inc/mails/birthday_mails.php | 12 +- inc/mails/bonus_mails.php | 16 +- inc/modules/admin.php | 2 +- inc/modules/admin/admin-inc.php | 15 +- inc/modules/admin/overview-inc.php | 4 +- inc/modules/admin/what-add_rallye.php | 6 +- inc/modules/admin/what-add_sponsor.php | 2 +- inc/modules/admin/what-autopurge.php | 79 +-------- inc/modules/admin/what-cache_stats.php | 8 +- inc/modules/admin/what-config_active.php | 2 +- inc/modules/admin/what-config_admin.php | 2 +- inc/modules/admin/what-config_autopurge.php | 30 ++-- inc/modules/admin/what-config_beg.php | 58 +++---- inc/modules/admin/what-config_birthday.php | 10 +- inc/modules/admin/what-config_bonus.php | 94 +++++------ inc/modules/admin/what-config_cache.php | 58 +++---- inc/modules/admin/what-config_doubler.php | 44 ++--- inc/modules/admin/what-config_extensions.php | 6 +- inc/modules/admin/what-config_holiday.php | 6 +- inc/modules/admin/what-config_home.php | 15 +- inc/modules/admin/what-config_mediadata.php | 6 +- inc/modules/admin/what-config_newsletter.php | 2 +- inc/modules/admin/what-config_order.php | 20 +-- inc/modules/admin/what-config_other.php | 54 +++---- inc/modules/admin/what-config_points.php | 18 +-- inc/modules/admin/what-config_primera.php | 11 +- inc/modules/admin/what-config_proxy.php | 8 +- inc/modules/admin/what-config_refback.php | 6 +- inc/modules/admin/what-config_refid.php | 8 +- inc/modules/admin/what-config_reg.php | 72 +-------- inc/modules/admin/what-config_register2.php | 12 +- inc/modules/admin/what-config_removeip.php | 50 +++--- inc/modules/admin/what-config_rewrite.php | 2 +- inc/modules/admin/what-config_secure.php | 16 +- inc/modules/admin/what-config_session.php | 2 +- inc/modules/admin/what-config_sponsor.php | 4 +- inc/modules/admin/what-config_stats.php | 10 +- inc/modules/admin/what-config_surfbar.php | 49 +++--- inc/modules/admin/what-config_title.php | 12 +- inc/modules/admin/what-config_top10.php | 2 +- inc/modules/admin/what-config_transfer.php | 16 +- inc/modules/admin/what-config_user.php | 4 +- inc/modules/admin/what-config_wernis.php | 30 ++-- inc/modules/admin/what-config_yoomedia.php | 16 +- inc/modules/admin/what-del_email.php | 6 +- inc/modules/admin/what-email_archiv.php | 8 +- inc/modules/admin/what-email_details.php | 10 +- inc/modules/admin/what-extensions.php | 6 +- inc/modules/admin/what-list_autopurge.php | 12 +- inc/modules/admin/what-list_beg.php | 47 +++--- inc/modules/admin/what-list_bonus.php | 33 ++-- inc/modules/admin/what-list_notifications.php | 6 +- inc/modules/admin/what-list_payouts.php | 87 +++------- inc/modules/admin/what-list_rallyes.php | 12 +- inc/modules/admin/what-list_user.php | 10 +- inc/modules/admin/what-list_yoomedia_tm.php | 2 +- inc/modules/admin/what-maintenance.php | 12 +- inc/modules/admin/what-unlock_emails.php | 20 +-- inc/modules/admin/what-unlock_sponsor.php | 4 +- inc/modules/admin/what-updates.php | 4 +- inc/modules/admin/what-user_online.php | 2 +- inc/modules/admin/what-usr_online.php | 2 +- inc/modules/chk_login.php | 6 +- inc/modules/frametester.php | 2 +- inc/modules/guest/action-online.php | 6 +- inc/modules/guest/what-active.php | 2 +- inc/modules/guest/what-beg.php | 14 +- inc/modules/guest/what-confirm.php | 14 +- inc/modules/guest/what-doubler.php | 16 +- inc/modules/guest/what-login.php | 6 +- inc/modules/guest/what-mediadata.php | 10 +- inc/modules/guest/what-rallyes.php | 2 +- inc/modules/guest/what-register.php | 34 ++-- inc/modules/guest/what-sponsor_login.php | 2 +- inc/modules/guest/what-sponsor_reg.php | 8 +- inc/modules/guest/what-stats.php | 12 +- inc/modules/guest/what-top10.php | 20 +-- inc/modules/guest/what-welcome.php | 4 +- inc/modules/guest/what-wernis_portal.php | 10 +- inc/modules/index.php | 6 +- inc/modules/login.php | 4 +- inc/modules/member/what-beg.php | 12 +- inc/modules/member/what-beg2.php | 14 +- inc/modules/member/what-bonus.php | 14 +- inc/modules/member/what-categories.php | 8 +- inc/modules/member/what-doubler.php | 16 +- inc/modules/member/what-holiday.php | 28 ++-- inc/modules/member/what-mydata.php | 16 +- inc/modules/member/what-newsletter.php | 8 +- inc/modules/member/what-order.php | 50 +++--- inc/modules/member/what-payout.php | 17 +- inc/modules/member/what-points.php | 6 +- inc/modules/member/what-primera.php | 32 ++-- inc/modules/member/what-rallyes.php | 2 +- inc/modules/member/what-refback.php | 10 +- inc/modules/member/what-surfbar_book.php | 4 +- inc/modules/member/what-surfbar_start.php | 16 +- inc/modules/member/what-transfer.php | 32 ++-- inc/modules/member/what-unconfirmed.php | 6 +- inc/modules/member/what-wernis.php | 30 ++-- inc/modules/order.php | 6 +- inc/modules/sponsor/account.php | 4 +- inc/monthly/monthly_beg.php | 17 +- inc/monthly/monthly_bonus.php | 20 +-- inc/monthly/monthly_newsletter.php | 2 +- inc/mysql-connect.php | 24 +-- inc/mysql-manager.php | 54 +++---- inc/patch-system.php | 2 +- inc/pool/pool-bonus.php | 6 +- inc/pool/pool-user.php | 6 +- inc/profile-updte.php | 4 +- inc/reset/reset_beg.php | 2 +- inc/reset/reset_holiday.php | 2 +- inc/reset/reset_surfbar.php | 4 +- inc/reset/reset_yoomedia.php | 2 +- inc/session.php | 4 +- inc/stats_bonus.php | 15 +- inc/stylesheet.php | 6 +- index.php | 12 +- mailid.php | 6 +- mailid_top.php | 10 +- modules.php | 2 +- ref.php | 2 +- show_bonus.php | 2 +- surfbar.php | 20 +-- .../de/html/admin/admin_config_primera.tpl | 10 ++ .../de/html/admin/admin_config_surfbar.tpl | 11 ++ .../html/member/member_primera_mode_pay.tpl | 2 +- 188 files changed, 1323 insertions(+), 1511 deletions(-) diff --git a/beg.php b/beg.php index 440e7328da..cd4b2f6363 100644 --- a/beg.php +++ b/beg.php @@ -102,7 +102,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // Multiply configured values with 100000 and divide with 100000 so we can also handle small values // If we need more number behind the decimal dot then we just need to increase all these three // numbers matching to the numbers behind the decimal dot. Simple! ;-) - $points = mt_rand(($_CONFIG['beg_points'] * 100000), ($_CONFIG['beg_points_max'] * 100000)) / 100000; + $points = mt_rand((getConfig('beg_points') * 100000), (getConfig('beg_points_max') * 100000)) / 100000; // Set nickname / userid for the template(s define('__BEG_UID' , SQL_ESCAPE($_GET['uid'])); @@ -119,17 +119,17 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { SQL_FREERESULT($result); // User id valid and not webmaster's id? - if (($uid > 0) && ($_CONFIG['beg_uid'] != $uid)) { + if (($uid > 0) && (getConfig('beg_uid') != $uid)) { // Update counter $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET beg_clicks=beg_clicks+1 WHERE userid=%s AND status='CONFIRMED' LIMIT 1", array($uid), __FILE__, __LINE__); // Check for last entry for userid w/o IP number - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_beg_ips WHERE (timeout > (UNIX_TIMESTAMP() - ".$_CONFIG['beg_timeout'].") OR (timeout > (UNIX_TIMESTAMP() - ".$_CONFIG['beg_uid_timeout'].") AND userid=%s)) AND (remote_ip='%s' OR sid='%s') LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_beg_ips WHERE (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_timeout').") OR (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_uid_timeout').") AND userid=%s)) AND (remote_ip='%s' OR sid='%s') LIMIT 1", array($uid, GET_REMOTE_ADDR(), session_id()), __FILE__, __LINE__); // Entry not found, points set and not logged in? - if (((SQL_NUMROWS($result) == 0) || (IS_ADMIN())) && ($points > 0) && (!IS_MEMBER()) && ($_CONFIG['beg_pay_mode'] == "NONE")) { + if (((SQL_NUMROWS($result) == 0) || (IS_ADMIN())) && ($points > 0) && (!IS_MEMBER()) && (getConfig('beg_pay_mode') == "NONE")) { // Admin is testing? if (!IS_ADMIN()) { @@ -166,7 +166,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { } elseif (IS_MEMBER()) { // Logged in user found! define('__BEG_MSG', LOAD_TEMPLATE("beg_login", true)); - } elseif ($_CONFIG['beg_pay_mode'] != "NONE") { // Other pay-mode active! + } elseif (getConfig('beg_pay_mode') != "NONE") { // Other pay-mode active! // Prepare content for template $content = array( 'clicks' => __BEG_CLICKS, @@ -175,7 +175,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { ); // Load message template depending on pay-mode - define('__BEG_MSG', LOAD_TEMPLATE("beg_pay_mode_".strtolower($_CONFIG['beg_pay_mode']), true, $content)); + define('__BEG_MSG', LOAD_TEMPLATE("beg_pay_mode_".strtolower(getConfig('beg_pay_mode')), true, $content)); $pay = true; } else { // Clicked received while reload lock is active @@ -192,13 +192,13 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { LOAD_TEMPLATE("beg_link"); // Tracker code enabled? (We don't track users here! - if (($_CONFIG['beg_pay_mode'] != "NONE") && ($pay)) { + if ((getConfig('beg_pay_mode') != "NONE") && ($pay)) { // Prepare content for template $content = array( ); // Include config-depending template - LOAD_TEMPLATE("beg_pay_code_".strtolower($_CONFIG['beg_pay_mode']), false, $content); + LOAD_TEMPLATE("beg_pay_code_".strtolower(getConfig('beg_pay_mode')), false, $content); } elseif ((!$pay) && (!defined('__BEG_MSG'))) { // Cannot pay! :-( define('__BEG_MSG', LOAD_TEMPLATE("beg_failed", true)); @@ -226,7 +226,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // Free memory SQL_FREERESULT($result); - } elseif ($uid == $_CONFIG['beg_uid']) { + } elseif ($uid == getConfig('beg_uid')) { // Webmaster's ID cannot beg for points! $msg = CODE_BEG_SAME_AS_OWN; } diff --git a/birthday_confirm.php b/birthday_confirm.php index 3af2baa62d..a29859a8d6 100644 --- a/birthday_confirm.php +++ b/birthday_confirm.php @@ -76,11 +76,11 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1", if ($data['status'] == "CONFIRMED") { // Set mode depending on how many mails the member has to confirm $locked = false; - if (($data['ref_payout'] > 0) && ($_CONFIG['allow_direct_pay'] == "N")) $locked = true; + if (($data['ref_payout'] > 0) && (getConfig('allow_direct_pay') == "N")) $locked = true; // Add points to account unset($DEPTH); - ADD_POINTS_REFSYSTEM("birthday_confirm", $uid, $data['points'], false, "0", $locked, strtolower($_CONFIG['birthday_mode'])); + ADD_POINTS_REFSYSTEM("birthday_confirm", $uid, $data['points'], false, "0", $locked, strtolower(getConfig('birthday_mode'))); // Remove entry from table $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_birthday WHERE userid=%s AND chk_value='%s' LIMIT 1", diff --git a/doubler.php b/doubler.php index 5d39bf1771..34c7c7380c 100644 --- a/doubler.php +++ b/doubler.php @@ -81,7 +81,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // If no account was found set default refid and status to CONFIRMED if (empty($GLOBALS['refid'])) { - $GLOBALS['refid'] = $_CONFIG['def_refid']; + $GLOBALS['refid'] = getConfig('def_refid'); $status = "CONFIRMED"; } // END - if @@ -115,7 +115,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { $_POST['points'] = bigintval(round(REVERT_COMMA($_POST['points']))); // Probe for enough points - $probe_points = (($_POST['points'] >= $_CONFIG['doubler_min']) && ($_POST['points'] <= $_CONFIG['doubler_max'])); + $probe_points = (($_POST['points'] >= getConfig('doubler_min')) && ($_POST['points'] <= getConfig('doubler_max'))); // Check all together if ((!empty($uid)) && ($password == generateHash($_POST['pass'], substr($password, 0, -40))) && ($status == "CONFIRMED") && ($probe_points)) { @@ -126,7 +126,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { $points = GET_TOTAL_DATA($uid, "user_points", "points") - GET_TOTAL_DATA($uid, "user_data", "used_points"); // So let's continue with probing his points amount - if (($points - $_CONFIG['doubler_left'] - $_POST['points'] * $_CONFIG['doubler_charge']) >= 0) + if (($points - getConfig('doubler_left') - $_POST['points'] * getConfig('doubler_charge')) >= 0) { // Enough points are left so let's continue with the doubling process // Create doubling "account" width *DOUBLED* points @@ -137,15 +137,15 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { SUB_POINTS("doubler", $uid, $_POST['points']); // Add points to "total payed" including charge - $points = $_POST['points'] - $_POST['points'] * $_CONFIG['doubler_charge']; + $points = $_POST['points'] - $_POST['points'] * getConfig('doubler_charge'); UPDATE_CONFIG("doubler_points", $points, "+"); - $_CONFIG['doubler_points'] += $points; + getConfig('doubler_points') += $points; // Add second line for the referal but only when uid != refid if (($GLOBALS['refid'] > 0) && ($GLOBALS['refid'] != $uid)) { // Okay add a refid line and apply refid percents $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_doubler (userid,refid,points,remote_ip,timemark,completed,is_ref) VALUES ('%s',0,'%s','".GET_REMOTE_ADDR()."',UNIX_TIMESTAMP(),'N','Y')", - array(bigintval($GLOBALS['refid']), bigintval($_POST['points'] * 2 * $_CONFIG['doubler_ref'])), __FILE__, __LINE__); + array(bigintval($GLOBALS['refid']), bigintval($_POST['points'] * 2 * getConfig('doubler_ref'))), __FILE__, __LINE__); // And that's why we dont't want to you more than one referal level of doubler-points. ^^^ } // END - if @@ -169,10 +169,10 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { } elseif ($status == "LOCKED") { // Account is locked by admin / holiday! define('__ERROR_MSG', DOUBLER_FORM_STATUS_LOCKED); - } elseif ($_POST['points'] < $_CONFIG['doubler_min']) { + } elseif ($_POST['points'] < getConfig('doubler_min')) { // Not enougth points entered define('__ERROR_MSG', DOUBLER_FORM_POINTS_MIN); - } elseif ($_POST['points'] > $_CONFIG['doubler_max']) { + } elseif ($_POST['points'] > getConfig('doubler_max')) { // Too much points entered define('__ERROR_MSG', DOUBLER_FORM_POINTS_MAX); } elseif ($probe_nickname) { @@ -199,7 +199,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { if (!defined('__ERROR_MSG')) define('__ERROR_MSG' , ""); // Shall I check for points immediately? - if ($_CONFIG['doubler_send_mode'] == "DIRECT") require(PATH."inc/doubler_send.php"); + if (getConfig('doubler_send_mode') == "DIRECT") require(PATH."inc/doubler_send.php"); // Output header include(PATH."inc/header.php"); @@ -220,11 +220,11 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { } // Percent values etc. - define('__CHARGE_VALUE', TRANSLATE_COMMA($_CONFIG['doubler_charge'] * 100)); - define('__REF_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_ref'] * 100)); - define('__TOTAL_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_points'])); - define('__MIN_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_min'])); - define('__MAX_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_max'])); + define('__CHARGE_VALUE', TRANSLATE_COMMA(getConfig('doubler_charge') * 100)); + define('__REF_VALUE' , TRANSLATE_COMMA(getConfig('doubler_ref') * 100)); + define('__TOTAL_VALUE' , TRANSLATE_COMMA(getConfig('doubler_points'))); + define('__MIN_VALUE' , TRANSLATE_COMMA(getConfig('doubler_min'))); + define('__MAX_VALUE' , TRANSLATE_COMMA(getConfig('doubler_max'))); // Text "Enter login" if (EXT_IS_ACTIVE("nickname")) { @@ -236,7 +236,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { } // Which mail-send-mode did the admin setup? - switch ($_CONFIG['doubler_send_mode']) + switch (getConfig('doubler_send_mode')) { case "DIRECT": define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_DIRECT); @@ -251,10 +251,10 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { define('__DOUBLER_PAYOUT_HISTORY', DOUBLER_GENERATE_TABLE("0", "Y", "N", "DESC")); // Generate timemark - define('__TIMEOUT_MARK', CREATE_FANCY_TIME($_CONFIG['doubler_timeout'])); + define('__TIMEOUT_MARK', CREATE_FANCY_TIME(getConfig('doubler_timeout'))); // Usage counter - define('__DOUBLER_COUNTER', $_CONFIG['doubler_counter']); + define('__DOUBLER_COUNTER', getConfig('doubler_counter')); // Points left to doubler define('__LEFT_VALUE', TRANSLATE_COMMA(DOUBLER_GET_TOTAL_POINTS_LEFT())); diff --git a/inc/autopurge/purge-general.php b/inc/autopurge/purge-general.php index cdd1f262a6..6b5e36b990 100644 --- a/inc/autopurge/purge-general.php +++ b/inc/autopurge/purge-general.php @@ -39,17 +39,17 @@ if (!defined('__SECURITY')) { } // Abort if autopurge is not active or disabled by admin -if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) { +if ((!EXT_IS_ACTIVE("autopurge")) || (getConfig('auto_purge_active') == "N")) { // Abort here return false; } -if (($_CONFIG['auto_purge_active'] == "Y") && ($_CONFIG['auto_purge'] > 0)) { +if ((getConfig('auto_purge_active') == "Y") && (getConfig('auto_purge') > 0)) { // First calculate the timestamp if (function_exists('CREATE_TIME_SELECTIONS')) { - $PURGE = $_CONFIG['auto_purge']; + $PURGE = getConfig('auto_purge'); } else { - $PURGE = $_CONFIG['auto_purge'] * $_CONFIG['one_day']; + $PURGE = getConfig('auto_purge') * getConfig('one_day'); } // Init variables diff --git a/inc/autopurge/purge-inact.php b/inc/autopurge/purge-inact.php index 189ed2eb2b..33aaa9acd9 100644 --- a/inc/autopurge/purge-inact.php +++ b/inc/autopurge/purge-inact.php @@ -38,26 +38,26 @@ if (!defined('__SECURITY')) { } // END - if // Abort if autopurge is not active or disabled by admin -if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) { +if ((!EXT_IS_ACTIVE("autopurge")) || (getConfig('auto_purge_active') == "N")) { // Abort here return false; } // END - if // Shall I look for inactive accounts and autopurge inactive accounts? -if ($_CONFIG['autopurge_inactive'] == "Y") { +if (getConfig('autopurge_inactive') == "Y") { // Ok, let's have a look... - $since = bigintval($_CONFIG['ap_inactive_since']); + $since = bigintval(getConfig('ap_inactive_since')); // Init exclusion list $EXCLUDE_LIST = ""; - if ($_CONFIG['def_refid'] > 0) { - $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid']; + if (getConfig('def_refid') > 0) { + $EXCLUDE_LIST = " AND d.userid != ".getConfig('def_refid'); } // END - if // Check for more extensions - if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['beg_uid'].""; - if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['bonus_uid'].""; - if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['doubler_uid'].""; + if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_uid').""; + if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_uid').""; + if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_uid').""; // Check for new holiday extension if (GET_EXT_VERSION("holiday") >= "0.1.3") { @@ -75,8 +75,8 @@ ORDER BY d.userid", array($since, $since, $since), __FILE__, __LINE__); if (SQL_NUMROWS($result_inactive) > 0) { // Prepare variables and constants... $UIDs = ""; - define('__INACTIVE_SINCE', ($_CONFIG['ap_inactive_since'] / 60 / 60)); - define('__INACTIVE_TIME' , ($_CONFIG['ap_in_time'] / 60 / 60)); + define('__INACTIVE_SINCE', (getConfig('ap_inactive_since') / 60 / 60)); + define('__INACTIVE_TIME' , (getConfig('ap_in_time') / 60 / 60)); // Mark found accounts as inactive and send an email while(list($uid, $email, $last) = SQL_FETCHROW($result_inactive)) { @@ -107,7 +107,7 @@ ORDER BY d.userid", array($since, $since, $since), __FILE__, __LINE__); // Now let's have a look for inactive accounts we want to delete we newly use the same exclude list // here for e.g. excluding holiday users - $time = bigintval($_CONFIG['ap_in_time']); + $time = bigintval(getConfig('ap_in_time')); $result_inactive = SQL_QUERY_ESC("SELECT d.userid, d.email, d.last_online FROM `"._MYSQL_PREFIX."_user_data` AS d WHERE status='CONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s) AND last_online < (UNIX_TIMESTAMP() - %s) AND ap_notified < (UNIX_TIMESTAMP() - %s) @@ -134,7 +134,7 @@ ORDER BY userid", $UIDs = str_replace(", ", "\n", substr($UIDs, 0, -2)); // Send mail notification to admin - if ($_CONFIG['ap_un_mail'] == "Y") { + if (getConfig('ap_in_notify') == "Y") { SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_DELETE_SUBJECT, "admin_autopurge_delete", $UIDs, ""); } // END - if } // END - if diff --git a/inc/autopurge/purge-mails.php b/inc/autopurge/purge-mails.php index 99a02c4873..89f4dd7d63 100644 --- a/inc/autopurge/purge-mails.php +++ b/inc/autopurge/purge-mails.php @@ -38,15 +38,15 @@ if (!defined('__SECURITY')) { } // END - if // Abort if autopurge is not active or disabled by admin -if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) { +if ((!EXT_IS_ACTIVE("autopurge")) || (getConfig('auto_purge_active') == "N")) { // Abort here return false; } // END - if // Search for mails from deleted members? -if ($_CONFIG['ap_del_mails'] == "Y") { +if (getConfig('ap_del_mails') == "Y") { // Okay, let's check for them... - $since = bigintval($_CONFIG['ap_dm_timeout']); + $since = bigintval(getConfig('ap_dm_timeout')); $result_mails = SQL_QUERY_ESC("SELECT sender\ FROM "._MYSQL_PREFIX."_pool WHERE data_type='DELETED' AND timestamp <= (UNIX_TIMESTAMP() - %s) @@ -70,7 +70,7 @@ ORDER BY sender ASC", $DELETED += SQL_AFFECTEDROWS(); // Reset query (to prevent possible errors) ... - $since = bigintval($_CONFIG['ap_dm_timeout']); + $since = bigintval(getConfig('ap_dm_timeout')); $result_mails = SQL_QUERY_ESC("SELECT sender FROM "._MYSQL_PREFIX."_pool WHERE data_type='DELETED' AND timestamp <= (UNIX_TIMESTAMP() - %s) @@ -84,7 +84,7 @@ ORDER BY sender ASC", SQL_FREERESULT($result_mails); // Now let's check for stats entries as well - $since = bigintval($_CONFIG['ap_dm_timeout']); + $since = bigintval(getConfig('ap_dm_timeout')); $result_mails = SQL_QUERY_ESC("SELECT sender FROM "._MYSQL_PREFIX."_user_stats WHERE data_type='DELETED' AND timestamp_send <= (UNIX_TIMESTAMP() - %s) @@ -103,7 +103,7 @@ ORDER BY sender ASC", $DELETED += SQL_AFFECTEDROWS(); // Reset query (to prevent possible errors) ... - $since = bigintval($_CONFIG['ap_dm_timeout']); + $since = bigintval(getConfig('ap_dm_timeout')); $result_mails = SQL_QUERY_ESC("SELECT sender FROM "._MYSQL_PREFIX."_user_stats WHERE data_type='DELETED' AND timestamp_send <= (UNIX_TIMESTAMP() - %s) @@ -117,7 +117,7 @@ ORDER BY sender ASC", SQL_FREERESULT($result_mails); // Do we have deleted mails and the admin want's to receive a notification - if (($DELETED > 0) && ($_CONFIG['ap_dm_notify'] == "Y")) { + if (($DELETED > 0) && (getConfig('ap_dm_notify') == "Y")) { // Send out email to admin SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_DEL_MAILS_SUBJECT, "admin_autopurge_del_mails", $DELETED, ""); } diff --git a/inc/autopurge/purge-tsks.php b/inc/autopurge/purge-tsks.php index a2a9038b12..96124da6be 100644 --- a/inc/autopurge/purge-tsks.php +++ b/inc/autopurge/purge-tsks.php @@ -38,15 +38,15 @@ if (!defined('__SECURITY')) { } // END - if // Abort if autopurge is not active or disabled by admin -if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) { +if ((!EXT_IS_ACTIVE("autopurge")) || (getConfig('auto_purge_active') == "N")) { // Abort here return false; } // END - if // Check version (must be > 0.0) -if ((GET_EXT_VERSION("task") > "0.0") && ($_CONFIG['ap_tasks'] == "Y")) { +if ((GET_EXT_VERSION("task") > "0.0") && (getConfig('ap_tasks') == "Y")) { // Since when shall we purge? - $since = bigintval($_CONFIG['ap_tasks_time']); + $since = bigintval(getConfig('ap_tasks_time')); // Purge deleted tasks (no notification to admin) $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY @@ -55,7 +55,7 @@ WHERE status='DELETED' AND task_created <= (UNIX_TIMESTAMP() - %s)", array($since), __FILE__, __LINE__); $DELETED = SQL_AFFECTEDROWS(); - if (($DELETED > 0) && ($_CONFIG['ap_tasks_mail'] == "Y")) { + if (($DELETED > 0) && (getConfig('ap_tasks_notify') == "Y")) { // Send out email to admin SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_TASKS_SUBJECT, "admin_autopurge_tsks", $DELETED, ""); } // END - if diff --git a/inc/autopurge/purge-unconfirmed.php b/inc/autopurge/purge-unconfirmed.php index 7e997f2a2c..2471dfcf27 100644 --- a/inc/autopurge/purge-unconfirmed.php +++ b/inc/autopurge/purge-unconfirmed.php @@ -38,15 +38,15 @@ if (!defined('__SECURITY')) { } // END - if // Abort if autopurge is not active or disabled by admin -if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) { +if ((!EXT_IS_ACTIVE("autopurge")) || (getConfig('auto_purge_active') == "N")) { // Abort here return false; } // END - if // Shall I auto-purge unconfirmed accounts? -if ($_CONFIG['autopurge_unconfirmed'] == "Y") { +if (getConfig('autopurge_unconfirmed') == "Y") { // Init variables and find unconfirmed accounts which I shall auto-purge - $time = bigintval($_CONFIG['ap_un_time']); + $time = bigintval(getConfig('ap_un_time')); $result_uncon = SQL_QUERY_ESC("SELECT userid, email, joined FROM "._MYSQL_PREFIX."_user_data WHERE status='UNCONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s) @@ -55,7 +55,7 @@ ORDER BY userid ASC", if (SQL_NUMROWS($result_uncon) > 0) { // Prepare variable... $UIDs = ""; - define('__UNCONFIRMED_TIME' , ($_CONFIG['ap_un_time'] / 60 / 60)); + define('__UNCONFIRMED_TIME' , (getConfig('ap_un_time') / 60 / 60)); // Delete inactive accounts while (list($uid, $email, $joined) = SQL_FETCHROW($result_uncon)) { @@ -73,7 +73,7 @@ ORDER BY userid ASC", $UIDs = str_replace(", ", "\n", substr($UIDs, 0, -2)); // Send mail notification to admin - if ($_CONFIG['ap_un_mail'] == "Y") { + if (getConfig('ap_un_notify') == "Y") { SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT, "admin_autopurge_unconfirmed", $UIDs, ""); } // END - if } // END - if diff --git a/inc/check-reset.php b/inc/check-reset.php index 874c10985d..bef0aef20c 100644 --- a/inc/check-reset.php +++ b/inc/check-reset.php @@ -37,8 +37,8 @@ if (!defined('__SECURITY')) { require($INC); } -// 01 2 2 2 3321 12 3 32 2 21 1 2 21 1 2 21 1 2 21 1 10 -if ((date("d", $_CONFIG['last_update']) != date("d", time())) && ((!defined('mxchange_installing')) || (!mxchange_installing)) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1)) { +// 01 2 3 32 2 3321 12 3 32 2 21 1 2 21 1 2 21 1 2 21 1 10 +if ((date("d", getConfig('last_update')) != date("d", time())) && ((!defined('mxchange_installing')) || (!mxchange_installing)) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1)) { // Do daily things in external PHP file but only when script is completely setup // Daily reset was run! define('__DAILY_RESET', true); diff --git a/inc/databases.php b/inc/databases.php index c52f120ed0..1835834722 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -89,7 +89,7 @@ $_CONFIG['one_day'] = 60*60*24; // // Timestamp for yesterday, today ... all at 00:00 am -define('START_YDAY', MAKE_TIME(0, 0, 0, time() - $_CONFIG['one_day'])); +define('START_YDAY', MAKE_TIME(0, 0, 0, time() - getConfig('one_day'))); define('START_TDAY', MAKE_TIME(0, 0, 0, time())); $COOKIES = substr(URL, strpos(substr(URL, 8), "/") + 8); @@ -114,13 +114,13 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // Current SVN revision -define('CURR_SVN_REVISION', "640"); +define('CURR_SVN_REVISION', "641"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); // Calculate "entropy" with the prime number (for code generation) -define('_ADD', (_PRIME * _PRIME / (pi() * $_CONFIG['code_length'] + 1))); +define('_ADD', (_PRIME * _PRIME / (pi() * getConfig('code_length') + 1))); // Random number for e.g. "cache-buster" used in OpenX script define('CACHE_BUSTER', mt_rand(1000000, 9999999)); diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index c2d781c655..3d7f11ca3e 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -64,7 +64,7 @@ Query string:
$_CONFIG['db_last_query'] = $sql_string; // Count this query - if (!isset($_CONFIG['sql_count'])) $_CONFIG['sql_count'] = 0; + if (getConfig('sql_count') == null) $_CONFIG['sql_count'] = 0; $_CONFIG['sql_count']++; // Debug output @@ -85,7 +85,7 @@ Query string:
} // END - if // Count DB hits - if (!isset($_CONFIG['db_hits_run'])) { + if (getConfig('db_hits_run') == null) { // Count in dummy variable $_CONFIG['db_hits_run'] = 1; } else { @@ -199,13 +199,13 @@ function SQL_CLOSE(&$link, $F, $L) { } // END - if // Do we need to update cache/db counter? - //* DEBUG: */ echo "DB=".$_CONFIG['db_hits'].",CACHE=".$_CONFIG['cache_hits']."
\n"; - if ((GET_EXT_VERSION("cache") >= "0.0.7") && (isset($_CONFIG['db_hits'])) && (isset($_CONFIG['cache_hits'])) && (is_object($cacheInstance))) { + //* 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'] += $_CONFIG['db_hits_run']; + $_CONFIG['db_hits'] += getConfig('db_hits_run'); // Update counter for db/cache - UPDATE_CONFIG(array("db_hits", "cache_hits"), array(bigintval($_CONFIG['db_hits']), bigintval($_CONFIG['cache_hits']))); + UPDATE_CONFIG(array("db_hits", "cache_hits"), array(bigintval(getConfig('db_hits')), bigintval(getConfig('cache_hits')))); } // END - if // Close database link and forget the link diff --git a/inc/doubler_send.php b/inc/doubler_send.php index 223caa3978..f5a671d9ae 100644 --- a/inc/doubler_send.php +++ b/inc/doubler_send.php @@ -54,7 +54,7 @@ set_session('DOUBLER_UID', ""); if (empty($DOUBLER_UID)) $DOUBLER_UID = 0; // Check for doubles which we can pay out -$min = bigintval($_CONFIG['doubler_min'] * 2); +$min = bigintval(getConfig('doubler_min') * 2); $result_total = SQL_QUERY_ESC("SELECT DISTINCT d.id, d.userid, d.points, d.remote_ip, d.timemark FROM "._MYSQL_PREFIX."_doubler AS d LEFT JOIN `"._MYSQL_PREFIX."_user_data` AS u @@ -69,13 +69,13 @@ LEFT JOIN `"._MYSQL_PREFIX."_user_data` AS u ON d.userid=u.userid WHERE u.status='CONFIRMED' AND d.points <= %s AND d.points >= %s AND d.completed='N' AND d.is_ref='N' ORDER BY d.timemark -LIMIT %d", array($DOUBLER_POINTS, $min, $_CONFIG['doubler_max_sent']), __FILE__, __LINE__); +LIMIT %d", array($DOUBLER_POINTS, $min, getConfig('doubler_max_sent')), __FILE__, __LINE__); // Do we have entries found? -if (((SQL_NUMROWS($result_total) > 0) && ($_CONFIG['doubler_sent_all'] == "Y")) || ((SQL_NUMROWS($result_main) == $_CONFIG['doubler_group_sent']) && ($_CONFIG['doubler_sent_all'] == "N"))) { +if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) || ((SQL_NUMROWS($result_main) == getConfig('doubler_group_sent')) && (getConfig('doubler_sent_all') == "N"))) { // Switch to matching SQL resource $result_load = $result_main; - if ((SQL_NUMROWS($result_total) > 0) && ($_CONFIG['doubler_sent_all'] == "Y")) $result_load = $result_total; + if ((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) $result_load = $result_total; // At least one account was found while(list($id, $uid, $points, $ip, $time) = SQL_FETCHROW($result_load)) { @@ -97,9 +97,9 @@ if (((SQL_NUMROWS($result_total) > 0) && ($_CONFIG['doubler_sent_all'] == "Y")) } // Exclude webmaster from doubling... - if ($uid != $_CONFIG['doubler_uid']) { + if ($uid != getConfig('doubler_uid')) { // Add points - ADD_POINTS_REFSYSTEM(sprintf("doubler_%s", strtolower($_CONFIG['doubler_send_mode'])), $uid, $points, false, "0", false, "direct"); + ADD_POINTS_REFSYSTEM(sprintf("doubler_%s", strtolower(getConfig('doubler_send_mode'))), $uid, $points, false, "0", false, "direct"); } // END - if // Set entry as "payed" @@ -108,7 +108,7 @@ if (((SQL_NUMROWS($result_total) > 0) && ($_CONFIG['doubler_sent_all'] == "Y")) $OK = false; // Check for jackpot inclusion in doubling process - if (($jackpot > 0) && ($jackpot >= $points) && ($_CONFIG['doubler_jackpot'] == "Y")) { + if (($jackpot > 0) && ($jackpot >= $points) && (getConfig('doubler_jackpot') == "Y")) { // Subtract points from jackpot SUB_JACKPOT($points); $jackpot -= $points; @@ -118,9 +118,9 @@ if (((SQL_NUMROWS($result_total) > 0) && ($_CONFIG['doubler_sent_all'] == "Y")) } // END - if // Exclude also webmaster's ID in taking points from webmaster's account - if (($user > 0) && ($user >= $points) && (!$OK) && ($_CONFIG['doubler_uid'] > 0) && ($uid != $_CONFIG['doubler_uid'])) { + if (($user > 0) && ($user >= $points) && (!$OK) && (getConfig('doubler_uid') > 0) && ($uid != getConfig('doubler_uid'))) { // Add points to used points - SUB_POINTS("doubler_payout", $_CONFIG['doubler_uid'], $points); + SUB_POINTS("doubler_payout", getConfig('doubler_uid'), $points); // Okay, done! $OK = true; diff --git a/inc/extensions.php b/inc/extensions.php index b1c14b94db..76047df984 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -154,7 +154,7 @@ function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run=false) { LOAD_EXTENSION($ext_name, "update", $ver, $dry_run); // Do we have an update? - if (((GET_EXT_VERSION("sql_patches") != "") && ($_CONFIG['verbose_sql'] == "Y")) || (!EXT_IS_ACTIVE("sql_patches"))) { + if (((GET_EXT_VERSION("sql_patches") != "") && (getConfig('verbose_sql') == "Y")) || (!EXT_IS_ACTIVE("sql_patches"))) { if (!empty($UPDATE_NOTES)) { // Update notes found $NOTES .= ("
v".$ver.":
".$UPDATE_NOTES."
"); @@ -402,7 +402,7 @@ function EXT_IS_ACTIVE ($ext_name) { $active = $cacheArray['extensions']['ext_active'][$ext_name]; // Count cache hits - if (isset($_CONFIG['cache_hits'])) $_CONFIG['cache_hits']++; + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (($ext_name == "cache") || (GET_EXT_VERSION("cache") == "")) { //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "DB! ext_name={$ext_name}"); // Load from database @@ -452,7 +452,7 @@ function GET_EXT_VERSION ($ext_name) { $ret = $cacheArray['extensions']['ext_version'][$ext_name]; // Count cache hits - if (isset($_CONFIG['cache_hits'])) $_CONFIG['cache_hits']++; else $_CONFIG['cache_hits'] = 1; + if (getConfig('cache_hits') > 0) $_CONFIG['cache_hits']++; else $_CONFIG['cache_hits'] = 1; } elseif (!is_object($cacheInstance)) { // Load from database $result = SQL_QUERY_ESC("SELECT ext_version FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1", @@ -508,7 +508,7 @@ function EXTENSION_UPDATE ($file, $ext_name, $ext_ver, $dry_run=false) { LOAD_EXTENSION($ext_name, "update", $ver, $dry_run); // Add notes - if ($_CONFIG['verbose_sql'] == "Y") { + if (getConfig('verbose_sql') == "Y") { if (!empty($UPDATE_NOTES)) { // Update notes found $NOTES .= ("
v".$ver.":
".$UPDATE_NOTES."
"); @@ -591,7 +591,7 @@ function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = ADMIN_SQLS_EXECUT $OUT = ""; // Do we have queries? - if ((is_array($SQLs)) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && ($_CONFIG['verbose_sql'] == "Y")) { + if ((is_array($SQLs)) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && (getConfig('verbose_sql') == "Y")) { $OUT = "
@@ -615,7 +615,7 @@ function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = ADMIN_SQLS_EXECUT } } - if ((!$S) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && ($_CONFIG['verbose_sql'] == "Y")) { + if ((!$S) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && (getConfig('verbose_sql') == "Y")) { // No addional SQL commands to run $OUT .= "
@@ -647,7 +647,7 @@ function GET_EXT_NAME ($ext_id) { $ret = $cacheArray['extensions']['ext_name'][$ext_id]; // Count cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database $result = SQL_QUERY_ESC("SELECT ext_name FROM "._MYSQL_PREFIX."_extensions WHERE id=%s LIMIT 1", @@ -669,7 +669,7 @@ function GET_EXT_ID ($ext_name) { $ret = $cacheArray['extensions']['ext_id'][$ext_name]; // Count cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1", diff --git a/inc/extensions/ext-autopurge.php b/inc/extensions/ext-autopurge.php index eaae7a4177..e842712573 100644 --- a/inc/extensions/ext-autopurge.php +++ b/inc/extensions/ext-autopurge.php @@ -128,7 +128,7 @@ case "update": // Update an extension case "0.1.9": // SQL queries for v0.1.9 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD autopurge_tasks ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD ap_tasks_time BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*7)."'"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD ap_tasks_time BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*7)."'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Bereinigung von zu löschenden Aufgaben klappt wieder. Zeitlimit für genanntes kann eingestellt werden (Default = 7 Tage).

Bitte aktualisieren Sie auch die Admin-Templates!"; diff --git a/inc/extensions/ext-beg.php b/inc/extensions/ext-beg.php index d096f17141..2a8013daf2 100644 --- a/inc/extensions/ext-beg.php +++ b/inc/extensions/ext-beg.php @@ -264,12 +264,12 @@ case "test": // For testing purposes. For details see file inc/modules/admin/wha default: // Do stuff when extension is loaded // Remove old entries - $OLD = $_CONFIG['beg_timeout']; - if ($_CONFIG['beg_uid_timeout'] > $OLD) $OLD = $_CONFIG['beg_uid_timeout']; + $OLD = getConfig('beg_timeout'); + if (getConfig('beg_uid_timeout') > $OLD) $OLD = getConfig('beg_uid_timeout'); $result_ext = SQL_QUERY("DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_beg_ips` WHERE timeout < (UNIX_TIMESTAMP() -".($OLD + 60*60).")", __FILE__, __LINE__); // Check for beg rallye is active and send mails out - if (($_CONFIG['beg_rallye'] == "Y") && ($_CONFIG['beg_new_mem_notify'] == "Y")) { + if ((getConfig('beg_rallye') == "Y") && (getConfig('beg_new_mem_notify') == "Y")) { // Include file for sending out mails $INC_POOL[] = sprintf("%sinc/mails/beg_mails.php", PATH); } // END - if diff --git a/inc/extensions/ext-birthday.php b/inc/extensions/ext-birthday.php index cf3da62bed..12a7393400 100644 --- a/inc/extensions/ext-birthday.php +++ b/inc/extensions/ext-birthday.php @@ -193,7 +193,7 @@ case "test": // For testing purposes. For details see file inc/modules/admin/wha break; default: // Do stuff when extension is loaded - if ((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['birthday_points'] > 0)) { + if ((isBooleanConstantAndTrue('__DAILY_RESET')) && (getConfig('birthday_points') > 0)) { // Daily reset was run and we shall pay points so we start checking for members who // has a birthday for today $INC_POOL[] = sprintf("%sinc/mails/birthday_mails.php", PATH); diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index 5fbad0782d..cd6a6d8b68 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -38,13 +38,13 @@ if (!defined('__SECURITY')) { } // Version of this extension -$EXT_VERSION = "0.8.7"; +$EXT_VERSION = "0.8.8"; // Auto-set extension version if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION; // Version history array (add more with , "0.1" and so on) -$EXT_VER_HISTORY = array("0.0", "0.1.6", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9", "0.5.0", "0.5.1", "0.5.2", "0.5.3", "0.5.4", "0.5.5", "0.5.6", "0.5.7", "0.5.8", "0.5.9", "0.6.0", "0.6.1", "0.6.2", "0.6.3", "0.6.4", "0.6.5", "0.6.6", "0.6.7", "0.6.8", "0.6.9", "0.7.0", "0.7.1", "0.7.2", "0.7.3", "0.7.4", "0.7.5", "0.7.6", "0.7.7", "0.7.8", "0.7.9", "0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.8.6", "0.8.7"); +$EXT_VER_HISTORY = array("0.0", "0.1.6", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9", "0.5.0", "0.5.1", "0.5.2", "0.5.3", "0.5.4", "0.5.5", "0.5.6", "0.5.7", "0.5.8", "0.5.9", "0.6.0", "0.6.1", "0.6.2", "0.6.3", "0.6.4", "0.6.5", "0.6.6", "0.6.7", "0.6.8", "0.6.9", "0.7.0", "0.7.1", "0.7.2", "0.7.3", "0.7.4", "0.7.5", "0.7.6", "0.7.7", "0.7.8", "0.7.9", "0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.8.6", "0.8.7", "0.8.8"); switch ($EXT_LOAD_MODE) { @@ -125,13 +125,12 @@ case "update": // Update an extension $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES VALUES ('setup','config_bonus','Bonus-{!POINTS!}',8,'Richten Sie Bonus-{!POINTS!} ein, die beim x'ten Klick auf die Mail verbucht werden sollen. Beispiele: Der 1. Klick sollte mehr {!POINTS!} zusätzlich bekommen, als der 10. Klick.')"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD login_bonus FLOAT(20,3) NOT NULL DEFAULT 10.000"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD turbo_bonus FLOAT(20,3) NOT NULL DEFAULT 100.000"; - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD login_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".$_CONFIG['one_day'].""; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD login_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('one_day').""; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD turbo_rates VARCHAR(255) NOT NULL DEFAULT '50;20;10'"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD bonus_ranks TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; // Use actual month for this update $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD login_bonus FLOAT(20,3) NOT NULL DEFAULT 0.000"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD turbo_bonus FLOAT(20,3) NOT NULL DEFAULT 0.000"; - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_stats ADD bonus_stats ENUM('Y','N') NOT NULL DEFAULT 'N'"; $SQLs[] = "UPDATE "._MYSQL_PREFIX."_extensions SET ext_has_css='Y' WHERE ext_name='bonus' AND ext_has_css='N' LIMIT 1"; // Update notes (these will be set as task text!) @@ -262,7 +261,7 @@ KEY userid (userid) break; case "0.4.0": // SQL queries for v0.4.0 - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD bonus_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*7).""; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD bonus_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*7).""; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD bonus_lines BIGINT(20) UNSIGNED NOT NULL DEFAULT 10"; // Update notes (these will be set as task text!) @@ -530,6 +529,13 @@ WHERE last_online < ".$mark." ORDER BY userid"; case "0.8.7": // SQL queries for v0.8.7 $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','list_notifications','Benachrichtigungen','Listet alle an die Mitglieder ausgesandten Benachrichtigungen auf.', 10)"; + // Update notes + $UPDATE_NOTES = "Benachrichtigungsmails für z.B. Bettel- oder Aktiv-Rallye werden nun angezeigt."; + break; + + case "0.8.8": // SQL queries for v0.8.8 + $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_stats ADD bonus_stats_active ENUM('Y','N') NOT NULL DEFAULT 'N'"; + // Update notes $UPDATE_NOTES = "Benachrichtigungsmails für z.B. Bettel- oder Aktiv-Rallye werden nun angezeigt."; break; @@ -542,9 +548,9 @@ case "test": // For testing purposes. For details see file inc/modules/admin/wha default: // Do stuff when extension is loaded if (isBooleanConstantAndTrue('__DAILY_RESET') && (!DEBUG_MODE) && ($CSS != 1)) { // Daily reset was run so let's check if active rallye is activated - if ($_CONFIG['bonus_active'] == "Y") { + if (getConfig('bonus_active') == "Y") { // Run active rallye - if($_CONFIG['bonus_stats'] > 0) $INC_POOL[] = sprintf("%sinc/stats_bonus.php", PATH); + if (getConfig('bonus_stats') > 0) $INC_POOL[] = sprintf("%sinc/stats_bonus.php", PATH); $INC_POOL[] = sprintf("%sinc/monthly/monthly_bonus.php", PATH); } else { // Reset points @@ -553,7 +559,7 @@ default: // Do stuff when extension is loaded } // Check for bonus rallye is active and send mails out - if (($_CONFIG['bonus_active'] == "Y") && ($_CONFIG['bonus_new_mem_notify'] == "Y")) { + if ((getConfig('bonus_active') == "Y") && (getConfig('bonus_new_mem_notify') == "Y")) { // Include file for sending out mails $INC_POOL[] = sprintf("%sinc/mails/bonus_mails.php", PATH); } diff --git a/inc/extensions/ext-booking.php b/inc/extensions/ext-booking.php index 4470efd1be..73ea712ff2 100644 --- a/inc/extensions/ext-booking.php +++ b/inc/extensions/ext-booking.php @@ -51,7 +51,7 @@ switch ($EXT_LOAD_MODE) case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // Configuration entries $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `booking_per_page` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `booking_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day'] * 3).""; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `booking_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day') * 3).""; // Drop/create table for user bookings $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_book`"; diff --git a/inc/extensions/ext-cache.php b/inc/extensions/ext-cache.php index 2f42c603c6..41e689a336 100644 --- a/inc/extensions/ext-cache.php +++ b/inc/extensions/ext-cache.php @@ -237,7 +237,7 @@ default: // Do stuff when extension is loaded global $cacheInstance; // Initialize cache system only when it's needed - $cacheInstance = new CacheSystem($_CONFIG['cache_update'], PATH."inc/".$_CONFIG['cache_path'], $_CONFIG['cache_tested']); + $cacheInstance = new CacheSystem(getConfig('cache_update'), PATH."inc/".getConfig('cache_path'), getConfig('cache_tested')); if ($cacheInstance->getStatus() != "done") { // Failed to initialize cache sustem ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_CANNOT_INITIALIZE); diff --git a/inc/extensions/ext-debug.php b/inc/extensions/ext-debug.php index 3bbc10dac5..08987c83d4 100644 --- a/inc/extensions/ext-debug.php +++ b/inc/extensions/ext-debug.php @@ -129,7 +129,7 @@ PRIMARY KEY (`id`) $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_mode` ENUM('CLIENT','RELAY','SERVER') NOT NULL DEFAULT 'CLIENT'"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_new_log` ENUM('ACCEPT','FIRST','REG') NOT NULL DEFAULT 'FIRST'"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_new_client` ENUM('ACTIVE','NEW','REG') NOT NULL DEFAULT 'NEW'"; - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_reject_log` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day'] * 30).""; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_reject_log` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day') * 30).""; break; case "remove": // Do stuff when removing extension diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php index 1696640d88..75cc6c2d3f 100644 --- a/inc/extensions/ext-doubler.php +++ b/inc/extensions/ext-doubler.php @@ -88,7 +88,7 @@ PRIMARY KEY(id) // --> This also means who fast the doubled points will be payed out! $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD doubler_send_mode ENUM('DIRECT','RESET') NOT NULL DEFAULT 'DIRECT'"; // Timeout for entries to be purged (default: one week) - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD doubler_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*7).""; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD doubler_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*7).""; // Number of newest entries to display $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD doubler_display_new TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; // Number of entries which will be payed out soon @@ -238,7 +238,7 @@ case "test": // For testing purposes. For details see file inc/modules/admin/wha break; default: // Do stuff when extension is loaded - if ((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['doubler_send_mode'] == "RESET")) { + if ((isBooleanConstantAndTrue('__DAILY_RESET')) && (getConfig('doubler_send_mode') == "RESET")) { // So let's check for points $INC_POOL[] = sprintf("%sinc/doubler_send.php", PATH); } diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index a25a89521c..e91e384008 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -157,7 +157,7 @@ case "update": // Update an extension case "0.1.3": // SQL queries for v0.1.3 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD holiday_active ENUM('Y','N') NOT NULL DEFAULT 'N'"; $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_max_receive WHERE value='0' LIMIT 1"; - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD holiday_lock BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*2)."'"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD holiday_lock BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*2)."'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Die Mitglieder-Accounts werden nicht mehr gesperrt, sondern nur auf Urlaub geschaltet. Lassen Sie sich nicht davon verwirren, dass sie "freigegeben" sind!"; diff --git a/inc/extensions/ext-primera.php b/inc/extensions/ext-primera.php index c7a1124755..246335a98c 100644 --- a/inc/extensions/ext-primera.php +++ b/inc/extensions/ext-primera.php @@ -69,6 +69,7 @@ PRIMARY KEY(id) $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD primera_min_withdraw BIGINT(20) UNSIGNED NOT NULL DEFAULT 5000"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD primera_api_name VARCHAR(255) NOT NULL DEFAULT ''"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD primera_api_md5 VARCHAR(32) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD primera_refid VARCHAR(255) NOT NULL DEFAULT ''"; // User data $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD primera_userid VARCHAR(255) NOT NULL DEFAULT ''"; diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index 936fc02a54..8bc5cf8fc9 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -83,7 +83,7 @@ last_online VARCHAR(10) NOT NULL DEFAULT 0, last_change VARCHAR(10) NOT NULL DEFAULT 0, status ENUM('UNCONFIRMED','PENDING','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED', receive_warnings ENUM('Y','N') NOT NULL DEFAULT 'Y', -warning_interval BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*7)."', +warning_interval BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*7)."', points_amount FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, points_used FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, refid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index a8518ffc07..92b8b05ed5 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -146,7 +146,7 @@ case "update": // Update an extension break; case "0.0.2": // SQL queries for v0.0.2 - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` CHANGE auto_purge auto_purge BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*14).""; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` CHANGE auto_purge auto_purge BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*14).""; // Update notes (these will be set as task text!) $UPDATE_NOTES = "In der Tabelle "._MYSQL_PREFIX."_config musste die Spalte auto_purge (autom. Löschen von Bestätigungsmails angepasst werden (war auf dem Testsystem auf TINYINT(4) gesetzt.)"; @@ -212,7 +212,7 @@ case "update": // Update an extension case "0.1.1": // SQL queries for v0.1.1 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_admin_menu` SET title='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Menüpunkt (what-welcome ist Standart) als Einstiegspunkt in das Menüsystem genutzt werden soll und wie die automatische Weiterleitung in der Eingangsseite funktionieren soll.' WHERE `what`='config_home' LIMIT 1"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD index_delay TINYINT(3) UNSIGNED NOT NULL DEFAULT '-1'"; - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*365).""; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*365).""; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Sie können nun hier die Verzögerungszeit in der Eingangsseite einstellen."; @@ -715,7 +715,7 @@ default: // Do stuff when extension is loaded $_CONFIG['secret_key'] = ""; // Read key from secret file - if ((empty($_CONFIG['file_hash'])) || (empty($_CONFIG['master_salt'])) || (empty($_CONFIG['pass_scramble']))) { + if ((getConfig('file_hash') == "") || (getConfig('master_salt') == "") || (getConfig('pass_scramble') == "")) { // Maybe need setup of secret key! require_once(PATH."inc/gen_sql_patches.php"); @@ -729,9 +729,9 @@ default: // Do stuff when extension is loaded } // END - if // Test again - if ((!empty($_CONFIG['file_hash'])) && (!empty($_CONFIG['master_salt'])) && (!empty($_CONFIG['pass_scramble']))) { + if ((getConfig('file_hash') != "") && (getConfig('master_salt') != "") && (getConfig('pass_scramble') != "")) { // File hash fas generated so we can also file the secret file... hopefully. - $hashFile = sprintf("%sinc/.secret/.%s", PATH, $_CONFIG['file_hash']); + $hashFile = sprintf("%sinc/.secret/.%s", PATH, getConfig('file_hash')); if (FILE_READABLE($hashFile)) { // Read file $_CONFIG['secret_key'] = implode("", file($hashFile)); @@ -745,18 +745,18 @@ default: // Do stuff when extension is loaded } // END - if // Transfer words/numbers to constants - define('POINTS' , $_CONFIG['points_word']); - define('MT_WORD' , $_CONFIG['mt_word']); - define('MT_WORD2', $_CONFIG['mt_word2']); - define('MT_WORD3', $_CONFIG['mt_word3']); - define('_MAX' , $_CONFIG['rand_no']); + define('POINTS' , getConfig('points_word')); + define('MT_WORD' , getConfig('mt_word')); + define('MT_WORD2', getConfig('mt_word2')); + define('MT_WORD3', getConfig('mt_word3')); + 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'] = "-"; - //$_CONFIG['verbose_sql'] = "N"; + // @TODO Can we remove this? $_CONFIG['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/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index fbb2cf5068..7157b5e2aa 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -160,13 +160,14 @@ UNIQUE KEY `status_action` (`status`,`action`) $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_weekly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_monthly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_stats_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 30"; - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_deleted` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*7).""; - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_migrated` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*3).""; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_deleted` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*7).""; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_migrated` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*3).""; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_pause_mode` ENUM('INTERNAL','EXERNAL') NOT NULL DEFAULT 'INTERNAL'"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_pause_url` VARCHAR(255) NOT NULL DEFAULT ''"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_notify_limits` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_notify_admin_unlock` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_warn_low_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 100"; - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_low_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".$_CONFIG['one_day'].""; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_low_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('one_day').""; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_migrate_order` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_notification_mode` ENUM('INSTANT','RESET') NOT NULL DEFAULT 'INSTANT'"; diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php index a807ee29e3..f2fef8784f 100644 --- a/inc/extensions/ext-transfer.php +++ b/inc/extensions/ext-transfer.php @@ -92,8 +92,8 @@ PRIMARY KEY(id) // Add config values $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD transfer_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '50'"; - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*28)."'"; - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".$_CONFIG['one_day']."'"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*28)."'"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".getConfig('one_day')."'"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD transfer_balance BIGINT(20) UNSIGNED NOT NULL DEFAULT 100"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD transfer_code BIGINT(20) UNSIGNED NOT NULL DEFAULT 5"; @@ -280,9 +280,9 @@ case "test": // For testing purposes. For details see file inc/modules/admin/wha break; default: // Do stuff when extension is loaded - if ((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['ap_transfer'] == "Y")) { + if ((isBooleanConstantAndTrue('__DAILY_RESET')) && (getConfig('ap_transfer') == "Y")) { // Automatically remove outdated or not displayed transactions - TRANSFER_AUTPPURGE($_CONFIG['transfer_max'], $_CONFIG['transfer_age']); + TRANSFER_AUTPPURGE(getConfig('transfer_max'), getConfig('transfer_age')); } break; } diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index 08c607e544..3ba1a8a8ce 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -223,7 +223,7 @@ case "update": // Update an extension case "0.3.5": // SQL queries for v0.3.5 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD `lock_reason` TINYTEXT"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD `lock_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00'"; - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `user_delete_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day'] * 30).""; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `user_delete_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day') * 30).""; $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_user_del','Löschungen auflisten','Listet die Löschungen von Usern auf.', 9)"; $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_del`"; $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_user_del` ( diff --git a/inc/footer.php b/inc/footer.php index 90f323b5c3..5e248a609b 100644 --- a/inc/footer.php +++ b/inc/footer.php @@ -63,7 +63,7 @@ if (($footer != "1") && ($footer != "2") && ($CSS != "1")) { } // END - if // Shall we display the parsing time and number of queries? - if ((isset($_CONFIG['show_timings'])) && ($_CONFIG['show_timings'] == "Y") && (empty($_GET['frame'])) && ($header == "2")) { + if ((getConfig('show_timings') == "Y") && (empty($_GET['frame'])) && ($header == "2")) { // Then display it here DISPLAY_PARSING_TIME_FOOTER(); } // END - if diff --git a/inc/functions.php b/inc/functions.php index 99308e65a5..992c4a7373 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -233,8 +233,11 @@ function LOAD_TEMPLATE($template, $return=false, $content=array()) { $template = strtolower($template); // Count the template load - if (!isset($_CONFIG['num_templates'])) $_CONFIG['num_templates'] = 0; - $_CONFIG['num_templates']++; + if (getConfig('num_templates') == null) { + $_CONFIG['num_templates'] = 1; + } else { + $_CONFIG['num_templates']++; + } // Init some data $ret = ""; @@ -249,7 +252,7 @@ function LOAD_TEMPLATE($template, $return=false, $content=array()) { // Is content an array? if (is_array($content)) { // Merge data - $content = array_merge($content, SQL_FETCHARRAY($result)); + $content = merge_array($content, SQL_FETCHARRAY($result)); // Translate gender $content['gender'] = TRANSLATE_GENDER($content['gender']); @@ -527,7 +530,7 @@ function SEND_RAW_EMAIL ($to, $subject, $msg, $from) { // Generate a password in a specified length or use default password length function GEN_PASS($LEN = 0) { global $_CONFIG; - if ($LEN == 0) $LEN = $_CONFIG['pass_len']; + if ($LEN == 0) $LEN = getConfig('pass_len'); // Initialize array with all allowed chars $ABC = explode(",", "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9,-,+,_,/"); @@ -594,10 +597,10 @@ function TRANSLATE_COMMA ($dotted, $cut=true, $max=0) { global $_CONFIG; // Default is 3 you can change this in admin area "Misc -> Misc Options" - if (empty($_CONFIG['max_comma'])) $_CONFIG['max_comma'] = "3"; + if (getConfig('max_comma') == null) $_CONFIG['max_comma'] = "3"; // Use from config is default - $maxComma = $_CONFIG['max_comma']; + $maxComma = getConfig('max_comma'); // Use from parameter? if ($max > 0) $maxComma = $max; @@ -784,15 +787,15 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") { $email = WEBMASTER; // Expiration in a nice output format - if ($_CONFIG['auto_purge'] == 0) { + if (getConfig('auto_purge') == 0) { // Will never expire! $EXPIRATION = MAIL_WILL_NEVER_EXPIRE; } elseif (function_exists('CREATE_FANCY_TIME')) { // Create nice date string - $EXPIRATION = CREATE_FANCY_TIME($_CONFIG['auto_purge']); + $EXPIRATION = CREATE_FANCY_TIME(getConfig('auto_purge')); } else { // Display days only - $EXPIRATION = round($_CONFIG['auto_purge']/60/60/24)." "._DAYS; + $EXPIRATION = round(getConfig('auto_purge')/60/60/24)." "._DAYS; } // Is content an array? @@ -819,7 +822,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") { // Fetch and merge data //* DEBUG: */ print __FUNCTION__."(".__LINE__."):content()=".count($content)." - PRE
\n"; - $content = array_merge($content, SQL_FETCHARRAY($result)); + $content = merge_array($content, SQL_FETCHARRAY($result)); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):content()=".count($content)." - AFTER
\n"; // Free result @@ -1139,7 +1142,7 @@ function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0") { // Use configured min age or fixed? if (GET_EXT_VERSION("other") >= "0.2.1") { // Configured - $startYear = $YEAR - $_CONFIG['min_age']; + $startYear = $YEAR - getConfig('min_age'); } else { // Fixed 16 years $startYear = $YEAR - 16; @@ -1167,7 +1170,7 @@ function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0") { // Calculate earliest year depending on extension version if (GET_EXT_VERSION("other") >= "0.2.1") { // Use configured minimum age - $YEAR = date('Y', time()) - $_CONFIG['min_age']; + $YEAR = date('Y', time()) - getConfig('min_age'); } else { // Use fixed 16 years age $YEAR = date('Y', time()) - 16; @@ -1217,8 +1220,8 @@ function TRANSLATE_YESNO($yn) { switch ($yn) { - case 'Y': $yn = YES; break; - case 'N': $yn = NO; break; + case "Y": $yn = YES; break; + case "N": $yn = NO; break; default : $yn = "??? (".$yn.")"; break; } return $yn; @@ -1238,10 +1241,10 @@ function GEN_RANDOM_CODE($length, $code, $uid, $DATA="") { // Build key string $keys = SITE_KEY.":".DATE_KEY; - if (isset($_CONFIG['secret_key'])) $keys .= ":".$_CONFIG['secret_key']; - if (isset($_CONFIG['file_hash'])) $keys .= ":".$_CONFIG['file_hash']; - $keys .= ":".date("d-m-Y (l-F-T)", bigintval($_CONFIG['patch_ctime'])); - if (isset($_CONFIG['master_salt'])) $keys .= ":".$_CONFIG['master_salt']; + if (getConfig('secret_key') != null) $keys .= ":".getConfig('secret_key'); + if (getConfig('file_hash') != null) $keys .= ":".getConfig('file_hash'); + $keys .= ":".date("d-m-Y (l-F-T)", bigintval(getConfig('patch_ctime'))); + if (getConfig('master_salt') != null) $keys .= ":".getConfig('master_salt'); // Build string from misc data $data = $code.":".$uid.":".$DATA; @@ -1257,12 +1260,12 @@ function GEN_RANDOM_CODE($length, $code, $uid, $DATA="") { // Calculate number for generating the code $a = $code + _ADD - 1; - if (isset($_CONFIG['master_hash'])) { + if (getConfig('master_hash') != null) { // Generate hash with master salt from modula of number with the prime number and other data - $saltedHash = generateHash(($a % _PRIME).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, $_CONFIG['master_salt']); + $saltedHash = generateHash(($a % _PRIME).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, getConfig('master_salt')); // Create number from hash - $rcode = hexdec(substr($saltedHash, strlen($_CONFIG['master_salt']), 9)) / abs(_MAX - $a + sqrt(_ADD)) / pi(); + $rcode = hexdec(substr($saltedHash, strlen(getConfig('master_salt')), 9)) / abs(_MAX - $a + sqrt(_ADD)) / pi(); } else { // Generate hash with "hash of site key" from modula of number with the prime number and other data $saltedHash = generateHash(($a % _PRIME).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, substr(sha1(SITE_KEY), 0, 8)); @@ -1272,7 +1275,7 @@ function GEN_RANDOM_CODE($length, $code, $uid, $DATA="") { } // At least 10 numbers shall be secure enought! - $len = $_CONFIG['code_length']; + $len = getConfig('code_length'); if ($len == 0) $len = $length; if ($len == 0) $len = 10; @@ -1306,7 +1309,7 @@ function bigintval($num, $castValue = true) { function GENERATE_IMAGE($img_code, $header=true) { global $_CONFIG; - if ((strlen($img_code) > 6) || (empty($img_code)) || ($_CONFIG['code_length'] == 0)) { + if ((strlen($img_code) > 6) || (empty($img_code)) || (getConfig('code_length') == 0)) { // Stop execution of function here because of over-sized code length return; } elseif (!$header) { @@ -1315,10 +1318,10 @@ function GENERATE_IMAGE($img_code, $header=true) { } // Load image - $img = sprintf("%s/theme/%s/images/code_bg.%s", PATH, GET_CURR_THEME(), $_CONFIG['img_type']); + $img = sprintf("%s/theme/%s/images/code_bg.%s", PATH, GET_CURR_THEME(), getConfig('img_type')); if (FILE_READABLE($img)) { // Switch image type - switch ($_CONFIG['img_type']) + switch (getConfig('img_type')) { case "jpg": // Okay, load image and hide all errors @@ -1342,10 +1345,10 @@ function GENERATE_IMAGE($img_code, $header=true) { imagestring($image, 5, 14, 2, $img_code, $text_color); // Return to browser - header ("Content-Type: image/".$_CONFIG['img_type']); + header ("Content-Type: image/".getConfig('img_type')); // Output image with matching image factory - switch ($_CONFIG['img_type']) { + switch (getConfig('img_type')) { case "jpg": imagejpeg($image); break; case "png": imagepng($image); break; } @@ -1368,7 +1371,7 @@ function CREATE_TIME_SELECTIONS ($timestamp, $prefix="", $display="", $align="ce $M2 = date("m", (time() + $timestamp)); // If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day) - if ((floor($TEST) == $TEST) && ($M1 == "02") && ($M2 > "02")) $SWITCH = $_CONFIG['one_day']; + if ((floor($TEST) == $TEST) && ($M1 == "02") && ($M2 > "02")) $SWITCH = getConfig('one_day'); // First of all years... $Y = abs(floor($timestamp / (31536000 + $SWITCH))); @@ -1377,19 +1380,19 @@ function CREATE_TIME_SELECTIONS ($timestamp, $prefix="", $display="", $align="ce $M = abs(floor($timestamp / 2628000 - $Y * 12)); //* DEBUG: */ print("M={$M}
\n"); // Next weeks - $W = abs(floor($timestamp / 604800 - $Y * ((365 + $SWITCH / $_CONFIG['one_day']) / 7) - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) / 7))); + $W = abs(floor($timestamp / 604800 - $Y * ((365 + $SWITCH / getConfig('one_day')) / 7) - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) / 7))); //* DEBUG: */ print("W={$W}
\n"); // Next days... - $D = abs(floor($timestamp / 86400 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day'])) - $W * 7)); + $D = abs(floor($timestamp / 86400 - $Y * (365 + $SWITCH / getConfig('one_day')) - ($M / 12 * (365 + $SWITCH / getConfig('one_day'))) - $W * 7)); //* DEBUG: */ print("D={$D}
\n"); // Next hours... - $h = abs(floor($timestamp / 3600 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24) - $W * 7 * 24 - $D * 24)); + $h = abs(floor($timestamp / 3600 - $Y * (365 + $SWITCH / getConfig('one_day')) * 24 - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) * 24) - $W * 7 * 24 - $D * 24)); //* DEBUG: */ print("h={$h}
\n"); // Next minutes.. - $m = abs(floor($timestamp / 60 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 60 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60)); + $m = abs(floor($timestamp / 60 - $Y * (365 + $SWITCH / getConfig('one_day')) * 24 * 60 - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60)); //* DEBUG: */ print("m={$m}
\n"); // And at last seconds... - $s = abs(floor($timestamp - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60)); + $s = abs(floor($timestamp - $Y * (365 + $SWITCH / getConfig('one_day')) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60)); //* DEBUG: */ print("s={$s}
\n"); // Is seconds zero and time is < 60 seconds? @@ -1557,7 +1560,7 @@ function CREATE_TIMESTAMP_FROM_SELECTIONS($prefix, $POST) { $TEST = date('Y', time()) / 4; $M1 = date("m", time()); // If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day) - if ((floor($TEST) == $TEST) && ($M1 == "02") && ($POST[$prefix."_mo"] > "02")) $SWITCH = $_CONFIG['one_day']; + if ((floor($TEST) == $TEST) && ($M1 == "02") && ($POST[$prefix."_mo"] > "02")) $SWITCH = getConfig('one_day'); // First add years... $ret += $POST[$prefix."_ye"] * (31536000 + $SWITCH); // Next months... @@ -1818,7 +1821,7 @@ function SEND_RAW_REQUEST ($host, $request) { $useProxy = false; // Are proxy settins set? - if ((!empty($_CONFIG['proxy_host'])) && ($_CONFIG['proxy_port'] > 0)) { + if ((getConfig('proxy_host') != "") && (getConfig('proxy_port') > 0)) { // Then use it $useProxy = true; } // END - if @@ -1826,7 +1829,7 @@ function SEND_RAW_REQUEST ($host, $request) { // Open connection //* DEBUG: */ die("SCRIPT=".$script."
\n"); if ($useProxy) { - $fp = @fsockopen(COMPILE_CODE($_CONFIG['proxy_host']), $_CONFIG['proxy_port'], $errno, $errdesc, 30); + $fp = @fsockopen(COMPILE_CODE(getConfig('proxy_host')), getConfig('proxy_port'), $errno, $errdesc, 30); } else { $fp = @fsockopen($host, 80, $errno, $errdesc, 30); } @@ -1844,9 +1847,9 @@ function SEND_RAW_REQUEST ($host, $request) { $proxyTunnel .= "Host: ".$host."\r\n"; // Use login data to proxy? (username at least!) - if (!empty($_CONFIG['proxy_username'])) { + if (getConfig('proxy_username') != "") { // Add it as well - $encodedAuth = base64_encode(COMPILE_CODE($_CONFIG['proxy_username']).":".COMPILE_CODE($_CONFIG['proxy_password'])); + $encodedAuth = base64_encode(COMPILE_CODE(getConfig('proxy_username')).":".COMPILE_CODE(getConfig('proxy_password'))); $proxyTunnel .= "Proxy-Authorization: Basic ".$encodedAuth."\r\n"; } // END - if @@ -2029,7 +2032,7 @@ function generateHash ($plainText, $salt = "") { } // END - if // Do we miss an arry element here? - if (!isset($_CONFIG['file_hash'])) { + if (getConfig('file_hash') == null) { // Stop here print("Missing file_hash in ".__FUNCTION__.". Backtrace:
");
 		debug_print_backtrace();
@@ -2042,7 +2045,7 @@ function generateHash ($plainText, $salt = "") {
 		$server = $_SERVER['PHP_SELF'].":".GET_USER_AGENT().":".getenv('SERVER_SOFTWARE').":".GET_REMOTE_ADDR().":".":".filemtime(PATH."inc/databases.php");
 
 		// Build key string
-		$keys   = SITE_KEY.":".DATE_KEY.":".$_CONFIG['secret_key'].":".$_CONFIG['file_hash'].":".date("d-m-Y (l-F-T)", bigintval($_CONFIG['patch_ctime'])).":".$_CONFIG['master_salt'];
+		$keys   = SITE_KEY.":".DATE_KEY.":".getConfig('secret_key').":".getConfig('file_hash').":".date("d-m-Y (l-F-T)", bigintval(getConfig('patch_ctime'))).":".getConfig('master_salt');
 
 		// Additional data
 		$data = $plainText.":".uniqid(mt_rand(), true).":".time();
@@ -2059,11 +2062,11 @@ function generateHash ($plainText, $salt = "") {
 		//* DEBUG: */ echo "Descrambled=".$sha1b." (".strlen($sha1b).")
"; // Generate the password salt string - $salt = substr($sha1, 0, $_CONFIG['salt_length']); + $salt = substr($sha1, 0, getConfig('salt_length')); //* DEBUG: */ echo $salt." (".strlen($salt).")
"; } else { // Use given salt - $salt = substr($salt, 0, $_CONFIG['salt_length']); + $salt = substr($salt, 0, getConfig('salt_length')); //* DEBUG: */ echo "GIVEN={$salt}
\n"; } @@ -2083,7 +2086,7 @@ function scrambleString($str) { return $str; } elseif (strlen($str) == 40) { // From database - $scrambleNums = explode(":", $_CONFIG['pass_scramble']); + $scrambleNums = explode(":", getConfig('pass_scramble')); } else { // Generate new numbers $scrambleNums = explode(":", genScrambleString(strlen($str))); @@ -2110,7 +2113,7 @@ function descrambleString($str) { if (strlen($str) != 40) return $str; // Load numbers from config - $scrambleNums = explode(":", $_CONFIG['pass_scramble']); + $scrambleNums = explode(":", getConfig('pass_scramble')); // Validate numbers if (count($scrambleNums) != 40) return $str; @@ -2166,9 +2169,9 @@ function ADD_URL_DATA($URL) { if ((!empty($_GET['refid'])) && (strpos($URL, "refid=") == 0)) { // Cookie found in URL $ADD .= $BIND."refid=".bigintval($_GET['refid']); - } elseif ((GET_EXT_VERSION("sql_patches") != '') && ($_CONFIG['def_refid'] > 0)) { + } elseif ((GET_EXT_VERSION("sql_patches") != '') && (getConfig('def_refid') > 0)) { // Not found! So let's set default here - $ADD .= $BIND."refid=".$_CONFIG['def_refid']; + $ADD .= $BIND."refid=".getConfig('def_refid'); } // Is there already added data? Then change the binder @@ -2195,12 +2198,12 @@ function generatePassString($passHash) { $ret = $passHash; // Is a secret key and master salt already initialized? - if ((!empty($_CONFIG['secret_key'])) && (!empty($_CONFIG['master_salt']))) { + if ((getConfig('secret_key') != "") && (getConfig('master_salt') != "")) { // Only calculate when the secret key is generated $newHash = ""; $start = 9; for ($idx = 0; $idx < 10; $idx++) { $part1 = hexdec(substr($passHash, $start, 4)); - $part2 = hexdec(substr($_CONFIG['secret_key'], $start, 4)); + $part2 = hexdec(substr(getConfig('secret_key'), $start, 4)); $mod = dechex($idx); if ($part1 > $part2) { $mod = dechex(sqrt(($part1 - $part2) * _PRIME / pi())); @@ -2215,7 +2218,7 @@ function generatePassString($passHash) { } // END - for //* DEBUG: */ print($passHash."
".$newHash." (".strlen($newHash).")"); - $ret = generateHash($newHash, $_CONFIG['master_salt']); + $ret = generateHash($newHash, getConfig('master_salt')); //* DEBUG: */ print($ret."
\n"); } else { // Hash it simple @@ -2259,13 +2262,15 @@ function mxchange_die ($msg) { // Display parsing time and number of SQL queries in footer function DISPLAY_PARSING_TIME_FOOTER() { global $_CONFIG; - $endTime = microtime(true); // Is the timer started? if (!isset($GLOBALS['startTime'])) { // Abort here return false; - } + } // END - if + + // Get end time + $endTime = microtime(true); // "Explode" both times $start = explode(" ", $GLOBALS['startTime']); @@ -2277,8 +2282,8 @@ function DISPLAY_PARSING_TIME_FOOTER() { // Prepare output $content = array( 'runtime' => $runTime, - 'numSQLs' => ($_CONFIG['sql_count'] + 1), - 'numTemplates' => ($_CONFIG['num_templates'] + 1) + 'numSQLs' => (getConfig('sql_count') + 1), + 'numTemplates' => (getConfig('num_templates') + 1) ); // Load the template @@ -2478,9 +2483,9 @@ function RESET_ADD_INCLUDES () { $currWeek = date("W", time()); // Has it changed? - if ($_CONFIG['last_week'] != $currWeek) { + if (getConfig('last_week') != $currWeek) { // Include weekly reset scripts - $INC_POOL = array_merge($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/weekly/", "weekly_")); + $INC_POOL = merge_array($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/weekly/", "weekly_")); // Update config if (!defined('DEBUG_WEEKLY')) UPDATE_CONFIG("last_week", $currWeek); @@ -2490,9 +2495,9 @@ function RESET_ADD_INCLUDES () { $currMonth = date("m", time()); // Has it changed? - if ($_CONFIG['last_month'] != $currMonth) { + if (getConfig('last_month') != $currMonth) { // Include monthly reset scripts - $INC_POOL = array_merge($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/monthly/", "monthly_")); + $INC_POOL = merge_array($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/monthly/", "monthly_")); // Update config if (!defined('DEBUG_MONTHLY')) UPDATE_CONFIG("last_month", $currMonth); @@ -2518,7 +2523,7 @@ function HANDLE_EXTRA_VALUES ($filterFunction, $value, $extraValue) { // If we have an array simply use it and pre-extend it with our value if (is_array($extraValue)) { // Make the new args array - $args = array_merge(array($value), $extraValue); + $args = merge_array(array($value), $extraValue); } // END - if // Call the multi-parameter call-back @@ -2651,7 +2656,7 @@ function REBUILD_CACHE ($cache, $inc="") { } // Purge admin menu cache function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") { - global $_CONFIG, $cacheInstance; + global $cacheInstance; // Is the cache extension enabled or no cache instance or admin menu cache disabled? if (!EXT_IS_ACTIVE("cache")) { @@ -2661,7 +2666,7 @@ function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") { // No cache instance! DEBUG_LOG(__FUNCTION__, __LINE__, " No cache instance found."); return false; - } elseif ((!isset($_CONFIG['cache_admin_menu'])) || ($_CONFIG['cache_admin_menu'] == "N")) { + } elseif ((getConfig('cache_admin_menu') == null) || (getConfig('cache_admin_menu') == "N")) { // Caching disabled (currently experiemental!) return false; } @@ -2797,10 +2802,10 @@ function DETERMINE_REFID () { } elseif ((isSessionVariableSet('refid')) && (get_session('refid') != 0)) { // Set session refid als global $GLOBALS['refid'] = bigintval(get_session('refid')); - } elseif ((GET_EXT_VERSION("sql_patches") != "") && ($_CONFIG['def_refid'] > 0)) { + } elseif ((GET_EXT_VERSION("sql_patches") != "") && (getConfig('def_refid') > 0)) { // Set default refid as refid in URL - $GLOBALS['refid'] = bigintval($_CONFIG['def_refid']); - } elseif ((GET_EXT_VERSION("user") >= "0.3.4") && ($_CONFIG['select_user_zero_refid']) == "Y") { + $GLOBALS['refid'] = bigintval(getConfig('def_refid')); + } elseif ((GET_EXT_VERSION("user") >= "0.3.4") && (getConfig('select_user_zero_refid')) == "Y") { // Select a random user which has confirmed enougth mails $GLOBALS['refid'] = SELECT_RANDOM_REFID(); } else { @@ -2809,7 +2814,7 @@ function DETERMINE_REFID () { } // Set cookie when default refid > 0 - if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((get_session('refid') == "0") && (isset($_CONFIG['def_refid'])) && ($_CONFIG['def_refid'] > 0))) { + if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((get_session('refid') == "0") && (getConfig('def_refid') > 0))) { // Set cookie set_session('refid', $GLOBALS['refid']); } // END - if @@ -2836,6 +2841,23 @@ function IF_APACHE_MODULE_LOADED ($apacheModule) { return (((function_exists('apache_get_modules')) && (in_array($apacheModule, apache_get_modules()))) || (!function_exists('apache_get_modules'))); } +// Getter for $_CONFIG entries +function getConfig ($entry) { + global $_CONFIG; + + // Default value + $value = null; + + // Is the entry there? + if (isset($_CONFIG[$entry])) { + // Then use it + $value = $_CONFIG[$entry]; + } // END - if + + // Return it + return $value; +} + ////////////////////////////////////////////////// // // // AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS // diff --git a/inc/gen_sql_patches.php b/inc/gen_sql_patches.php index 18faa6fd8c..98337f0f3c 100644 --- a/inc/gen_sql_patches.php +++ b/inc/gen_sql_patches.php @@ -41,7 +41,7 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { if (GET_EXT_VERSION("sql_patches") < "0.3.6") return false; // Check if there is no scrambling string -if (empty($_CONFIG['pass_scramble'])) { +if (getConfig('pass_scramble') == "") { // Generate 40 chars long scramble string $scrambleString = genScrambleString(40); @@ -55,7 +55,7 @@ if (empty($_CONFIG['pass_scramble'])) { } // END - if // Check if there is no master salt string -if (empty($_CONFIG['master_salt'])) { +if (getConfig('master_salt') == "") { // Generate the master salt which is the first chars minus 40 chars of this random hash // We do an extra scrambling here... $masterSalt = scrambleString(substr(generateHash(GEN_PASS(mt_rand(128, 256))), 0, -40)); @@ -69,7 +69,7 @@ if (empty($_CONFIG['master_salt'])) { unset($masterSalt); } // END - if -if (empty($_CONFIG['file_hash'])) { +if (getConfig('file_hash') == "") { // Create filename from hashed random string $file_hash = generateHash(sha1(GEN_PASS(mt_rand(128, 256)))); $file = PATH."inc/.secret/.".$file_hash; diff --git a/inc/header.php b/inc/header.php index a13fff6eb8..b510202cc6 100644 --- a/inc/header.php +++ b/inc/header.php @@ -53,7 +53,7 @@ if (($header != "1") && ($header != "2")) { // Config and database connection valid? if ((isset($_CONFIG)) && (is_array($_CONFIG)) && (count($_CONFIG) > 1) && (is_resource($link)) && (isset($db))) { // Title decoration enabled? - if (($_CONFIG['enable_title_deco'] == "Y") && (!empty($_CONFIG['title_left']))) $TITLE .= trim($_CONFIG['title_left'])." "; + if ((getConfig('enable_title_deco') == "Y") && (getConfig('title_left') != "")) $TITLE .= trim(getConfig('title_left'))." "; // Do we have some extra title? if (!empty($EXTRA_TITLE)) { @@ -65,18 +65,16 @@ if (($header != "1") && ($header != "2")) { $TITLE .= MAIN_TITLE; // Add title of module? (middle decoration will also be added!) - if (isset($_CONFIG['enable_mod_title'])) { - if (($_CONFIG['enable_mod_title'] == "Y") || ((empty($GLOBALS['what'])) && (empty($GLOBALS['action']))) || ($GLOBALS['module'] == "admin")) $TITLE .= " ".trim($_CONFIG['title_middle'])." ".ADD_MODULE_TITLE($GLOBALS['module']); - } // END - if + if ((getConfig('enable_mod_title') == "Y") || ((empty($GLOBALS['what'])) && (empty($GLOBALS['action']))) || ($GLOBALS['module'] == "admin")) $TITLE .= " ".trim(getConfig('title_middle'))." ".ADD_MODULE_TITLE($GLOBALS['module']); // Add title from what file $MODE = ""; if ($GLOBALS['module'] == "login") $MODE = "member"; elseif ($GLOBALS['module'] == "index") $MODE = "guest"; - if ((!empty($MODE)) && (isset($_CONFIG['enable_what_title'])) && ($_CONFIG['enable_what_title'] == "Y")) $TITLE .= " ".trim($_CONFIG['title_middle'])." ".GET_MOD_DESCR($MODE, $GLOBALS['what']); + if ((!empty($MODE)) && (getConfig('enable_what_title') == "Y")) $TITLE .= " ".trim(getConfig('title_middle'))." ".GET_MOD_DESCR($MODE, $GLOBALS['what']); // Add title decorations? (right) - if (($_CONFIG['enable_title_deco'] == "Y") && (!empty($_CONFIG['title_right']))) $TITLE .= " ".trim($_CONFIG['title_right']); + if ((getConfig('enable_title_deco') == "Y") && (getConfig('title_right') != "")) $TITLE .= " ".trim(getConfig('title_right')); // Remember title in constant for the template define('__PAGE_TITLE', html_entity_decode($TITLE)); diff --git a/inc/install-inc.php b/inc/install-inc.php index b01597a871..5768d4807b 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -356,7 +356,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT $sql = str_replace("\n\n", "\n", $sql); // And split it up against ;\n ... - $SQLs = array_merge($SQLs, explode(";\n", $sql)); + $SQLs = merge_array($SQLs, explode(";\n", $sql)); } // END - if } // END - foreach diff --git a/inc/language/de.php b/inc/language/de.php index 3de3caa6e4..2724fb93dc 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -733,6 +733,7 @@ define('GUEST_STATS_TONLINE', "Heute Online gewesen"); define('GUEST_STATS_YONLINE', "Gestern Online gewesen"); define('GUEST_STATS_TREGISTER', "Heutige Anmeldungen"); define('GUEST_STATS_YREGISTER', "Gestrige Anmeldungen"); +define('GUEST_STATS_INACTIVE', "Mitgliederstatistik deaktiviert"); define('CHANGE_MENUS', "Ändern"); define('CHANGE_MEMBER_MENU', "Verdecken, anzeigen, deaktivieren, aktivieren des Mitgliedsmenüs"); define('CHANGE_MENU_1', "Ändern von "); @@ -1015,7 +1016,7 @@ define('SVN_REPOSITORY', "SVN-Repository"); define('SVN_CHECKOUT_COMMAND', "SVN auschecken mit:"); define('DOWNLOAD_NOW', "Jetzt downloaden!"); define('ADMIN_MEMBER_STATS_TITLE', "Einstellungen an der Mitglieder-Statistik"); -define('ADMIN_MEMBER_STATS_LIMIT', "Anzahl Mailbuchungen pro Seite"); +define('ADMIN_MEMBER_STATS_LIMIT', "Anzahl Mailbuchungen pro Seite (Nicht verwendet!)"); define('MEMBER_NO_THEMES_FOUND', "Keine Design gefunden!"); define('MEMBER_THEME_LIST_NOTE', "Wenn Sie Fragen zu einem der Designs haben, wenden Sie sich bitte an den jeweiligen Autor!"); define('MEMBER_SAVE_THEME', "Design speichern"); diff --git a/inc/language/primera_de.php b/inc/language/primera_de.php index e3f3150192..9757b3aac4 100644 --- a/inc/language/primera_de.php +++ b/inc/language/primera_de.php @@ -45,6 +45,7 @@ define('PRIMERA_ADMIN_MIN_PAYOUT', "Minimumguthaben für Auszahlungen."); define('PRIMERA_ADMIN_MIN_WITHDRAW', "Minimumguthaben für Einzahlungen."); define('PRIMERA_ADMIN_API_NAME', "Primus-Nickname"); define('PRIMERA_ADMIN_API_MD5', "Primera-Passwort (Wird als MD5-Hash gespeichert)"); +define('PRIMERA_ADMIN_API_REFID', "Primus-Referal-ID (???)"); define('PRIMERA_ADMIN_CONFIG_NOTE', "Hier können Sie sich ein Primus-Portal-Account holen. Geben Sie immer Ihren Usernamen von Primus-Portal ein und überprüfen Sie diesen mehrmals! Er wird zum Überweisen von Primera benötigt."); define('PRIMERA_ADMIN_NO_TRANSFERS', "Derzeit keine Primera transferiert!"); define('PRIMERA_ADMIN_ACCOUNT', "Account bei Primus-Portal"); diff --git a/inc/language/surfbar_de.php b/inc/language/surfbar_de.php index a44d1df10f..2f865c0bd8 100644 --- a/inc/language/surfbar_de.php +++ b/inc/language/surfbar_de.php @@ -58,7 +58,8 @@ define('ADMIN_CONFIG_SURFBAR_PAUSE_MODE', "Auf welche Seite soll umgeleitet werd define('ADMIN_CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', "Auf interne Pausenseite umleiten."); define('ADMIN_CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', "Auf externe Seite umleiten.
(Bitte angeben)"); define('ADMIN_CONFIG_SURFBAR_PAUSE_URL', "Externe Pausenseite: (leer lassen, wenn auf interne umgeleitet werden soll)"); -define('ADMIN_CONFIG_SURFBAR_NOTIFY_LIMITS', "Soll das Mitglied per Mail benachrichtigt werden, wenn aufrufbegrenzte URLs abgelaufen und auf "pausierend" gesetzt sind?"); +define('ADMIN_CONFIG_SURFBAR_NOTIFY_LIMITS', "Soll das Mitglied per Mail benachrichtigt werden, wenn aufrufbegrenzte URLs abgelaufen und auf "pausierend" gesetzt sind? (Derzeit nicht verwendet!)"); +define('ADMIN_CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK', "Soll der Administrator auch bei durch ihn freigegebene URLs benachrichtigt werden?"); define('ADMIN_CONFIG_SURFBAR_WARN_LOW_POINTS', "Mitglied warnen, wenn {!POINTS!}-Guthaben unterschritten ist: (0=keine Warnung aussenden)"); define('ADMIN_CONFIG_SURFBAR_MIGRATE_ORDER', "Sollen URLs aus Mailfreischaltungen in die Surfbar migriert werden? (Diese sind nicht sofort freigegeben)"); define('ADMIN_CONFIG_SURFBAR_LOW_INTERVAL', "Wiederholungsinterval für Nachrichten wegen niedrigem {!POINTS!}-Guthaben:"); diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index b4ca1c90e7..c4e0045a01 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -87,7 +87,7 @@ function ADMINS_CHECK_ACL($act, $wht) { } if ($lines == 1) { // Count cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } break; } } diff --git a/inc/libs/beg_functions.php b/inc/libs/beg_functions.php index 8ab5bf13a1..04db5702d1 100644 --- a/inc/libs/beg_functions.php +++ b/inc/libs/beg_functions.php @@ -43,23 +43,23 @@ function BEG_ADD_POINTS ($uid, $points) { // Set mode depending on how many mails the member has to confirm $locked = false; - if (($_CONFIG['ref_payout'] > 0) && ($_CONFIG['allow_direct_pay'] == "N")) $locked = true; + if ((getConfig('ref_payout') > 0) && (getConfig('allow_direct_pay') == "N")) $locked = true; // Is begging rallye active? - if ($_CONFIG['beg_rallye'] == "Y") { + if (getConfig('beg_rallye') == "Y") { // Add points to rallye account SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET beg_points=beg_points+%s WHERE userid=%s LIMIT 1", array($points, $uid), __FILE__, __LINE__); } else { // Add points to account unset($DEPTH); - ADD_POINTS_REFSYSTEM("beg", $uid, $points, false, "0", $locked, strtolower($_CONFIG['beg_mode'])); + ADD_POINTS_REFSYSTEM("beg", $uid, $points, false, "0", $locked, strtolower(getConfig('beg_mode'))); } // Subtract begged points from member account if the admin has selected one - if ($_CONFIG['beg_uid'] > 0) { + if (getConfig('beg_uid') > 0) { // Subtract from this account - SUB_POINTS("beg_payout", $_CONFIG['beg_uid'], $points); + SUB_POINTS("beg_payout", getConfig('beg_uid'), $points); } // END - if } diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index eefd9e30c7..a4fdf06ce5 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -42,7 +42,7 @@ function BONUS_ADD_TURBO_POINTS($mid, $uid, $type) { global $_CONFIG; // Shall we add bonus points? - if ($_CONFIG['bonus_active'] == "N") return false; + if (getConfig('bonus_active') == "N") return false; // Init variables $SQL = ""; $bonys = 0; $mail = 0; $column = ""; @@ -87,10 +87,10 @@ function BONUS_ADD_TURBO_POINTS($mid, $uid, $type) { // Which rank? if ($rank == 1) { // First rank! - $points = $_CONFIG['turbo_bonus']; + $points = getConfig('turbo_bonus'); } else { // Anything else so let's explode all entered rank points - $test = explode(";", $_CONFIG['turbo_rates']); + $test = explode(";", getConfig('turbo_rates')); if (!empty($test[$rank - 2])) { // Level found $points = $test[$rank - 2]; @@ -108,7 +108,7 @@ function BONUS_ADD_TURBO_POINTS($mid, $uid, $type) { $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_bonus_turbo (userid, mail_id, bonus_id, level, points, timemark) VALUES ('%s', '%s', '%s', '%s', '%s', UNIX_TIMESTAMP())", array(bigintval($uid), bigintval($mail), bigintval($bonus), $rank, $points), __FILE__, __LINE__); - if ((GET_EXT_VERSION("bonus") >= "0.3.5") && ($_CONFIG['bonus_mode'] != "ADD") && ($points > 0)) BONUS_POINTS_HANDLER($points); + if ((GET_EXT_VERSION("bonus") >= "0.3.5") && (getConfig('bonus_mode') != "ADD") && ($points > 0)) BONUS_POINTS_HANDLER($points); } // function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) { @@ -116,7 +116,7 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) { $self = false; $OUT = ""; // How many ranks do we have? - $ranks = sizeof(explode(";", $_CONFIG['turbo_rates'])) + 1; + $ranks = sizeof(explode(";", getConfig('turbo_rates'))) + 1; // Load current user's data $result = SQL_QUERY_ESC("SELECT level, points, timemark FROM "._MYSQL_PREFIX."_bonus_turbo WHERE %s=%s AND userid=%s LIMIT 1", @@ -139,7 +139,7 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) { // Load rankings $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_bonus_turbo WHERE %s=%s ORDER BY level LIMIT %s", - array($type, $data, $_CONFIG['bonus_lines']), __FILE__, __LINE__); + array($type, $data, getConfig('bonus_lines')), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Start generating the ranking list $max = SQL_NUMROWS($result); @@ -187,49 +187,49 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) { return $OUT; } // -function BONUS_POINTS_HANDLER($MODE) { +function BONUS_POINTS_HANDLER ($MODE) { global $_CONFIG; // Shall we add bonus points? - if ($_CONFIG['bonus_active'] == "N") return; + if (getConfig('bonus_active') == "N") return; // Switch to jackpot-mode when no UID is supplied but userid-mode is selected - if (($_CONFIG['bonus_mode'] == "UID") && ($_CONFIG['bonus_uid'] == "0")) { + if ((getConfig('bonus_mode') == "UID") && (getConfig('bonus_uid') == "0")) { // Update database UPDATE_CONFIG(array('bonus_mode'), array("JACKPOT")); // Update configuration - $_CONFIG['bonus_mode'] = "JACKPOT"; + getConfig('bonus_mode') = "JACKPOT"; } // END - if if ($MODE == "login_bonus") { // Login bonus detected - $points = $_CONFIG['login_bonus']; + $points = getConfig('login_bonus'); } else { // Direct points supplied $points = $MODE; } // Subtract points from... - switch ($_CONFIG['bonus_mode']) + switch (getConfig('bonus_mode')) { case "JACKPOT": // ... jackpot - if ((SUB_JACKPOT($points) == -1) && ($_CONFIG['bonus_uid'] > 0)) { + if ((SUB_JACKPOT($points) == -1) && (getConfig('bonus_uid') > 0)) { // Check points amount first... - $TOTAL = GET_TOTAL_DATA($_CONFIG['bonus_uid'], "user_points", "points") - GET_TOTAL_DATA($_CONFIG['bonus_uid'], "user_data", "used_points"); + $TOTAL = GET_TOTAL_DATA(getConfig('bonus_uid'), "user_points", "points") - GET_TOTAL_DATA(getConfig('bonus_uid'), "user_data", "used_points"); if ($TOTAL >= $points) { // Subtract points from userid's account - SUB_POINTS("bonus_payout_jackpot", $_CONFIG['bonus_uid'], $points); + SUB_POINTS("bonus_payout_jackpot", getConfig('bonus_uid'), $points); } // END - if } // END - if break; case "UID": // ... userid's account // Check his amount first - $TOTAL = GET_TOTAL_DATA($_CONFIG['bonus_uid'], "user_points", "points") - GET_TOTAL_DATA($_CONFIG['bonus_uid'], "user_data", "used_points"); + $TOTAL = GET_TOTAL_DATA(getConfig('bonus_uid'), "user_points", "points") - GET_TOTAL_DATA(getConfig('bonus_uid'), "user_data", "used_points"); if ($TOTAL >= $points) { // Subtract points from userid's account - SUB_POINTS("bonus_payout_uid", $_CONFIG['bonus_uid'], $points); + SUB_POINTS("bonus_payout_uid", getConfig('bonus_uid'), $points); } else { // Try to subtract from jackpot $dummy = SUB_JACKPOT($points); @@ -243,7 +243,7 @@ function BONUS_PURGE_EXPIRED_TURBO_BONUS() global $_CONFIG; // Remove entries - $result = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_bonus_turbo WHERE timemark < (UNIX_TIMESTAMP() - ".$_CONFIG['bonus_timeout'].")", __FILE__, __LINE__); + $result = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_bonus_turbo WHERE timemark < (UNIX_TIMESTAMP() - ".getConfig('bonus_timeout').")", __FILE__, __LINE__); if (SQL_AFFECTEDROWS() > 0) { // Send out email to admin SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_TURBO_SUBJECT, "admin_autopurge_turbo", SQL_AFFECTEDROWS(), ""); diff --git a/inc/libs/doubler_functions.php b/inc/libs/doubler_functions.php index 3c44736a4c..d2476e7927 100644 --- a/inc/libs/doubler_functions.php +++ b/inc/libs/doubler_functions.php @@ -38,39 +38,30 @@ if (!defined('__SECURITY')) { } // -function DOUBLER_GENERATE_TABLE($uid="0", $done='N', $ref='N', $sort="ASC") -{ +function DOUBLER_GENERATE_TABLE($uid="0", $done='N', $ref='N', $sort="ASC") { global $_CONFIG; if (empty($cnt)) $cnt = 0; $ADD = ""; $DT_MODE = 0; - if ($uid > 0) - { + if ($uid > 0) { // Load entries only from a single user $ADD = " AND userid='".bigintval($uid)."'"; $MODE = "member"; $COLS = "4"; $DT_MODE = "2"; $NOT_FOUND = DOUBLER_MEMBER_NO_ENTRIES_FOUND; - } - else - { + } else { // Guest mode! $MODE = "guest"; $COLS = "3"; $DT_MODE = "3"; $NOT_FOUND = DOUBLER_GUEST_NO_ENTRIES_FOUND; } - if (($done == "Y") && ($sort == "ASC")) - { + if (($done == "Y") && ($sort == "ASC")) { // Already payed out points (latest payouts first) - $limit = $_CONFIG['doubler_display_old']; - } - elseif ($sort == "ASC") - { + $limit = getConfig('doubler_display_old'); + } elseif ($sort == "ASC") { // List entries which will receive their payout soon - $limit = $_CONFIG['doubler_display_pay']; - } - elseif ($sort == "DESC") - { + $limit = getConfig('doubler_display_pay'); + } elseif ($sort == "DESC") { // Newest entries - $limit = $_CONFIG['doubler_display_new']; + $limit = getConfig('doubler_display_new'); } // List entries @@ -80,14 +71,11 @@ WHERE completed='".$done."' AND is_ref='".$ref."'".$ADD." ORDER BY timemark ".$sort." LIMIT ".$limit, __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) - { + if (SQL_NUMROWS($result) > 0) { // List entries $OUT = ""; $SW = 2; - while(list($uid, $rid, $points, $time) = SQL_FETCHROW($result)) - { - if (IS_ADMIN()) - { + while(list($uid, $rid, $points, $time) = SQL_FETCHROW($result)) { + if (IS_ADMIN()) { // Set links to admin area if ($uid > 0) { $uid = ADMIN_USER_PROFILE_LINK($uid); } else { $uid = "---"; } if ($rid > 0) { $rid = ADMIN_USER_PROFILE_LINK($rid); } else { $rid = "---"; } @@ -109,9 +97,7 @@ LIMIT ".$limit, __FILE__, __LINE__); // Free memory SQL_FREERESULT($result); - } - else - { + } else { // List no entries $OUT = "
@@ -123,21 +109,18 @@ LIMIT ".$limit, __FILE__, __LINE__); // Return template return LOAD_TEMPLATE($MODE."_doubler_list", true, $OUT); } + // -function DOUBLER_GET_TOTAL_POINTS_LEFT() -{ - global $_CONFIG; +function DOUBLER_GET_TOTAL_POINTS_LEFT() { // Initialize variables $points = 0; - if ($_CONFIG['doubler_own'] == "Y") - { + if (getConfig('doubler_own') == "Y") { // Take points from doubler's own account - $points += $_CONFIG['doubler_points'] - $_CONFIG['doubler_used']; + $points += getConfig('doubler_points') - getConfig('doubler_used'); } - if ($_CONFIG['doubler_jackpot'] == "Y") - { + if (getConfig('doubler_jackpot') == "Y") { // Load jackpot $result = SQL_QUERY("SELECT points FROM "._MYSQL_PREFIX."_jackpot WHERE ok='ok' LIMIT 1", __FILE__, __LINE__); list($jackpot) = SQL_FETCHROW($result); @@ -146,10 +129,9 @@ function DOUBLER_GET_TOTAL_POINTS_LEFT() if (!empty($jackpot)) $points += $jackpot; } - if ($_CONFIG['doubler_uid'] > 0) - { + if (getConfig('doubler_uid') > 0) { // Get user's points - $user = GET_TOTAL_DATA($_CONFIG['doubler_uid'], "user_points", "points"); + $user = GET_TOTAL_DATA(getConfig('doubler_uid'), "user_points", "points"); $points += $user; } diff --git a/inc/libs/primera_functions.php b/inc/libs/primera_functions.php index 1d19c960a7..3a1cff07a0 100644 --- a/inc/libs/primera_functions.php +++ b/inc/libs/primera_functions.php @@ -269,7 +269,7 @@ function PRIMERA_EXECUTE_PAYOUT ($primusNick, $userMd5, $amount) { global $_CONFIG; // Get new instance - $api = new PrimeraApi($_CONFIG['primera_api_name'], $_CONFIG['primera_api_md5']); + $api = new PrimeraApi(getConfig('primera_api_name'), getConfig('primera_api_md5')); // Prepare purpose $eval = "\$purpose = \"".COMPILE_CODE(sprintf(PRIMERA_API_PURPOSE_PAYOUT, $GLOBALS['userid']))."\";"; diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index f72721af37..ec2af80dbd 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -103,7 +103,7 @@ FROM "._MYSQL_PREFIX."_user_points AS p LEFT JOIN `"._MYSQL_PREFIX."_user_data` AS d ON p.userid=d.userid WHERE d.status='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p.ref_depth=1 AND p.points > 0 AND d.userid=%s", - array($_CONFIG['ref_payout'], bigintval($uid)), __FILE__, __LINE__); + array(getConfig('ref_payout'), bigintval($uid)), __FILE__, __LINE__); list($cpoints) = SQL_FETCHROW($result_ref); SQL_FREERESULT($result_ref); @@ -216,7 +216,7 @@ WHERE u.rallye_id=%s AND r.counter > 0 ORDER BY u.refs DESC", LEFT JOIN `"._MYSQL_PREFIX."_user_data` AS d ON p.userid=d.userid WHERE d.userid=%s AND d.status='CONFIRMED' AND p.ref_depth=1 AND d.max_mails > 0 AND d.mails_confirmed >= %s -LIMIT 1", array(bigintval($uid), $_CONFIG['ref_payout']), __FILE__, __LINE__); +LIMIT 1", array(bigintval($uid), getConfig('ref_payout')), __FILE__, __LINE__); list($refpoints) = SQL_FETCHROW($result_ref); SQL_FREERESULT($result_ref); @@ -519,7 +519,7 @@ function RALLYE_LOAD_USERS_ARRAY($rallye) global $_CONFIG; // Fix zero points to 0.00000 - if ($_CONFIG['ref_payout'] == "0") $_CONFIG['ref_payout'] = "0.00000"; + if (getConfig('ref_payout') == "0") getConfig('ref_payout') = "0.00000"; // Init multi array $users = array( @@ -542,7 +542,7 @@ FROM "._MYSQL_PREFIX."_user_points AS p LEFT JOIN `"._MYSQL_PREFIX."_user_data` AS d ON p.userid=d.userid WHERE d.status='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p.ref_depth=1 AND p.points > 0 AND d.userid=%s", - array($_CONFIG['ref_payout'], bigintval($uid)), __FILE__, __LINE__); + array(getConfig('ref_payout'), bigintval($uid)), __FILE__, __LINE__); list($refpoints) = SQL_FETCHROW($result_ref); SQL_FREERESULT($result_ref); @@ -653,7 +653,7 @@ function RALLYE_DELETE_EXPIRED_RALLYES() global $DATA, $_CONFIG; // Check for expired rallyes - $EXPIRE = $_CONFIG['one_day'] * 3; // @TODO The hard-coded value... + $EXPIRE = getConfig('one_day') * 3; // @TODO The hard-coded value... $result_rallye = SQL_QUERY_ESC("SELECT id, title, start_time, end_time FROM "._MYSQL_PREFIX."_rallye_data WHERE end_time <= (UNIX_TIMESTAMP() - %s) AND expired='Y'", @@ -773,7 +773,7 @@ function RALLYE_GET_REFCOUNT($uid, $old=0) { if ($cnt > 0) { // Count cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } // Remove old refs //* DEBUG: */ echo "+".$cnt."/".$old."+
"; diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php index f90e1b8d30..93623b45ea 100644 --- a/inc/libs/register_functions.php +++ b/inc/libs/register_functions.php @@ -131,7 +131,7 @@ function REGISTER_ADD_CATEGORY_TABLE ($MODE, $return=false) 'id' => $id, ); - if (($_POST['cat'][$id] == "Y") || (($_CONFIG['register_default'] == "Y") && (empty($_POST['cat'][$id])))) { + if (($_POST['cat'][$id] == "Y") || ((getConfig('register_default') == "Y") && (empty($_POST['cat'][$id])))) { $content['def_y'] = " checked=\"checked\""; } else { $content['def_n'] = " checked=\"checked\""; diff --git a/inc/libs/removeip_functions.php b/inc/libs/removeip_functions.php index 8965fbdd71..e3b69e9e8b 100644 --- a/inc/libs/removeip_functions.php +++ b/inc/libs/removeip_functions.php @@ -39,15 +39,13 @@ if (!defined('__SECURITY')) { // "Getter" for anonymous remote IP number function GET_ANONYMOUS_REMOTE_ADDR ($remoteAddr) { - global $_CONFIG; - // Is config enabled? - if ($_CONFIG['removeip_anon_ip'] == "Y") { + if (getConfig('removeip_anon_ip') == "Y") { // Switch way do we like? - switch ($_CONFIG['anonymous_ip']) { + switch (getConfig('anonymous_ip')) { case "127.0.0.1": // mod_removeip style case "0.0.0.0": // Some people may prefer this... - $remoteAddr = $_CONFIG['anonymous_ip']; + $remoteAddr = getConfig('anonymous_ip'); break; case "RANDOM": // Pseudo-random IP number @@ -61,10 +59,8 @@ function GET_ANONYMOUS_REMOTE_ADDR ($remoteAddr) { } // "Getter" for anonymous remote hostname function GET_ANONYMOUS_REMOTE_HOST ($remoteHost) { - global $_CONFIG; - // Is config enabled? - if ($_CONFIG['removeip_anon_host'] == "Y") { + if (getConfig('removeip_anon_host') == "Y") { // Set anon hostname $remoteHost = "localhost.localnet"; } // END - if @@ -74,10 +70,8 @@ function GET_ANONYMOUS_REMOTE_HOST ($remoteHost) { } // "Getter" for anonymous user agent function GET_ANONYMOUS_USER_AGENT ($userAgent) { - global $_CONFIG; - // Is config enabled? - if ($_CONFIG['removeip_anon_ua'] == "Y") { + if (getConfig('removeip_anon_ua') == "Y") { // Set anon user agent $userAgent = "-"; } // END - if @@ -87,10 +81,8 @@ function GET_ANONYMOUS_USER_AGENT ($userAgent) { } // "Getter" for anonymous referer function GET_ANONYMOUS_REFERER ($referer) { - global $_CONFIG; - // Is config enabled? - if ($_CONFIG['removeip_anon_ref'] == "Y") { + if (getConfig('removeip_anon_ref') == "Y") { // Set anon user agent $referer = "-"; } // END - if @@ -100,16 +92,14 @@ function GET_ANONYMOUS_REFERER ($referer) { } // Adds informations about anonymity/privacy to the menu function REMOVEIP_ADD_INFOS () { - global $_CONFIG; - // "Base-privacy" is by default low (we add more later) $anonymity = 0; // Is some data anonymized? - if ($_CONFIG['removeip_anon_ip'] == "Y") $anonymity++; - if ($_CONFIG['removeip_anon_host'] == "Y") $anonymity++; - if ($_CONFIG['removeip_anon_ua'] == "Y") $anonymity++; - if ($_CONFIG['removeip_anon_ref'] == "Y") $anonymity++; + if (getConfig('removeip_anon_ip') == "Y") $anonymity++; + if (getConfig('removeip_anon_host') == "Y") $anonymity++; + if (getConfig('removeip_anon_ua') == "Y") $anonymity++; + if (getConfig('removeip_anon_ref') == "Y") $anonymity++; // Calculate anonymity level $level = round($anonymity / 4 * 3); diff --git a/inc/libs/rewrite_functions.php b/inc/libs/rewrite_functions.php index 13f9a3b486..5a1929e6a2 100644 --- a/inc/libs/rewrite_functions.php +++ b/inc/libs/rewrite_functions.php @@ -38,12 +38,11 @@ if (!defined('__SECURITY')) { } // -function REWRITE_LINKS($HTML) -{ +function REWRITE_LINKS ($HTML) { global $_CONFIG; // Skip rewriting for the admin area (which search engine may enter here???) - if (ereg($GLOBALS['module'], $_CONFIG['rewrite_skip'])) return $HTML; + if (ereg($GLOBALS['module'], getConfig('rewrite_skip'))) return $HTML; // Strip slashes with double-backslashes for the preg_replace() function $URL = str_replace("/", "\\/", URL); @@ -54,12 +53,11 @@ function REWRITE_LINKS($HTML) // Convert modules.php?module=... $test = preg_replace("/".$URL."\\/modules.php\\?module=/i", $target, $HTML); - if (eregi(SERVER_URL, $test)) - { + if (eregi(SERVER_URL, $test)) { // Konvert URLs from my server $URL = str_replace("/", "\\/", SERVER_URL); $test = preg_replace("/".$URL."\\/modules.php\\?module=/i", SERVER_URL."/cms/", $test); - } + } // END - if // Strip slashes as above for the main URL $target2 = str_replace("/", "\\/", $target); @@ -75,17 +73,15 @@ function REWRITE_LINKS($HTML) $target2 = str_replace("/", "\\/", $target); $test = preg_replace("/".$target2."(.*)&what=/i", $wht, $test); - if ((EXT_IS_ACTIVE("rallye")) && (eregi("rallye=", $test))) - { + if ((EXT_IS_ACTIVE("rallye")) && (eregi("rallye=", $test))) { // Replace data when rallye extension is active // Add more if you need more like these entries $REPLACE = array("rallye", "activate", "auto", "notify", "sub"); - foreach ($REPLACE as $var) - { + foreach ($REPLACE as $var) { // This will replace "&var=" to "/var/" $test = preg_replace("/&".$var."=/i", "/".$var."/", $test); - } - } + } // END - foreach + } // END - if // Simple from->to replacements $REPLACE = array( @@ -93,28 +89,24 @@ function REWRITE_LINKS($HTML) 'replace' => array("u" , "url", "page", "offset", "m" , "b" , "s" , "h") ); - if ((EXT_IS_ACTIVE("admins")) && (eregi("admin=", $test))) - { + if ((EXT_IS_ACTIVE("admins")) && (eregi("admin=", $test))) { // Replace &admin= with "/aid/" $REPLACE['search'][] = "admin"; $REPLACE['replace'][] = "aid"; - } + } // END - if // Replace all array elements through - foreach ($REPLACE['search'] as $k => $v) - { - if (eregi("$v=", $test)) - { + foreach ($REPLACE['search'] as $k => $v) { + if (eregi("$v=", $test)) { // Replace &u_id= with /u/ $test = preg_replace("/&".$v."=/i", "/".$REPLACE['replace'][$k]."/", $test); - } - } + } // END - if + } // END - foreach // Repair missed &what=??? entries - while (preg_match("/&what=(.*)\/(.*)\/(.*)/i", $test)) - { + while (preg_match("/&what=(.*)\/(.*)\/(.*)/i", $test)) { $test = preg_replace("/&what=(.*)\/(.*)\/(.*)/i", "/wht/\$1/\$2/\$3", $test); - } + } // END - while // Return rewritten code return $test; diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index 5c511f85a6..b0deed1830 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -445,7 +445,7 @@ function UPDATE_SPONSOR_LOGIN() // Calculate cookie lifetime, maybe we have to change this so the admin can setup a // seperate timeout for these two cookies? - $life = (time() + $_CONFIG['online_timeout']); + $life = (time() + getConfig('online_timeout')); // Is confirmed so both is fine and we can continue with login procedure $login = ((setcookie("sponsorid" , bigintval($_COOKIE['sponsorid']), $life, COOKIE_PATH)) && diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 9cc7e7e995..434ce4f15c 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -246,7 +246,7 @@ function SURFBAR_MEMBER_DO_FORM ($formData, $URLs) { $URLs[$formData['id']]['new_status'] = $SURFBAR_CACHE['new_status']; // Extract URL data for call-back - $urlData = array(array_merge($URLs[$formData['id']], array($action => $formData))); + $urlData = array(merge_array($URLs[$formData['id']], array($action => $formData))); // Action found so execute it $performed = call_user_func_array($functionName, $urlData); @@ -485,19 +485,19 @@ function SURFBAR_HANDLE_LOW_POINTS () { global $_CONFIG; // Get all userids - $UIDs = SURFBAR_DETERMINE_DEPLETED_USERIDS($_CONFIG['surfbar_warn_low_points']); + $UIDs = SURFBAR_DETERMINE_DEPLETED_USERIDS(getConfig('surfbar_warn_low_points')); // "Walk" through all URLs foreach ($UIDs['uid'] as $uid => $dummy) { // Is the last notification far enougth away to notify again? - if ((time() - $UIDs['notified'][$uid]) >= $_CONFIG['surfbar_low_interval']) { + if ((time() - $UIDs['notified'][$uid]) >= getConfig('surfbar_low_interval')) { // Prepare content $content = array( 'uid' => $uid, - 'low' => TRANSLATE_COMMA($_CONFIG['surfbar_warn_low_points']), + 'low' => TRANSLATE_COMMA(getConfig('surfbar_warn_low_points')), 'points' => TRANSLATE_COMMA($UIDs['points'][$uid]), 'notified' => MAKE_DATETIME($UIDs['notified'][$uid]), - 'interval' => CREATE_FANCY_TIME($_CONFIG['surfbar_low_interval']) + 'interval' => CREATE_FANCY_TIME(getConfig('surfbar_low_interval')) ); // Notify this user @@ -578,7 +578,7 @@ function SURFBAR_REGISTER_URL ($url, $uid, $status="PENDING", $addMode="reg", $e if ($addMode == "reg") $status = "PENDING"; // Prepare content - $content = array_merge($extraFields, array( + $content = merge_array($extraFields, array( 'url' => $url, 'frametester' => FRAMETESTER($url), 'uid' => $uid, @@ -602,7 +602,7 @@ function SURFBAR_REGISTER_URL ($url, $uid, $status="PENDING", $addMode="reg", $e $content['limit'] = SURFBAR_TRANSLATE_LIMIT($content['limit']); // If in reg-mode we notify admin - if (($addMode == "reg") || ($_CONFIG['surfbar_notify_admin_unlock'] == "Y")) { + if (($addMode == "reg") || (getConfig('surfbar_notify_admin_unlock') == "Y")) { // Notify admin even when he as unlocked an email SURFBAR_NOTIFY_ADMIN("url_{$addMode}", $content); } // END - if @@ -742,10 +742,10 @@ function SURFBAR_DETERMINE_REWARD ($onlyMin=false) { global $_CONFIG; // Static values are default - $reward = $_CONFIG['surfbar_static_reward']; + $reward = getConfig('surfbar_static_reward'); // Do we have static or dynamic? - if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") { + if (getConfig('surfbar_pay_model') == "DYNAMIC") { // "Calculate" dynamic reward if ($onlyMin) { $reward += SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE(); @@ -762,10 +762,10 @@ function SURFBAR_DETERMINE_COSTS ($onlyMin=false) { global $_CONFIG; // Static costs is default - $costs = $_CONFIG['surfbar_static_costs']; + $costs = getConfig('surfbar_static_costs'); // Do we have static or dynamic? - if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") { + if (getConfig('surfbar_pay_model') == "DYNAMIC") { // "Calculate" dynamic costs if ($onlyMin) { $costs += SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE(); @@ -811,11 +811,11 @@ function SURFBAR_CHECK_RELOAD_FULL() { $isFull = true; // Cache static reload lock - $SURFBAR_CACHE['surf_lock'] = $_CONFIG['surfbar_static_lock']; - //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "Fixed surf lock is ".$_CONFIG['surfbar_static_lock']."", false); + $SURFBAR_CACHE['surf_lock'] = getConfig('surfbar_static_lock'); + //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "Fixed surf lock is ".getConfig('surfbar_static_lock')."", false); // Do we have dynamic model? - if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") { + if (getConfig('surfbar_pay_model') == "DYNAMIC") { // "Calculate" dynamic lock $SURFBAR_CACHE['surf_lock'] += SURFBAR_CALCULATE_DYNAMIC_ADD(); } // END - if @@ -883,7 +883,7 @@ function SURFBAR_IF_USER_BOOK_MORE_URLS ($uid=0) { global $_CONFIG; // Is this admin and userid is zero or does the user has some URLs left to book? - return ((($uid == 0) && (IS_ADMIN())) || (SURFBAR_GET_TOTAL_USER_URLS($uid, "", array("REJECTED")) < $_CONFIG['surfbar_max_order'])); + return ((($uid == 0) && (IS_ADMIN())) || (SURFBAR_GET_TOTAL_USER_URLS($uid, "", array("REJECTED")) < getConfig('surfbar_max_order'))); } // Get total amount of URLs of given status for current user function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="",$exclude="") { @@ -895,7 +895,7 @@ function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="",$exclude="") { $uid = $GLOBALS['userid']; } elseif ($uid == 0) { // Error! - return ($_CONFIG['surfbar_max_order'] + 1); + return (getConfig('surfbar_max_order') + 1); } // Default is all URLs @@ -921,7 +921,7 @@ function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="",$exclude="") { FROM "._MYSQL_PREFIX."_surfbar_urls WHERE userid=%s".$ADD." LIMIT %s", - array($uid, $_CONFIG['surfbar_max_order']), __FILE__, __LINE__ + array($uid, getConfig('surfbar_max_order')), __FILE__, __LINE__ ); // Fetch row @@ -941,7 +941,7 @@ function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt="") { $SURFBAR_CACHE['salt'] = "INVALID"; // Get code length from config - $length = $_CONFIG['code_length']; + $length = getConfig('code_length'); // Fix length to 10 if ($length == 0) $length = 10; @@ -1009,12 +1009,12 @@ function SURFBAR_PAY_POINTS () { // Remove it from the URL owner //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "uid=".SURFBAR_GET_USERID().",costs=".SURFBAR_GET_COSTS()."", false); if (SURFBAR_GET_USERID() > 0) { - SUB_POINTS(sprintf("surfbar_%s", $_CONFIG['surfbar_pay_model']), SURFBAR_GET_USERID(), SURFBAR_GET_COSTS()); + SUB_POINTS(sprintf("surfbar_%s", getConfig('surfbar_pay_model')), SURFBAR_GET_USERID(), SURFBAR_GET_COSTS()); } // END - if // Book it to the user //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "uid=".$GLOBALS['userid'].",reward=".SURFBAR_GET_REWARD()."", false); - ADD_POINTS_REFSYSTEM(sprintf("surfbar_%s", $_CONFIG['surfbar_pay_model']), $GLOBALS['userid'], SURFBAR_GET_DATA('reward')); + ADD_POINTS_REFSYSTEM(sprintf("surfbar_%s", getConfig('surfbar_pay_model')), $GLOBALS['userid'], SURFBAR_GET_DATA('reward')); } // Updates the statistics of current URL/userid function SURFBAR_UPDATE_INSERT_STATS_RECORD () { @@ -1173,7 +1173,7 @@ function SURFBAR_DETERMINE_TOTAL_ONLINE () { FROM "._MYSQL_PREFIX."_surfbar_stats WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(last_online)) <= %s GROUP BY userid", - array($_CONFIG['online_timeout']), __FILE__, __LINE__); + array(getConfig('online_timeout')), __FILE__, __LINE__); // Fetch count $cnt = SQL_NUMROWS($result); @@ -1186,8 +1186,6 @@ GROUP BY userid", } // Determine waiting time for one URL function SURFBAR_DETERMINE_WAIT_TIME () { - global $_CONFIG; - // Get fixed reload lock $fixed = SURFBAR_GET_FIXED_RELOAD(); @@ -1198,10 +1196,10 @@ function SURFBAR_DETERMINE_WAIT_TIME () { } // END - if // Static time is default - $time = $_CONFIG['surfbar_static_time']; + $time = getConfig('surfbar_static_time'); // Which payment model do we have? - if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") { + if (getConfig('surfbar_pay_model') == "DYNAMIC") { // "Calculate" dynamic time $time += SURFBAR_CALCULATE_DYNAMIC_ADD(); } // END - if @@ -1250,10 +1248,10 @@ function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array()) // Prepare content for notification routines $data[$urlId]['uid'] = $data[$urlId]['userid']; $data[$urlId]['frametester'] = FRAMETESTER($data[$urlId]['url']); - $data[$urlId]['reward'] = TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']); - $data[$urlId]['costs'] = TRANSLATE_COMMA($_CONFIG['surfbar_static_costs']); + $data[$urlId]['reward'] = TRANSLATE_COMMA(getConfig('surfbar_static_reward')); + $data[$urlId]['costs'] = TRANSLATE_COMMA(getConfig('surfbar_static_costs')); - // Do some dirt fixing here: + // Do some dirty fixing here: if (($data[$urlId]['status'] == "STOPPED") && ($newStatus == "pending")) { // Fix for template change $newStatus = "continued"; @@ -1276,7 +1274,7 @@ function SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE () { $addon = 0; // Percentage part - $percent = abs(log($_CONFIG['surfbar_dynamic_percent'] / 100 + 1)); + $percent = abs(log(getConfig('surfbar_dynamic_percent') / 100 + 1)); // Get total users $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true); @@ -1314,7 +1312,7 @@ function SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE () { $max = log(2); // Percentage part - $percent = abs(log($_CONFIG['surfbar_dynamic_percent'] / 100 + 1)); + $percent = abs(log(getConfig('surfbar_dynamic_percent') / 100 + 1)); // Get total users $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true); @@ -1414,7 +1412,7 @@ WHERE sbu.userid NOT IN (".implode(",", $UIDs).") AND (sbu.views_allowed=0 OR (s GROUP BY sbu.id", __FILE__, __LINE__); // Log last query - //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "lastQuery=".$_CONFIG['db_last_query']."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."", false); + //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "lastQuery=".getConfig('db_last_query')."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."", false); // Fetch max rand $maxRand = SQL_NUMROWS($result); @@ -1477,15 +1475,13 @@ function SURFBAR_GET_ACTION_ARRAY ($status) { } // Reload to configured stop page function SURFBAR_RELOAD_TO_STOP_PAGE($page="stop") { - global $_CONFIG; - // Internal or external? - if (($_CONFIG['surfbar_pause_mode'] == "INTERNAL") || (empty($_CONFIG['surfbar_pause_url']))) { + if ((getConfig('surfbar_pause_mode') == "INTERNAL") || (getConfig('surfbar_pause_url') == "")) { // Reload to internal page LOAD_URL("surfbar.php?frame=".$page); } else { // Reload to external page - LOAD_URL($_CONFIG['surfbar_pause_url']); + LOAD_URL(getConfig('surfbar_pause_url')); } } @@ -1558,7 +1554,7 @@ LIMIT 1", } // Is there an id number? - //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "lastQuery=".$_CONFIG['db_last_query']."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."", false); + //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "lastQuery=".getConfig('db_last_query')."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."", false); if (SQL_NUMROWS($result) == 1) { // Load/cache data //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "count(".count($SURFBAR_CACHE).") - BEFORE", false); @@ -1588,7 +1584,7 @@ LIMIT 1", //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "BASE/STATIC - reward=".SURFBAR_GET_REWARD()."|costs=".SURFBAR_GET_COSTS()."", false); // Only in dynamic model add the dynamic bonus! - if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") { + if (getConfig('surfbar_pay_model') == "DYNAMIC") { // Calculate dynamic reward/costs and add it $SURFBAR_CACHE['reward'] += SURFBAR_CALCULATE_DYNAMIC_ADD(); $SURFBAR_CACHE['costs'] += SURFBAR_CALCULATE_DYNAMIC_ADD(); diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 310e222f72..b496e1df1f 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -246,16 +246,16 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) if (EXT_IS_ACTIVE("autopurge")) { // Start finding them... - $since = $_CONFIG['ap_inactive_since']; + $since = getConfig('ap_inactive_since'); $EXCLUDE_LIST = ""; - if ($_CONFIG['def_refid'] > 0) { - $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid'].""; + if (getConfig('def_refid') > 0) { + $EXCLUDE_LIST = " AND d.userid != ".getConfig('def_refid').""; } // END - if // Check for more extensions - if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['beg_uid'].""; - if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['bonus_uid'].""; - if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['doubler_uid'].""; + if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_uid').""; + if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_uid').""; + if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_uid').""; if (GET_EXT_VERSION("holiday") >= "0.1.3") $EXCLUDE_LIST .= " AND d.holiday_active='N'"; // Check for all accounts @@ -326,11 +326,11 @@ ORDER BY d.userid"; if (GET_EXT_VERSION("bonus") >= "0.6.9") { // Add more bonus points here $USE = "(0"; - if ($_CONFIG['bonus_click_yn'] == "Y") $USE .= " + turbo_bonus"; - if ($_CONFIG['bonus_login_yn'] == "Y") $USE .= " + login_bonus"; - if ($_CONFIG['bonus_order_yn'] == "Y") $USE .= " + bonus_order"; - if ($_CONFIG['bonus_stats_yn'] == "Y") $USE .= " + bonus_stats"; - if ($_CONFIG['bonus_ref_yn'] == "Y") $USE .= " + bonus_ref"; + if (getConfig('bonus_click_yn') == "Y") $USE .= " + turbo_bonus"; + if (getConfig('bonus_login_yn') == "Y") $USE .= " + login_bonus"; + if (getConfig('bonus_order_yn') == "Y") $USE .= " + bonus_order"; + if (getConfig('bonus_stats_yn') == "Y") $USE .= " + bonus_stats"; + if (getConfig('bonus_ref_yn') == "Y") $USE .= " + bonus_ref"; $USE .= ")"; } else { // Old version ??? @@ -339,9 +339,9 @@ ORDER BY d.userid"; // Autopurge installed? $LAST = ""; - if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['autopurge_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) { + if ((EXT_IS_ACTIVE("autopurge")) && (getConfig('autopurge_inactive') == "Y") && (getConfig('ap_inactive_since') > 0)) { // Use last online timestamp to keep inactive members away from here - $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']); + $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since')); } $SQLs[] = "SELECT ".$USE." AS points @@ -358,9 +358,9 @@ ORDER BY points DESC, userid"; // Autopurge installed? $LAST = ""; - if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['autopurge_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) { + if ((EXT_IS_ACTIVE("autopurge")) && (getConfig('autopurge_inactive') == "Y") && (getConfig('ap_inactive_since') > 0)) { // Use last online timestamp to keep inactive members away from here - $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']); + $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since')); } $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_data diff --git a/inc/libs/theme_functions.php b/inc/libs/theme_functions.php index 6fbcd98904..5fff9d7064 100644 --- a/inc/libs/theme_functions.php +++ b/inc/libs/theme_functions.php @@ -48,7 +48,7 @@ function GET_CURR_THEME() { $ret = "default"; // Load default theme if not empty from configuration - if (!empty($_CONFIG['default_theme'])) $ret = $_CONFIG['default_theme']; + if (getConfig('default_theme') != "") $ret = getConfig('default_theme'); if (!isSessionVariableSet('mxchange_theme')) { // Set default theme @@ -70,10 +70,10 @@ function GET_CURR_THEME() { // Installation mode active if ((!empty($_GET['theme'])) && (FILE_READABLE($theme))) { // Set cookie from URL data - set_session("mxchange_theme", $_GET['theme']); + set_session("mxchange_theme", SQL_ESCAPE($_GET['theme'])); } elseif (FILE_READABLE(sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme'])))) { // Set cookie from posted data - set_session("mxchange_theme", $_POST['theme']); + set_session("mxchange_theme", SQL_ESCAPE($_POST['theme'])); } // Set return value @@ -154,7 +154,7 @@ function THEME_GET_VERSION ($name) { $cver = $cacheArray['themes']['theme_ver'][$name]; // Count up - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (GET_EXT_VERSION("cache") != "0.1.8") { // Load version from database $result = SQL_QUERY_ESC("SELECT theme_ver FROM `"._MYSQL_PREFIX."_themes` WHERE theme_path='%s' LIMIT 1", @@ -193,7 +193,7 @@ function THEME_GET_ID ($name) { $id = $cacheArray['themes']['id'][$name]; // Count up - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (GET_EXT_VERSION("cache") != "0.1.8") { // Check if current theme is already imported or not $result = SQL_QUERY_ESC("SELECT id FROM `"._MYSQL_PREFIX."_themes` WHERE theme_path='%s' LIMIT 1", @@ -238,7 +238,7 @@ function THEME_IS_ACTIVE ($name) { $active = ($cacheArray['themes']['theme_active'][$name] == "Y"); // Count up - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (GET_EXT_VERSION("cache") != "0.1.8") { // Check if current theme is already imported or not $result = SQL_QUERY_ESC("SELECT theme_active FROM `"._MYSQL_PREFIX."_themes` WHERE theme_path='%s' AND theme_active='Y' LIMIT 1", @@ -274,7 +274,7 @@ function GET_CURR_THEME_NAME () { $name = $cacheArray['themes']['theme_name'][$name]; // Count up - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (GET_EXT_VERSION("cache") != "0.1.8") { // Check if current theme is already imported or not $result = SQL_QUERY_ESC("SELECT theme_name FROM `"._MYSQL_PREFIX."_themes` WHERE theme_path='%s' AND theme_active='Y' LIMIT 1", diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index d00650cfbd..3a385ff3ae 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -59,7 +59,7 @@ function alpha($sortby, $colspan, $return=false) { $OUT .= "&letter=".$ltr."&sortby=".$sortby.$ADD."\">".$ltr.""; } - if ((($counter / $_CONFIG['user_alpha']) == round($counter / $_CONFIG['user_alpha'])) && ($counter > 0)) { + if ((($counter / getConfig('user_alpha')) == round($counter / getConfig('user_alpha'))) && ($counter > 0)) { $OUT .= " ]
[ "; } elseif ( $counter != $num ) { $OUT .= " | "; @@ -227,7 +227,7 @@ function SELECT_RANDOM_REFID () { // Is the extension version fine? if (GET_EXT_VERSION("user") >= "0.3.4") { // Get all user ids - $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true, " AND `rand_confirmed` >= ".$_CONFIG['user_min_confirmed'].""); + $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true, " AND `rand_confirmed` >= ".getConfig('user_min_confirmed').""); // Do we have at least one? if ($totalUsers > 0) { @@ -236,7 +236,7 @@ function SELECT_RANDOM_REFID () { // Look for random user $result = SQL_QUERY_ESC("SELECT `userid` FROM `"._MYSQL_PREFIX."_user_data` WHERE `status`='CONFIRMED' AND `rand_confirmed` >= %s ORDER BY `rand_confirmed` DESC LIMIT %s, 1", - array($_CONFIG['user_min_confirmed'], $randNum), __FILE__, __LINE__); + array(getConfig('user_min_confirmed'), $randNum), __FILE__, __LINE__); // Do we have one entry there? if (SQL_NUMROWS($result) == 1) { diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index ee8a5d9958..d42c6c1ba2 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -73,8 +73,6 @@ function GET_WERNIS_ERROR_CODE () { // Sends out a request to the API and returns it's result function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) { - global $_CONFIG; - // Is the requestData an array? if (!is_array($requestData)) { // Then abort here! @@ -85,7 +83,7 @@ function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) { } // END - if // Is the API id and MD5 hash there? - if ((empty($_CONFIG['wernis_api_id'])) || (empty($_CONFIG['wernis_api_md5']))) { + if ((getConfig('wernis_api_id') == "") || (getConfig('wernis_api_md5') == "")) { // Abort here... return array( 'status' => "failed_general", @@ -94,11 +92,11 @@ function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) { } // END - if // Add more request data - $requestData['api_id'] = bigintval($_CONFIG['wernis_api_id']); - $requestData['api_key'] = $_CONFIG['wernis_api_md5']; + $requestData['api_id'] = bigintval(getConfig('wernis_api_id')); + $requestData['api_key'] = getConfig('wernis_api_md5'); // Construct the request string - $requestString = $_CONFIG['wernis_api_url'] . $scriptName; + $requestString = getConfig('wernis_api_url') . $scriptName; // Get the raw response from the lower function $response = POST_URL($requestString, $requestData); @@ -191,8 +189,7 @@ function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) { // Tests the function by calling balance.php on the API function WERNIS_TEST_API () { - // Get config first - global $_CONFIG; + // Result is always failed $result = false; // Return the result from the lower functions @@ -212,10 +209,8 @@ function WERNIS_TEST_API () { // Widthdraw this amount function WERNIS_EXECUTE_WITHDRAW ($wdsId, $userMd5, $amount) { - global $_CONFIG; - // Is the sponsor extension installed? - if ($_CONFIG['wernis_withdraw_active'] == "N") { + if (getConfig('wernis_withdraw_active') == "N") { if (!EXT_IS_ACTIVE("sponsor")) { // No, abort here return false; @@ -237,7 +232,7 @@ function WERNIS_EXECUTE_WITHDRAW ($wdsId, $userMd5, $amount) { 'sub_request' => "receive", 't_uid' => bigintval($wdsId), 't_md5' => $userMd5, - 'r_uid' => $_CONFIG['wernis_refid'], + 'r_uid' => getConfig('wernis_refid'), 'amount' => bigintval($amount), 'purpose' => urlencode(base64_encode($purpose)) ); @@ -278,7 +273,7 @@ function WERNIS_EXECUTE_PAYOUT ($wdsId, $amount) { // Prepare the request data $requestData = array( 'sub_request' => "send", - 't_uid' => $_CONFIG['wernis_refid'], + 't_uid' => getConfig('wernis_refid'), 't_md5' => $_CONFIG['wernis_pass_md5'], 'r_uid' => bigintval($wdsId), 'amount' => bigintval($amount), @@ -337,8 +332,6 @@ function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = "", // Take fees and factor function WERNIS_TAKE_FEE ($points, $mode) { - global $_CONFIG; - // Payout or withdraw are allowed modes! //* DEBUG: */ echo "mode={$mode},points={$points}
\n"; if (!in_array($mode, array('payout', 'withdraw'))) { @@ -348,21 +341,21 @@ function WERNIS_TAKE_FEE ($points, $mode) { } // END - if // Is there a percentage or fixed fee? - if ($_CONFIG['wernis_'.$mode.'_fee_percent'] > 0) { + if (getConfig('wernis_'.$mode.'_fee_percent') > 0) { // Percentage fee - $points -= $points * $_CONFIG['wernis_'.$mode.'_fee_percent'] / 100; - } elseif ($_CONFIG['wernis_'.$mode.'_fee_fix'] > 0) { + $points -= $points * getConfig('wernis_'.$mode.'_fee_percent') / 100; + } elseif (getConfig('wernis_'.$mode.'_fee_fix') > 0) { // Fixed fee - $points -= $_CONFIG['wernis_'.$mode.'_fee_fix']; + $points -= getConfig('wernis_'.$mode.'_fee_fix'); } // Divide/multiply the factor if ($mode == "payout") { // Divide for payout - $points = $points / $_CONFIG['wernis_payout_factor']; + $points = $points / getConfig('wernis_payout_factor'); } else { // Multiply for withdraw - $points = $points * $_CONFIG['wernis_withdraw_factor']; + $points = $points * getConfig('wernis_withdraw_factor'); } // Return value @@ -372,15 +365,13 @@ function WERNIS_TAKE_FEE ($points, $mode) { // Add withdraw fees and factor function WERNIS_ADD_WITHDRAW_FEE ($points) { - global $_CONFIG; - // Is there a percentage or fixed fee? - if ($_CONFIG['wernis_withdraw_fee_percent'] > 0) { + if (getConfig('wernis_withdraw_fee_percent') > 0) { // Percentage fee - $points += $points * $_CONFIG['wernis_withdraw_fee_percent'] / 100; - } elseif ($_CONFIG['wernis_withdraw_fee_fix'] > 0) { + $points += $points * getConfig('wernis_withdraw_fee_percent') / 100; + } elseif (getConfig('wernis_withdraw_fee_fix') > 0) { // Fixed fee - $points += $_CONFIG['wernis_withdraw_fee_fix']; + $points += getConfig('wernis_withdraw_fee_fix'); } // Return value @@ -389,8 +380,6 @@ function WERNIS_ADD_WITHDRAW_FEE ($points) { // Add all fees to the array function WERNIS_ADD_FEES_TO_ARRAY (&$array) { - global $_CONFIG; - // Is the array an array? ;-) if (!is_array($array)) { // Log error and return @@ -399,14 +388,14 @@ function WERNIS_ADD_FEES_TO_ARRAY (&$array) { } // END - if // Add both factors - $array['payout_factor'] = TRANSLATE_COMMA($_CONFIG['wernis_payout_factor']); - $array['withdraw_factor'] = TRANSLATE_COMMA($_CONFIG['wernis_withdraw_factor']); + $array['payout_factor'] = TRANSLATE_COMMA(getConfig('wernis_payout_factor')); + $array['withdraw_factor'] = TRANSLATE_COMMA(getConfig('wernis_withdraw_factor')); // Add all fees - $array['payout_fee_percent'] = TRANSLATE_COMMA($_CONFIG['wernis_payout_fee_percent']); - $array['withdraw_fee_percent'] = TRANSLATE_COMMA($_CONFIG['wernis_withdraw_fee_percent']); - $array['payout_fee_fix'] = TRANSLATE_COMMA($_CONFIG['wernis_payout_fee_fix']); - $array['withdraw_fee_fix'] = TRANSLATE_COMMA($_CONFIG['wernis_withdraw_fee_fix']); + $array['payout_fee_percent'] = TRANSLATE_COMMA(getConfig('wernis_payout_fee_percent')); + $array['withdraw_fee_percent'] = TRANSLATE_COMMA(getConfig('wernis_withdraw_fee_percent')); + $array['payout_fee_fix'] = TRANSLATE_COMMA(getConfig('wernis_payout_fee_fix')); + $array['withdraw_fee_fix'] = TRANSLATE_COMMA(getConfig('wernis_withdraw_fee_fix')); } // diff --git a/inc/libs/yoomedia_functions.php b/inc/libs/yoomedia_functions.php index 04deb26e9d..22a0fb9c6b 100644 --- a/inc/libs/yoomedia_functions.php +++ b/inc/libs/yoomedia_functions.php @@ -48,14 +48,14 @@ function YOOMEDIA_TEST_CONFIG ($data) { } // END - if // Transfer config data - $_CONFIG = array_merge($_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; + getConfig('yoomedia_tm_max_reload') = 1000; + getConfig('yoomedia_tm_min_wait') = 0; + getConfig('yoomedia_tm_clicks_remain') = 10; + getConfig('yoomedia_tm_min_pay') = 0; + getConfig('yoomedia_erotic_allowed') = 1; // Query the API with a test request without couting it // If zero reply comes back the data is invalid! @@ -64,7 +64,7 @@ function YOOMEDIA_TEST_CONFIG ($data) { // Log the response if failed if (count($response) == 0) { // Queries depleted (as we count here!) - DEBUG_LOG(__FUNCTION__, __LINE__, " Requested depleted. Maxmimum was: ".$_CONFIG['yoomedia_requests_total']); + DEBUG_LOG(__FUNCTION__, __LINE__, " Requested depleted. Maxmimum was: ".getConfig('yoomedia_requests_total')); } elseif (count($response) <= 10) { // Log serialized raw response DEBUG_LOG(__FUNCTION__, __LINE__, " Raw response=".base64_encode(serialize($response))); @@ -76,24 +76,22 @@ function YOOMEDIA_TEST_CONFIG ($data) { // Queries the given Yoo!Media API 2.0 script function YOOMEDIA_QUERY_API ($script, $countQuery = true) { - global $_CONFIG; - // Init response array $response = array(); // Enougth queries left? - if (($_CONFIG['yoomedia_requests_remain'] > 0) || (!$countQuery)) { + if ((getConfig('yoomedia_requests_remain') > 0) || (!$countQuery)) { // Prepare the low-level request $requestString = sprintf("http://www.yoomedia.de/interface_2.0/%s?id=%s&sid=%s&pw=%s&reload=%s&ma=%s&uebrig=%s&verguetung=%s&erotik=%s", $script, - bigintval($_CONFIG['yoomedia_id']), - bigintval($_CONFIG['yoomedia_sid']), - $_CONFIG['yoomedia_passwd'], - bigintval($_CONFIG['yoomedia_tm_max_reload']), - bigintval($_CONFIG['yoomedia_tm_min_wait']), - bigintval($_CONFIG['yoomedia_tm_clicks_remain']), - bigintval($_CONFIG['yoomedia_tm_min_pay']), - bigintval($_CONFIG['yoomedia_erotic_allowed']) + bigintval(getConfig('yoomedia_id')), + bigintval(getConfig('yoomedia_sid')), + getConfig('yoomedia_passwd'), + bigintval(getConfig('yoomedia_tm_max_reload')), + bigintval(getConfig('yoomedia_tm_min_wait')), + bigintval(getConfig('yoomedia_tm_clicks_remain')), + bigintval(getConfig('yoomedia_tm_min_pay')), + bigintval(getConfig('yoomedia_erotic_allowed')) ); // Run the query @@ -173,8 +171,6 @@ function YOOMEDIA_PARSE_RESPONSE ($response, $type) { // Prepares a bonus mail for delivery. Works only if extension "bonus" is active function YOOMEDIA_PREPARE_MAIL_DELIVERY ($data) { - global $_CONFIG; - // Is this an admin? if (!IS_ADMIN()) { // Abort here @@ -194,7 +190,7 @@ function YOOMEDIA_PREPARE_MAIL_DELIVERY ($data) { if ($data['reward'] < 1) $data['reward'] = 1; // Add website id - $data['sid'] = $_CONFIG['yoomedia_sid']; + $data['sid'] = getConfig('yoomedia_sid'); // Add total receivers $data['all'] = TRANSLATE_COMMA(GET_TOTAL_RECEIVERS()); @@ -208,8 +204,6 @@ function YOOMEDIA_PREPARE_MAIL_DELIVERY ($data) { // Adds the mail to the bonus mail pool function YOOMEDIA_SEND_BONUS_MAIL ($data, $mode) { - global $_CONFIG; - // Is this an admin? if (!IS_ADMIN()) { // Abort here diff --git a/inc/load_extensions.php b/inc/load_extensions.php index b31dfe68d1..8a8c883826 100644 --- a/inc/load_extensions.php +++ b/inc/load_extensions.php @@ -68,11 +68,11 @@ if (EXT_IS_ACTIVE("cache")) { } // Do we need to init the cache? - if (($cacheMode == "init") && ($_CONFIG['cache_exts'] == "Y")) { + if (($cacheMode == "init") && (getConfig('cache_exts') == "Y")) { // Init cache file $cacheInstance->init("EXTENSIONS"); $cacheInstance->storeExtensionVersion("sql_patches"); - } elseif ($_CONFIG['cache_exts'] == "N") { + } elseif (getConfig('cache_exts') == "N") { // Cache will not be created for extensions $cacheMode = "skip"; } diff --git a/inc/loader/load_cache-admin.php b/inc/loader/load_cache-admin.php index 336732ba9a..d55aa09f1b 100644 --- a/inc/loader/load_cache-admin.php +++ b/inc/loader/load_cache-admin.php @@ -80,7 +80,7 @@ if (($cacheInstance->loadCacheFile("admins")) && ($cacheInstance->extensionVersi $cacheInstance->destroyCacheFile(); unset($cacheArray['admins']); } -} elseif (($_CONFIG['cache_admins'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { +} elseif ((getConfig('cache_admins') == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file $cacheInstance->init("ADMINS"); $cacheInstance->storeExtensionVersion("admins"); @@ -117,7 +117,7 @@ if (GET_EXT_VERSION("admins") >= "0.3") { // Load referal system from cache global $cacheArray; $cacheArray['admin_acls'] = $cacheInstance->getArrayFromCache(); - } elseif (($_CONFIG['cache_acls'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { + } elseif ((getConfig('cache_acls') == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file here $cacheInstance->init("ADMINS_ACLS"); $cacheInstance->storeExtensionVersion("admins"); diff --git a/inc/loader/load_cache-config.php b/inc/loader/load_cache-config.php index 150b7a4e62..d7da6fd7d0 100644 --- a/inc/loader/load_cache-config.php +++ b/inc/loader/load_cache-config.php @@ -44,7 +44,7 @@ if (($cacheInstance->loadCacheFile("config", true)) && ($cacheInstance->extensio $cacheArray['config'] = $cacheInstance->getArrayFromCache(); // TODO: Do we really need to cache the config??? -} elseif (($_CONFIG['cache_config'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { +} elseif ((getConfig('cache_config') == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file here $cacheInstance->init("CONFIG"); $cacheInstance->storeExtensionVersion("sql_patches"); diff --git a/inc/loader/load_cache-modreg.php b/inc/loader/load_cache-modreg.php index 25f5652c21..5d5196efdd 100644 --- a/inc/loader/load_cache-modreg.php +++ b/inc/loader/load_cache-modreg.php @@ -64,7 +64,7 @@ if (($cacheInstance->loadCacheFile("mod_reg")) && ($cacheInstance->extensionVers } // END - if } // END - foreach unset($modArray); -} elseif (($_CONFIG['cache_modreg'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { +} elseif ((getConfig('cache_modreg') == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file here $cacheInstance->init("MODULES"); $cacheInstance->storeExtensionVersion("sql_patches"); diff --git a/inc/loader/load_cache-refdepths.php b/inc/loader/load_cache-refdepths.php index 41097f3bc5..1cd352bc02 100644 --- a/inc/loader/load_cache-refdepths.php +++ b/inc/loader/load_cache-refdepths.php @@ -42,7 +42,7 @@ if (($cacheInstance->loadCacheFile("refdepths")) && ($cacheInstance->extensionVe // Load referal system from cache global $cacheArray; $cacheArray['ref_depths'] = $cacheInstance->getArrayFromCache(); -} elseif (($_CONFIG['cache_refdepth'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { +} elseif ((getConfig('cache_refdepth') == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file here $cacheInstance->init("REFDEPTHS"); $cacheInstance->storeExtensionVersion("sql_patches"); diff --git a/inc/loader/load_cache-refsystem.php b/inc/loader/load_cache-refsystem.php index b841bd1de0..c44c9d6d13 100644 --- a/inc/loader/load_cache-refsystem.php +++ b/inc/loader/load_cache-refsystem.php @@ -42,7 +42,7 @@ if (($cacheInstance->loadCacheFile("refsystem")) && ($cacheInstance->extensionVe // Load referal system from cache global $cacheArray; $cacheArray['ref_system'] = $cacheInstance->getArrayFromCache(); -} elseif (($_CONFIG['cache_refsys'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { +} elseif ((getConfig('cache_refsys') == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file here $cacheInstance->init("REFSYSTEM"); $cacheInstance->storeExtensionVersion("sql_patches"); diff --git a/inc/loader/load_cache-them.php b/inc/loader/load_cache-them.php index 9f09a159f4..f8d70df07d 100644 --- a/inc/loader/load_cache-them.php +++ b/inc/loader/load_cache-them.php @@ -62,7 +62,7 @@ if (($cacheInstance->loadCacheFile("themes")) && ($cacheInstance->extensionVersi // Remove dummy array unset($cache); -} elseif (($_CONFIG['cache_refsys'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { +} elseif ((getConfig('cache_themes') == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file here $cacheInstance->init("THEMES"); $cacheInstance->storeExtensionVersion("theme"); diff --git a/inc/mails/beg_mails.php b/inc/mails/beg_mails.php index 2d37118b0d..832bc5e7d8 100644 --- a/inc/mails/beg_mails.php +++ b/inc/mails/beg_mails.php @@ -44,15 +44,15 @@ global $CSS; if ($CSS == 1) return; // Create timemark from saved month -$mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time())); +$mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time())); $SQL = ""; $MODE = ""; // Shall I sent activation or deactivation mail? $SQL = "SELECT userid, email FROM `"._MYSQL_PREFIX."_user_data` WHERE (beg_ral_notify "; -switch ($_CONFIG['beg_rallye']) +switch (getConfig('beg_rallye')) { -case 'Y': // Begging rallye is activated - if ($_CONFIG['beg_ral_en_notify'] == "Y") +case "Y": // Begging rallye is activated + 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)"; @@ -65,8 +65,8 @@ case 'Y': // Begging rallye is activated } break; -case 'N': // Begging rallye is deactivated - if ($_CONFIG['beg_ral_di_notify'] == "Y") +case "N": // Begging rallye is deactivated + 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"; @@ -85,10 +85,10 @@ if (!empty($SQL)) { $SQL .= ") AND status='CONFIRMED' ORDER BY last_online ASC"; // Prepare data for the template - define('__BEG_MIN_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points'])); - define('__BEG_MAX_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points_max'])); - define('__BEG_MAX_WINNERS', round($_CONFIG['beg_ranks'])); - if ($_CONFIG['beg_ip_timeout'] == 0) + define('__BEG_MIN_POINTS' , TRANSLATE_COMMA(getConfig('beg_points'))); + define('__BEG_MAX_POINTS' , TRANSLATE_COMMA(getConfig('beg_points_max'))); + define('__BEG_MAX_WINNERS', round(getConfig('beg_ranks'))); + if (getConfig('beg_ip_timeout') == 0) { // No IP locking setuped! define('__BEG_IP_LOCKER', BEG_NO_LIMITATION); @@ -96,14 +96,14 @@ if (!empty($SQL)) { else { // Create timemark - define('__BEG_IP_LOCKER', CREATE_FANCY_TIME($_CONFIG['beg_ip_timeout'])); + define('__BEG_IP_LOCKER', CREATE_FANCY_TIME(getConfig('beg_ip_timeout'))); } // Check for accounts to be notified $result_main = SQL_QUERY($SQL, __FILE__, __LINE__); if (SQL_NUMROWS($result_main) > 0) { // Normal notification mails or bonus mails? - $MAIL_MODE = (($_CONFIG['beg_notify_bonus'] > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus"))); + $MAIL_MODE = ((getConfig('beg_notify_bonus') > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus"))); // Generate subject line $SUBJECT = constant('BEG_RALLYE_'.strtoupper($MODE).'_NOTIFY'); @@ -139,7 +139,7 @@ SET beg_ral_notify='%s', beg_ral_%s_notify='%s' WHERE userid=%s LIMIT 1", $url = URL."/modules.php?module=index&what=login"; // Insert mail - ADD_BONUS_MAIL_TO_QUEUE($SUBJECT, $MSG, $RECEIVER, $_CONFIG['beg_notify_bonus'], $_CONFIG['beg_notify_wait'], $url, 0, "normal", SQL_NUMROWS($result_main)); + ADD_BONUS_MAIL_TO_QUEUE($SUBJECT, $MSG, $RECEIVER, getConfig('beg_notify_bonus'), getConfig('beg_notify_wait'), $url, 0, "normal", SQL_NUMROWS($result_main)); } // END - if } // END - if diff --git a/inc/mails/birthday_mails.php b/inc/mails/birthday_mails.php index b51e154d79..c23b1d7bfd 100644 --- a/inc/mails/birthday_mails.php +++ b/inc/mails/birthday_mails.php @@ -50,15 +50,15 @@ $YEAR = date('Y', time()); // Shall I include only active members? $ADD = "%s"; $VALUE = ""; -if (($_CONFIG['birthday_active']) && (EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['autopurge_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) { +if ((getConfig('birthday_active')) && (EXT_IS_ACTIVE("autopurge")) && (getConfig('autopurge_inactive') == "Y") && (getConfig('ap_inactive_since') > 0)) { $ADD = " AND last_online >= (UNIX_TIMESTAP() - %s)"; - $VALUE = $_CONFIG['ap_inactive_since']; + $VALUE = getConfig('ap_inactive_since'); } // Only confirmed members shall receive birthday mails... $result_birthday = SQL_QUERY_ESC("SELECT userid, email, birth_year FROM "._MYSQL_PREFIX."_user_data -WHERE status='CONFIRMED' AND birth_day=%s AND birth_month=%s AND birthday_sent < (UNIX_TIMESTAMP() - ".($_CONFIG['one_day'] * 364).")".$ADD." +WHERE status='CONFIRMED' AND birth_day=%s AND birth_month=%s AND birthday_sent < (UNIX_TIMESTAMP() - ".(getConfig('one_day') * 364).")".$ADD." ORDER BY userid", array($DAY, $MONTH, $VALUE), __FILE__, __LINE__); @@ -72,11 +72,11 @@ if (SQL_NUMROWS($result_birthday) > 0) { // Simply subtract both values and you got the age... :) $AGE = $NOW - $BD; - if ($_CONFIG['birthday_points'] > 0) { + if (getConfig('birthday_points') > 0) { // Prepare array for loading template $content = array( 'age' => $AGE, - 'points' => TRANSLATE_COMMA($_CONFIG['birthday_points']), + 'points' => TRANSLATE_COMMA(getConfig('birthday_points')), 'check' => "", ); @@ -86,7 +86,7 @@ if (SQL_NUMROWS($result_birthday) > 0) { // Insert row into database $result_insert = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_birthday (userid, points, chk_value) VALUES ('%s','%s','%s' )", - array(bigintval($uid), $_CONFIG['birthday_points'], $content['check']), __FILE__, __LINE__); + array(bigintval($uid), getConfig('birthday_points'), $content['check']), __FILE__, __LINE__); // Load email template with confirmation link $msg = LOAD_EMAIL_TEMPLATE("member_birthday_confirm", $content, bigintval($uid)); diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index 6b45f0dda6..860a33701c 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -44,15 +44,15 @@ global $CSS; if ($CSS == 1) return; // Create timemark from saved month -$mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time())); +$mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time())); $SQL = ""; $MODE = ""; // Shall I sent activation or deactivation mail? $SQL = "SELECT userid, email FROM `"._MYSQL_PREFIX."_user_data` WHERE (bonus_ral_notify "; -switch ($_CONFIG['bonus_active']) +switch (getConfig('bonus_active')) { -case 'Y': // Active rallye is activated - if ($_CONFIG['bonus_en_notify'] == "Y") { +case "Y": // Active rallye is activated + if (getConfig('bonus_en_notify') == "Y") { // Okay, let's check for member accounts $SQL .= "= 0 OR (bonus_ral_notify > 0 AND bonus_ral_en_notify < bonus_ral_di_notify)"; $MODE = "en"; @@ -62,8 +62,8 @@ case 'Y': // Active rallye is activated } break; -case 'N': // Active rallye is deactivated - if ($_CONFIG['bonus_di_notify'] == "Y") { +case "N": // Active rallye is deactivated + if (getConfig('bonus_di_notify') == "Y") { // Okay, let's check for member accounts $SQL .= " > 0 AND bonus_ral_di_notify < bonus_ral_en_notify"; $MODE = "di"; @@ -79,7 +79,7 @@ if (!empty($SQL)) { $SQL .= ") AND status='CONFIRMED' ORDER BY last_online ASC"; // Normal notification mails or bonus mails? - $MAIL_MODE = (($_CONFIG['bonus_notify_points'] > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus"))); + $MAIL_MODE = ((getConfig('bonus_notify_points') > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus"))); // Generate subject line $SUBJECT = constant('BONUS_RALLYE_'.strtoupper($MODE).'_NOTIFY'); @@ -118,7 +118,7 @@ SET bonus_ral_notify='%s', bonus_ral_%s_notify='%s' WHERE userid=%s LIMIT 1", $url = URL."/modules.php?module=index&what=login"; // Insert mail - ADD_BONUS_MAIL_TO_QUEUE($SUBJECT, $MSG, $RECEIVER, $_CONFIG['bonus_notify_points'], $_CONFIG['bonus_notify_wait'], $url, 0, "normal", SQL_NUMROWS($result_main)); + ADD_BONUS_MAIL_TO_QUEUE($SUBJECT, $MSG, $RECEIVER, getConfig('bonus_notify_points'), getConfig('bonus_notify_wait'), $url, 0, "normal", SQL_NUMROWS($result_main)); } // END - if } // END - if diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 0a6951b998..c144a4dc6a 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -353,7 +353,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) { } // When type of admin menu is not set fallback to old menu system - if (empty($_CONFIG['admin_menu'])) $_CONFIG['admin_menu'] = "OLD"; + if (getConfig('admin_menu') == null) getConfig('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/admin-inc.php b/inc/modules/admin/admin-inc.php index 586f1803f7..9ac190ce37 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -73,7 +73,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) { // Get password from cache $data['password'] = $cacheArray['admins']['password'][$aid]; $ret = "pass"; - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } // Include more admins data? if (GET_EXT_VERSION("admins") >= "0.7.0") { @@ -383,7 +383,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) { $menuTitle = array(); // Is there a cache instance? - if ((is_object($cacheInstance)) && (isset($_CONFIG['cache_admin_menu'])) && ($_CONFIG['cache_admin_menu'] == "Y")) { + if ((is_object($cacheInstance)) && (getConfig('cache_admin_menu') == "Y")) { // Create cache name $cacheName = "admin_".$act."_".$wht."_".GET_LANGUAGE()."_".strtolower(get_session('admin_login')); @@ -537,7 +537,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) { eval($eval); // Is there a cache instance again? - if ((is_object($cacheInstance)) && (isset($_CONFIG['cache_admin_menu'])) && ($_CONFIG['cache_admin_menu'] == "Y")) { + if ((is_object($cacheInstance)) && (getConfig('cache_admin_menu') == "Y")) { // Init cache $cacheInstance->init($cacheName); @@ -775,7 +775,8 @@ function ADMIN_CHECK_MENU_MODE() { global $_CONFIG, $cacheArray; // Set the global mode as the mode for all admins - $MODE = $_CONFIG['admin_menu']; $ADMIN = $MODE; + $MODE = getConfig('admin_menu'); + $ADMIN = $MODE; // Get admin id $aid = GET_CURRENT_ADMIN_ID(); @@ -784,11 +785,11 @@ function ADMIN_CHECK_MENU_MODE() { if (isset($cacheArray['admins']['la_mode'][$aid])) { // Load from cache $ADMIN = $cacheArray['admins']['la_mode'][$aid]; - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (GET_EXT_VERSION("admins") >= "0.6.7") { // Load from database when version of "admins" is enough $result = SQL_QUERY_ESC("SELECT la_mode FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1", - array($aid), __FILE__, __LINE__); + array($aid), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load data list($ADMIN) = SQL_FETCHROW($result); @@ -1192,7 +1193,7 @@ function ADMIN_TEST_PROXY_SETTINGS ($settingsArray) { global $_CONFIG; // Set temporary the new settings - $_CONFIG = array_merge($_CONFIG, $settingsArray); + $_CONFIG = merge_array($_CONFIG, $settingsArray); // Now get the test URL $content = GET_URL("check-updates3.php"); diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index c99b12796b..e8a2b36674 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -185,7 +185,7 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) { $title = TASK_NO_TITLE; // Shall I list SQL commands assigned to an extension installation or update task? - if (((GET_EXT_VERSION("sql_patches") != '') && ($_CONFIG['verbose_sql'] == "Y")) || (!EXT_IS_ACTIVE("sql_patches"))) { + if (((GET_EXT_VERSION("sql_patches") != '') && (getConfig('verbose_sql') == "Y")) || (!EXT_IS_ACTIVE("sql_patches"))) { $ext_name = substr($subj, 1, strpos($subj, ":") - 1); if ($type == "EXTENSION") { // Load SQL commands for registering @@ -220,7 +220,7 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) { // Add SQLs to a table if (empty($SQLs)) $SQLs = array(); if (empty($title)) $title = ""; - if ((!empty($ext_name)) && (GET_EXT_VERSION("sql_patches")) && ($_CONFIG['verbose_sql'] == "Y")) { + if ((!empty($ext_name)) && (GET_EXT_VERSION("sql_patches")) && (getConfig('verbose_sql') == "Y")) { // Add verbose SQL table $text .= EXTENSION_VERBOSE_TABLE($SQLs, $title, " class=\"admin_table top2 left2 right2\"", true, "100%")."
\n"; } // END - if diff --git a/inc/modules/admin/what-add_rallye.php b/inc/modules/admin/what-add_rallye.php index 12fb85f1fa..d0ffeb9169 100644 --- a/inc/modules/admin/what-add_rallye.php +++ b/inc/modules/admin/what-add_rallye.php @@ -108,9 +108,9 @@ define('_START_MONTH', ADD_SELECTION("month", date("m", time()), "start")); define('_START_YEAR' , ADD_SELECTION("year" , date('Y', time()), "start")); // Calcualte ending date -$D = date("d", time() + ($_CONFIG['one_day'] * 7)); -$M = date("m", time() + ($_CONFIG['one_day'] * 7)); -$Y = date('Y', time() + ($_CONFIG['one_day'] * 7)); +$D = date("d", time() + (getConfig('one_day') * 7)); +$M = date("m", time() + (getConfig('one_day') * 7)); +$Y = date('Y', time() + (getConfig('one_day') * 7)); // Ending day define('_END_SEC' , ADD_SELECTION("sec" , "0" , "end")); diff --git a/inc/modules/admin/what-add_sponsor.php b/inc/modules/admin/what-add_sponsor.php index 1f736068ee..3630a89c13 100644 --- a/inc/modules/admin/what-add_sponsor.php +++ b/inc/modules/admin/what-add_sponsor.php @@ -45,7 +45,7 @@ if (isset($_POST['ok'])) { SPONSOR_HANDLE_SPONSOR($_POST); } else { // Prepare constants for the template - define('__SPONSOR_MIN_VALUE', $_CONFIG['sponsor_min_points']); + define('__SPONSOR_MIN_VALUE', getConfig('sponsor_min_points')); // Output form LOAD_TEMPLATE("admin_add_sponsor"); diff --git a/inc/modules/admin/what-autopurge.php b/inc/modules/admin/what-autopurge.php index da04ee23e4..f87b68fd31 100644 --- a/inc/modules/admin/what-autopurge.php +++ b/inc/modules/admin/what-autopurge.php @@ -1,80 +1,3 @@ diff --git a/inc/modules/admin/what-cache_stats.php b/inc/modules/admin/what-cache_stats.php index 13e22537de..ccdbd3efea 100644 --- a/inc/modules/admin/what-cache_stats.php +++ b/inc/modules/admin/what-cache_stats.php @@ -41,13 +41,13 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR("admin", __FILE__); // Calculate total hits -$totalHits = ($_CONFIG['db_hits'] + $_CONFIG['cache_hits']); +$totalHits = (getConfig('db_hits') + getConfig('cache_hits')); // Prepare data for the template -define('__DB_HITS' , TRANSLATE_COMMA($_CONFIG['db_hits'])); -define('__CACHE_HITS', TRANSLATE_COMMA($_CONFIG['cache_hits'])); +define('__DB_HITS' , TRANSLATE_COMMA(getConfig('db_hits'))); +define('__CACHE_HITS', TRANSLATE_COMMA(getConfig('cache_hits'))); define('__TOTAL_HITS', TRANSLATE_COMMA($totalHits)); -define('__CACHE_PERC', TRANSLATE_COMMA(($_CONFIG['cache_hits'] / $totalHits * 100))); +define('__CACHE_PERC', TRANSLATE_COMMA((getConfig('cache_hits') / $totalHits * 100))); // Load template LOAD_TEMPLATE("admin_cache_stats"); diff --git a/inc/modules/admin/what-config_active.php b/inc/modules/admin/what-config_active.php index 2d244f8046..efb00e6321 100644 --- a/inc/modules/admin/what-config_active.php +++ b/inc/modules/admin/what-config_active.php @@ -45,7 +45,7 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Minimum mails / active - define('__LIMIT_VALUE', $_CONFIG['active_limit']); + define('__LIMIT_VALUE', getConfig('active_limit')); // Load template LOAD_TEMPLATE("admin_config_active"); diff --git a/inc/modules/admin/what-config_admin.php b/inc/modules/admin/what-config_admin.php index 83084f6f6b..8f42cfc5ec 100644 --- a/inc/modules/admin/what-config_admin.php +++ b/inc/modules/admin/what-config_admin.php @@ -44,7 +44,7 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Prepare data for the template - switch ($_CONFIG['admin_menu']) + switch (getConfig('admin_menu')) { case "NEW": define('__ADMIN_MENU_NEW', " checked=\"checked\""); diff --git a/inc/modules/admin/what-config_autopurge.php b/inc/modules/admin/what-config_autopurge.php index 56bf2c494e..b55200c1a2 100644 --- a/inc/modules/admin/what-config_autopurge.php +++ b/inc/modules/admin/what-config_autopurge.php @@ -45,27 +45,27 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Output de-/activation selections - define('__AP_INACTIVE_SELECTION' , ADD_SELECTION("yn", $_CONFIG['autopurge_inactive'] , "autopurge_inactive")); - define('__AP_UNCONFIRMED_SELECTION', ADD_SELECTION("yn", $_CONFIG['autopurge_unconfirmed'], "autopurge_unconfirmed")); - define('__AP_TASKS_SELECTION' , ADD_SELECTION("yn", $_CONFIG['ap_tasks'] , "autopurge_tasks")); - define('__AP_DEL_MAILS_SELECTION' , ADD_SELECTION("yn", $_CONFIG['ap_del_mails'] , "ap_del_mails")); + define('__AP_INACTIVE_SELECTION' , ADD_SELECTION("yn", getConfig('autopurge_inactive') , "autopurge_inactive")); + define('__AP_UNCONFIRMED_SELECTION', ADD_SELECTION("yn", getConfig('autopurge_unconfirmed'), "autopurge_unconfirmed")); + define('__AP_TASKS_SELECTION' , ADD_SELECTION("yn", getConfig('ap_tasks') , "autopurge_tasks")); + define('__AP_DEL_MAILS_SELECTION' , ADD_SELECTION("yn", getConfig('ap_del_mails') , "ap_del_mails")); // Output notification selections - define('__AP_NOTIFY_INACTIVE' , ADD_SELECTION("yn", $_CONFIG['ap_in_mail'] , "ap_in_notify")); - define('__AP_NOTIFY_UNCONFIRMED' , ADD_SELECTION("yn", $_CONFIG['ap_un_mail'] , "ap_un_notify")); - define('__AP_NOTIFY_TASKS' , ADD_SELECTION("yn", $_CONFIG['ap_tasks_mail'], "ap_tasks_notify")); - define('__AP_NOTIFY_DEL_MAILS' , ADD_SELECTION("yn", $_CONFIG['ap_dm_notify'] , "ap_dm_notify")); + define('__AP_NOTIFY_INACTIVE' , ADD_SELECTION("yn", getConfig('ap_in_notify') , "ap_in_notify")); + define('__AP_NOTIFY_UNCONFIRMED' , ADD_SELECTION("yn", getConfig('ap_un_notify') , "ap_un_notify")); + define('__AP_NOTIFY_TASKS' , ADD_SELECTION("yn", getConfig('ap_tasks_notify'), "ap_tasks_notify")); + define('__AP_NOTIFY_DEL_MAILS' , ADD_SELECTION("yn", getConfig('ap_dm_notify') , "ap_dm_notify")); // Output time selection boxes - define('__AP_IN_SINCE' , CREATE_TIME_SELECTIONS($_CONFIG['ap_inactive_since'], "ap_inactive_since" , "MWDh")); - define('__AP_IN_TIME' , CREATE_TIME_SELECTIONS($_CONFIG['ap_in_time'] , "ap_inactive_time" , "MWDh")); - define('__AP_UN_TIME' , CREATE_TIME_SELECTIONS($_CONFIG['ap_un_time'] , "ap_unconfirmed_time", "MWDh")); - define('__AP_TASK_TIME' , CREATE_TIME_SELECTIONS($_CONFIG['ap_tasks_time'] , "ap_tasks_time" , "MWDh")); - define('__AP_DEL_MAILS_TIME', CREATE_TIME_SELECTIONS($_CONFIG['ap_dm_timeout'] , "ap_dm_timeout" , "MWDh")); + define('__AP_IN_SINCE' , CREATE_TIME_SELECTIONS(getConfig('ap_inactive_since'), "ap_inactive_since" , "MWDh")); + define('__AP_IN_TIME' , CREATE_TIME_SELECTIONS(getConfig('ap_in_time') , "ap_inactive_time" , "MWDh")); + define('__AP_UN_TIME' , CREATE_TIME_SELECTIONS(getConfig('ap_un_time') , "ap_unconfirmed_time", "MWDh")); + define('__AP_TASK_TIME' , CREATE_TIME_SELECTIONS(getConfig('ap_tasks_time') , "ap_tasks_time" , "MWDh")); + define('__AP_DEL_MAILS_TIME', CREATE_TIME_SELECTIONS(getConfig('ap_dm_timeout') , "ap_dm_timeout" , "MWDh")); // Mail confirmation links - define('_CFG_AUTO_PURGE', CREATE_TIME_SELECTIONS($_CONFIG['auto_purge'], "auto_purge", "MWD")); - if ($_CONFIG['auto_purge_active'] == "N") { + define('_CFG_AUTO_PURGE', CREATE_TIME_SELECTIONS(getConfig('auto_purge'), "auto_purge", "MWD")); + if (getConfig('auto_purge_active') == "N") { define('_CFG_AP_ACTIVE_N', " checked=\"checked\""); define('_CFG_AP_ACTIVE_Y', ""); } else { diff --git a/inc/modules/admin/what-config_beg.php b/inc/modules/admin/what-config_beg.php index b6033f28c4..c17cde08f6 100644 --- a/inc/modules/admin/what-config_beg.php +++ b/inc/modules/admin/what-config_beg.php @@ -55,43 +55,43 @@ if (isset($_POST['ok'])) { $_CONFIG['beg_ral_di_notify'] = $_POST['beg_ral_di_notify']; } else { // Prepare constants for the template - define('__BEG_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points'] , false)); - define('__BEG_POINTS_MAX' , TRANSLATE_COMMA($_CONFIG['beg_points_max'] , false)); - define('__BEG_NOTIFY_BONUS' , TRANSLATE_COMMA($_CONFIG['beg_notify_bonus'], false)); - define('__BEG_TIMEOUT' , CREATE_TIME_SELECTIONS($_CONFIG['beg_timeout'] , "beg_timeout" , "Dhm")); - define('__BEG_UID_TIMEOUT' , CREATE_TIME_SELECTIONS($_CONFIG['beg_uid_timeout'], "beg_uid_timeout", "Dhm")); - define('__BEG_REMOTE_IP_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['beg_ip_timeout'] , "beg_ip_timeout" , "Dhm")); - define('__WAIT_SELECTION' , CREATE_TIME_SELECTIONS($_CONFIG['beg_notify_wait'], "beg_notify_wait", "ms" )); - define('__BEG_RANKS', $_CONFIG['beg_ranks']); + define('__BEG_POINTS' , TRANSLATE_COMMA(getConfig('beg_points') , false)); + define('__BEG_POINTS_MAX' , TRANSLATE_COMMA(getConfig('beg_points_max') , false)); + define('__BEG_NOTIFY_BONUS' , TRANSLATE_COMMA(getConfig('beg_notify_bonus'), false)); + define('__BEG_TIMEOUT' , CREATE_TIME_SELECTIONS(getConfig('beg_timeout') , "beg_timeout" , "Dhm")); + define('__BEG_UID_TIMEOUT' , CREATE_TIME_SELECTIONS(getConfig('beg_uid_timeout'), "beg_uid_timeout", "Dhm")); + define('__BEG_REMOTE_IP_TIMEOUT', CREATE_TIME_SELECTIONS(getConfig('beg_ip_timeout') , "beg_ip_timeout" , "Dhm")); + define('__WAIT_SELECTION' , CREATE_TIME_SELECTIONS(getConfig('beg_notify_wait'), "beg_notify_wait", "ms" )); + define('__BEG_RANKS' , getConfig('beg_ranks')); // Activate / Deactivate beg rallye (Y/N) - switch ($_CONFIG['beg_rallye']) + switch (getConfig('beg_rallye')) { - case 'Y': + case "Y": define('__BEG_RALLYE_Y', " checked=\"checked\""); define('__BEG_RALLYE_N', ""); break; - case 'N': + case "N": define('__BEG_RALLYE_Y', ""); define('__BEG_RALLYE_N', " checked=\"checked\""); break; } - switch ($_CONFIG['beg_active']) + switch (getConfig('beg_active')) { - case 'Y': + case "Y": define('__BEG_ACTIVE_Y', " checked=\"checked\""); define('__BEG_ACTIVE_N', ""); break; - case 'N': + case "N": define('__BEG_ACTIVE_Y', ""); define('__BEG_ACTIVE_N', " checked=\"checked\""); break; } - switch ($_CONFIG['beg_mode']) + switch (getConfig('beg_mode')) { case "DIRECT": define('__BEG_MODE_DIRECT', " checked=\"checked\""); @@ -104,59 +104,59 @@ if (isset($_POST['ok'])) { break; } - switch ($_CONFIG['beg_ral_en_notify']) + switch (getConfig('beg_ral_en_notify')) { - case 'Y': + case "Y": define('__BEG_RAL_EN_NOTIFY_Y', " checked=\"checked\""); define('__BEG_RAL_EN_NOTIFY_N', ""); break; - case 'N': + case "N": define('__BEG_RAL_EN_NOTIFY_Y', ""); define('__BEG_RAL_EN_NOTIFY_N', " checked=\"checked\""); break; } - switch ($_CONFIG['beg_ral_di_notify']) + switch (getConfig('beg_ral_di_notify')) { - case 'Y': + case "Y": define('__BEG_RAL_DI_NOTIFY_Y', " checked=\"checked\""); define('__BEG_RAL_DI_NOTIFY_N', ""); break; - case 'N': + case "N": define('__BEG_RAL_DI_NOTIFY_Y', ""); define('__BEG_RAL_DI_NOTIFY_N', " checked=\"checked\""); break; } - switch ($_CONFIG['beg_new_mem_notify']) + switch (getConfig('beg_new_mem_notify')) { - case 'Y': + case "Y": define('__BEG_NEW_MEMBER_NOTIFY_Y', " checked=\"checked\""); define('__BEG_NEW_MEMBER_NOTIFY_N', ""); break; - case 'N': + case "N": define('__BEG_NEW_MEMBER_NOTIFY_Y', ""); define('__BEG_NEW_MEMBER_NOTIFY_N', " checked=\"checked\""); break; } - switch ($_CONFIG['beg_include_own']) + switch (getConfig('beg_include_own')) { - case 'Y': + case "Y": define('__BEG_INCLUDE_OWN_Y', " checked=\"checked\""); define('__BEG_INCLUDE_OWN_N', ""); break; - case 'N': + case "N": define('__BEG_INCLUDE_OWN_Y', ""); define('__BEG_INCLUDE_OWN_N', " checked=\"checked\""); break; } - switch ($_CONFIG['beg_pay_mode']) { + switch (getConfig('beg_pay_mode')) { case "IMG": define('__BEG_PAY_MODE_IMG' , " selected=\"selected\""); define('__BEG_PAY_MODE_JS' , ""); @@ -187,7 +187,7 @@ if (isset($_POST['ok'])) { } // Add data to constant __MEMBER_SELECTION - define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['beg_uid'], false, true, true, "beg_uid")); + define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('beg_uid'), false, true, true, "beg_uid")); // Load form template LOAD_TEMPLATE("admin_config_beg"); diff --git a/inc/modules/admin/what-config_birthday.php b/inc/modules/admin/what-config_birthday.php index 6ecd32903f..174bbf6556 100644 --- a/inc/modules/admin/what-config_birthday.php +++ b/inc/modules/admin/what-config_birthday.php @@ -45,20 +45,20 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Prepare data for the template - define('__POINTS_VALUE', $_CONFIG['birthday_points']); - switch ($_CONFIG['birthday_active']) + define('__POINTS_VALUE', getConfig('birthday_points')); + switch (getConfig('birthday_active')) { - case 'Y': + case "Y": define('__BIRTHDAY_ACTIVE_Y', " checked=\"checked\""); define('__BIRTHDAY_ACTIVE_N', ""); break; - case 'N': + case "N": define('__BIRTHDAY_ACTIVE_Y', ""); define('__BIRTHDAY_ACTIVE_N', " checked=\"checked\""); break; } - switch ($_CONFIG['birthday_mode']) + switch (getConfig('birthday_mode')) { case "DIRECT": define('__BIRTHDAY_MODE_DIRECT', " checked=\"checked\""); diff --git a/inc/modules/admin/what-config_bonus.php b/inc/modules/admin/what-config_bonus.php index 3e3308027e..63e933d9f3 100644 --- a/inc/modules/admin/what-config_bonus.php +++ b/inc/modules/admin/what-config_bonus.php @@ -58,35 +58,35 @@ if (isset($_POST['ok'])) { unset($_POST['rate']); // Automatically calculate bonus points for ranks 2 and 3 when not set - if (empty($_POST['turbo_rates'])) $_POST['turbo_rates'] = "".round($_CONFIG['turbo_bonus'] / 2).";".round($_CONFIG['turbo_bonus'] / 4).""; + if (empty($_POST['turbo_rates'])) $_POST['turbo_rates'] = "".round(getConfig('turbo_bonus') / 2).";".round(getConfig('turbo_bonus') / 4).""; // Save data ADMIN_SAVE_SETTINGS($_POST); // Remember new settings - $_CONFIG['bonus_active'] = $_POST['bonus_active']; + getConfig('bonus_active') = $_POST['bonus_active']; $_CONFIG['bonus_en_notify'] = $_POST['bonus_en_notify']; $_CONFIG['bonus_di_notify'] = $_POST['bonus_di_notify']; } else { // Prepare contants for the template - define('__LOGIN_VALUE' , TRANSLATE_COMMA($_CONFIG['login_bonus'] , false)); - define('__TURBO_VALUE' , TRANSLATE_COMMA($_CONFIG['turbo_bonus'] , false)); - define('__ORDER_VALUE' , TRANSLATE_COMMA($_CONFIG['bonus_order'] , false)); - define('__REF_VALUE' , TRANSLATE_COMMA($_CONFIG['bonus_ref'] , false)); - define('__STATS_VALUE' , TRANSLATE_COMMA($_CONFIG['bonus_stats'] , false)); - define('__NOTIFY_VALUE', TRANSLATE_COMMA($_CONFIG['bonus_notify_points'], false)); - define('__TRANKS_VALUE', $_CONFIG['bonus_ranks']); - define('__TLINES_VALUE', $_CONFIG['bonus_lines']); + define('__LOGIN_VALUE' , TRANSLATE_COMMA(getConfig('login_bonus') , false)); + define('__TURBO_VALUE' , TRANSLATE_COMMA(getConfig('turbo_bonus') , false)); + define('__ORDER_VALUE' , TRANSLATE_COMMA(getConfig('bonus_order') , false)); + define('__REF_VALUE' , TRANSLATE_COMMA(getConfig('bonus_ref') , false)); + define('__STATS_VALUE' , TRANSLATE_COMMA(getConfig('bonus_stats') , false)); + define('__NOTIFY_VALUE', TRANSLATE_COMMA(getConfig('bonus_notify_points'), false)); + define('__TRANKS_VALUE', getConfig('bonus_ranks')); + define('__TLINES_VALUE', getConfig('bonus_lines')); // Transfer options to template __MEMBER_SELECTION - define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['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("*".$_CONFIG['turbo_rates']."*"); - $RANKS = explode(";", $_CONFIG['turbo_rates']); + //die("*".getConfig('turbo_rates')."*"); + $RANKS = explode(";", getConfig('turbo_rates')); // Automatically calculate bonus points for ranks 2 and 3 when not set - if (empty($_CONFIG['turbo_rates'])) $RANKS = array(round($_CONFIG['turbo_bonus'] / 2), round($_CONFIG['turbo_bonus'] / 4)); + if (getConfig('turbo_rates') == "") $RANKS = array(round(getConfig('turbo_bonus') / 2), round(getConfig('turbo_bonus') / 4)); // Generate list $OUT = "
    \n"; @@ -109,128 +109,128 @@ if (isset($_POST['ok'])) { $OUT .= "
\n"; define('__TRATES_LIST', $OUT); - define('__LOGIN_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['login_timeout'] , "login_timeout" , "WDh")); - define('__BONUS_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['bonus_timeout'] , "bonus_timeout" , "WDh")); - define('__WAIT_SELECTION' , CREATE_TIME_SELECTIONS($_CONFIG['bonus_notify_wait'], "bonus_notify_wait", "ms" )); + define('__LOGIN_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS(getConfig('login_timeout') , "login_timeout" , "WDh")); + define('__BONUS_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS(getConfig('bonus_timeout') , "bonus_timeout" , "WDh")); + define('__WAIT_SELECTION' , CREATE_TIME_SELECTIONS(getConfig('bonus_notify_wait'), "bonus_notify_wait", "ms" )); // Activate / Deactivate bonus active rallye (Y/N) - switch ($_CONFIG['bonus_active']) + switch (getConfig('bonus_active')) { - case 'Y': + case "Y": define('__BONUS_ACTIVE_Y', " checked=\"checked\""); define('__BONUS_ACTIVE_N', ""); break; - case 'N': + case "N": define('__BONUS_ACTIVE_Y', ""); define('__BONUS_ACTIVE_N', " checked=\"checked\""); break; } // Other bonus to de-/activate - switch ($_CONFIG['bonus_login_yn']) + switch (getConfig('bonus_login_yn')) { - case 'Y': + case "Y": define('__BONUS_LOGIN_Y', " checked=\"checked\""); define('__BONUS_LOGIN_N', ""); break; - case 'N': + case "N": define('__BONUS_LOGIN_Y', ""); define('__BONUS_LOGIN_N', " checked=\"checked\""); break; } - switch ($_CONFIG['bonus_stats_yn']) + switch (getConfig('bonus_stats_yn')) { - case 'Y': + case "Y": define('__BONUS_STATS_Y', " checked=\"checked\""); define('__BONUS_STATS_N', ""); break; - case 'N': + case "N": define('__BONUS_STATS_Y', ""); define('__BONUS_STATS_N', " checked=\"checked\""); break; } - switch ($_CONFIG['bonus_order_yn']) + switch (getConfig('bonus_order_yn')) { - case 'Y': + case "Y": define('__BONUS_ORDER_Y', " checked=\"checked\""); define('__BONUS_ORDER_N', ""); break; - case 'N': + case "N": define('__BONUS_ORDER_Y', ""); define('__BONUS_ORDER_N', " checked=\"checked\""); break; } - switch ($_CONFIG['bonus_ref_yn']) + switch (getConfig('bonus_ref_yn')) { - case 'Y': + case "Y": define('__BONUS_REF_Y', " checked=\"checked\""); define('__BONUS_REF_N', ""); break; - case 'N': + case "N": define('__BONUS_REF_Y', ""); define('__BONUS_REF_N', " checked=\"checked\""); break; } - switch ($_CONFIG['bonus_click_yn']) + switch (getConfig('bonus_click_yn')) { - case 'Y': + case "Y": define('__BONUS_CLICK_Y', " checked=\"checked\""); define('__BONUS_CLICK_N', ""); break; - case 'N': + case "N": define('__BONUS_CLICK_Y', ""); define('__BONUS_CLICK_N', " checked=\"checked\""); break; } - switch ($_CONFIG['bonus_en_notify']) + switch (getConfig('bonus_en_notify')) { - case 'Y': + case "Y": define('__BONUS_EN_NOTIFY_Y', " checked=\"checked\""); define('__BONUS_EN_NOTIFY_N', ""); break; - case 'N': + case "N": define('__BONUS_EN_NOTIFY_Y', ""); define('__BONUS_EN_NOTIFY_N', " checked=\"checked\""); break; } - switch ($_CONFIG['bonus_di_notify']) + switch (getConfig('bonus_di_notify')) { - case 'Y': + case "Y": define('__BONUS_DI_NOTIFY_Y', " checked=\"checked\""); define('__BONUS_DI_NOTIFY_N', ""); break; - case 'N': + case "N": define('__BONUS_DI_NOTIFY_Y', ""); define('__BONUS_DI_NOTIFY_N', " checked=\"checked\""); break; } - switch ($_CONFIG['bonus_new_mem_notify']) + switch (getConfig('bonus_new_mem_notify')) { - case 'Y': + case "Y": define('__BONUS_NEW_MEMBER_NOTIFY_Y', " checked=\"checked\""); define('__BONUS_NEW_MEMBER_NOTIFY_N', ""); break; - case 'N': + case "N": define('__BONUS_NEW_MEMBER_NOTIFY_Y', ""); define('__BONUS_NEW_MEMBER_NOTIFY_N', " checked=\"checked\""); break; } - switch ($_CONFIG['bonus_include_own']) + switch (getConfig('bonus_include_own')) { - case 'Y': + case "Y": define('__BONUS_INCLUDE_OWN_Y', " checked=\"checked\""); define('__BONUS_INCLUDE_OWN_N', ""); break; - case 'N': + case "N": define('__BONUS_INCLUDE_OWN_Y', ""); define('__BONUS_INCLUDE_OWN_N', " checked=\"checked\""); break; diff --git a/inc/modules/admin/what-config_cache.php b/inc/modules/admin/what-config_cache.php index eade175739..68e34ed80a 100644 --- a/inc/modules/admin/what-config_cache.php +++ b/inc/modules/admin/what-config_cache.php @@ -45,7 +45,7 @@ if (isset($_POST['ok'])) { $_POST['cache_tested'] = "N"; // Check if path has been changed - if ($_POST['cache_path'] != $_CONFIG['cache_path']) { + if ($_POST['cache_path'] != getConfig('cache_path')) { // Okay, cache path has been altered so we have to test it again! $_POST['cache_tested'] = "Y"; } @@ -77,115 +77,115 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Prepare data - switch ($_CONFIG['cache_admins']) { - case 'Y': + switch (getConfig('cache_admins')) { + case "Y": define('__ADMINS_Y', " checked=\"checked\""); define('__ADMINS_N', ""); break; - case 'N': + case "N": define('__ADMINS_Y', ""); define('__ADMINS_N', " checked=\"checked\""); break; } - switch ($_CONFIG['cache_acls']) { - case 'Y': + switch (getConfig('cache_acls')) { + case "Y": define('__ACLS_Y', " checked=\"checked\""); define('__ACLS_N', ""); break; - case 'N': + case "N": define('__ACLS_Y', ""); define('__ACLS_N', " checked=\"checked\""); break; } - switch ($_CONFIG['cache_exts']) { - case 'Y': + switch (getConfig('cache_exts')) { + case "Y": define('__EXTS_Y', " checked=\"checked\""); define('__EXTS_N', ""); break; - case 'N': + case "N": define('__EXTS_Y', ""); define('__EXTS_N', " checked=\"checked\""); break; } - switch ($_CONFIG['cache_config']) { - case 'Y': + switch (getConfig('cache_config')) { + case "Y": define('__CONFIG_Y', " checked=\"checked\""); define('__CONFIG_N', ""); break; - case 'N': + case "N": define('__CONFIG_Y', ""); define('__CONFIG_N', " checked=\"checked\""); break; } - switch ($_CONFIG['cache_modreg']) { - case 'Y': + switch (getConfig('cache_modreg')) { + case "Y": define('__MODREG_Y', " checked=\"checked\""); define('__MODREG_N', ""); break; - case 'N': + case "N": define('__MODREG_Y', ""); define('__MODREG_N', " checked=\"checked\""); break; } - switch ($_CONFIG['cache_refdepth']) { - case 'Y': + switch (getConfig('cache_refdepth')) { + case "Y": define('__REFDEPTH_Y', " checked=\"checked\""); define('__REFDEPTH_N', ""); break; - case 'N': + case "N": define('__REFDEPTH_Y', ""); define('__REFDEPTH_N', " checked=\"checked\""); break; } - switch ($_CONFIG['cache_refsys']) { - case 'Y': + switch (getConfig('cache_refsys')) { + case "Y": define('__REFSYS_Y', " checked=\"checked\""); define('__REFSYS_N', ""); break; - case 'N': + case "N": define('__REFSYS_Y', ""); define('__REFSYS_N', " checked=\"checked\""); break; } - switch ($_CONFIG['cache_themes']) { - case 'Y': + switch (getConfig('cache_themes')) { + case "Y": define('__THEMES_Y', " checked=\"checked\""); define('__THEMES_N', ""); break; - case 'N': + case "N": define('__THEMES_Y', ""); define('__THEMES_N', " checked=\"checked\""); break; } - switch ($_CONFIG['cache_admin_menu']) { - case 'Y': + switch (getConfig('cache_admin_menu')) { + case "Y": define('__ADMIN_MENU_Y', " checked=\"checked\""); define('__ADMIN_MENU_N', ""); break; - case 'N': + case "N": define('__ADMIN_MENU_Y', ""); define('__ADMIN_MENU_N', " checked=\"checked\""); break; } - define('__PATH', $_CONFIG['cache_path']); + define('__PATH', getConfig('cache_path')); // Load template LOAD_TEMPLATE("admin_config_cache"); diff --git a/inc/modules/admin/what-config_doubler.php b/inc/modules/admin/what-config_doubler.php index 2b3b5f54f2..185aae57c1 100644 --- a/inc/modules/admin/what-config_doubler.php +++ b/inc/modules/admin/what-config_doubler.php @@ -53,50 +53,50 @@ if (isset($_POST['ok'])) { } else { // Prepare data for the template // - Charge rate - define('__DOUBLER_CHARGE', TRANSLATE_COMMA(($_CONFIG['doubler_charge'] * 100), false)); + define('__DOUBLER_CHARGE', TRANSLATE_COMMA((getConfig('doubler_charge') * 100), false)); // - Referal rate - define('__DOUBLER_REFERRAL', TRANSLATE_COMMA(($_CONFIG['doubler_ref'] * 100), false)); + define('__DOUBLER_REFERRAL', TRANSLATE_COMMA((getConfig('doubler_ref') * 100), false)); // - Minimum points to double - define('__DOUBLER_MINIMUM', TRANSLATE_COMMA($_CONFIG['doubler_min'], false)); + define('__DOUBLER_MINIMUM', TRANSLATE_COMMA(getConfig('doubler_min'), false)); // - Maximum points to double - define('__DOUBLER_MAXIMUM', TRANSLATE_COMMA($_CONFIG['doubler_max'], false)); + define('__DOUBLER_MAXIMUM', TRANSLATE_COMMA(getConfig('doubler_max'), false)); // - Points left on users account after doubling - define('__DOUBLER_LEFT', TRANSLATE_COMMA($_CONFIG['doubler_left'], false)); + define('__DOUBLER_LEFT', TRANSLATE_COMMA(getConfig('doubler_left'), false)); // - Max payouts to check per click/reset - define('__DOUBLER_MAX_SENT', $_CONFIG['doubler_max_sent']); + define('__DOUBLER_MAX_SENT', getConfig('doubler_max_sent')); // - Group sending - define('__DOUBLER_GROUP_SENT', $_CONFIG['doubler_group_sent']); + define('__DOUBLER_GROUP_SENT', getConfig('doubler_group_sent')); // Take points from jackpot (Y/N) - switch ($_CONFIG['doubler_jackpot']) + switch (getConfig('doubler_jackpot')) { - case 'Y': + case "Y": define('__DOUBLER_JACKPOT_Y', " checked=\"checked\""); define('__DOUBLER_JACKPOT_N', ""); break; - case 'N': + case "N": define('__DOUBLER_JACKPOT_Y', ""); define('__DOUBLER_JACKPOT_N', " checked=\"checked\""); break; } // Take points from own account (Y/N) - switch ($_CONFIG['doubler_own']) + switch (getConfig('doubler_own')) { - case 'Y': + case "Y": define('__DOUBLER_OWN_Y', " checked=\"checked\""); define('__DOUBLER_OWN_N', ""); break; - case 'N': + case "N": define('__DOUBLER_OWN_Y', ""); define('__DOUBLER_OWN_N', " checked=\"checked\""); break; } // Mail send mode - switch ($_CONFIG['doubler_send_mode']) + switch (getConfig('doubler_send_mode')) { case "DIRECT": define('__DOUBLER_SEND_DIRECT', " checked=\"checked\""); @@ -110,29 +110,29 @@ if (isset($_POST['ok'])) { } // Take points from own account (Y/N) - switch ($_CONFIG['doubler_sent_all']) + switch (getConfig('doubler_sent_all')) { - case 'Y': + case "Y": define('__DOUBLER_SENT_ALL_Y', " checked=\"checked\""); define('__DOUBLER_SENT_ALL_N', ""); break; - case 'N': + case "N": define('__DOUBLER_SENT_ALL_Y', ""); define('__DOUBLER_SENT_ALL_N', " checked=\"checked\""); break; } // Transfer options (!!!) to __MEMBER_SELECTION - define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['doubler_uid'], false, true, true, "doubler_uid")); + define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('doubler_uid'), false, true, true, "doubler_uid")); // Number of rows to display (option lines!!!) - define('__DOUBLER_DISPLAY_NEW', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), $_CONFIG['doubler_display_new'])); - define('__DOUBLER_DISPLAY_PAY', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), $_CONFIG['doubler_display_pay'])); - define('__DOUBLER_DISPLAY_OLD', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), $_CONFIG['doubler_display_old'])); + define('__DOUBLER_DISPLAY_NEW', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_new'))); + define('__DOUBLER_DISPLAY_PAY', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_pay'))); + define('__DOUBLER_DISPLAY_OLD', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_old'))); // Timeout selection box or input box? - define('__DOUBLER_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['doubler_timeout'] , "doubler_timeout" , "WDh")); + define('__DOUBLER_TIMEOUT', CREATE_TIME_SELECTIONS(getConfig('doubler_timeout') , "doubler_timeout" , "WDh")); // Load template LOAD_TEMPLATE("admin_config_doubler"); diff --git a/inc/modules/admin/what-config_extensions.php b/inc/modules/admin/what-config_extensions.php index d79ef2e740..4bd20e5a69 100644 --- a/inc/modules/admin/what-config_extensions.php +++ b/inc/modules/admin/what-config_extensions.php @@ -45,13 +45,13 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Prepare data - switch ($_CONFIG['verbose_sql']) { - case 'Y': + switch (getConfig('verbose_sql')) { + case "Y": define('__VERBOSE_Y', " checked=\"checked\""); define('__VERBOSE_N', ""); break; - case 'N': + case "N": define('__VERBOSE_Y', ""); define('__VERBOSE_N', " checked=\"checked\""); break; diff --git a/inc/modules/admin/what-config_holiday.php b/inc/modules/admin/what-config_holiday.php index 58a557e14a..56f823b928 100644 --- a/inc/modules/admin/what-config_holiday.php +++ b/inc/modules/admin/what-config_holiday.php @@ -48,10 +48,10 @@ if (isset($_POST['ok'])) else { // Prepare constants for the template - define('__MAX_VALUE', $_CONFIG['holiday_max']); - define('__LOCKED' , CREATE_TIME_SELECTIONS($_CONFIG['holiday_lock'] , "holiday_lock" , "WDh")); + define('__MAX_VALUE', getConfig('holiday_max')); + define('__LOCKED' , CREATE_TIME_SELECTIONS(getConfig('holiday_lock') , "holiday_lock" , "WDh")); - switch ($_CONFIG['holiday_mode']) { + switch (getConfig('holiday_mode')) { case "RESET": define('__RESET_DEFAULT' , " checked=\"checked\""); define('__DIRECT_DEFAULT', ""); diff --git a/inc/modules/admin/what-config_home.php b/inc/modules/admin/what-config_home.php index 7c57c8882e..1cf4abc2e8 100644 --- a/inc/modules/admin/what-config_home.php +++ b/inc/modules/admin/what-config_home.php @@ -50,19 +50,16 @@ case "": // Output selection table break; case "settings": // Settings related to the index page - if (isset($_POST['ok'])) - { + if (isset($_POST['ok'])) { // Save settings ADMIN_SAVE_SETTINGS($_POST); OUTPUT_HTML("".ADMIN_CONTINUE_TO_CONFIG.""); - } - else - { + } else { // Prepare data for the template $content = array_fill(-1, 60, ""); - $content[$_CONFIG['index_delay']] = " selected=\"selected\""; + $content[getConfig('index_delay')] = " selected=\"selected\""; - define('__INDEX_COOKIE_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['index_cookie'], "index_cookie", "YMWD")); + define('__INDEX_COOKIE_SELECTION', CREATE_TIME_SELECTIONS(getConfig('index_cookie'), "index_cookie", "YMWD")); LOAD_TEMPLATE("admin_config_home_settings", false, $content); } break; @@ -71,7 +68,7 @@ case "target": // Set which what-file will be placed in home-page (only modules. if (isset($_GET['home'])) { // Set new home UPDATE_CONFIG("index_home", $_GET['home']); - $_CONFIG['index_home'] = SQL_ESCAPE($_GET['home']); + getConfig('index_home') = SQL_ESCAPE($_GET['home']); } // END - if // Load all what menu points @@ -84,7 +81,7 @@ ORDER BY sort ASC", __FILE__, __LINE__); while (list($id, $wht, $wtitle) = SQL_FETCHROW($result)) { $LINK = ""._IS_NEW_HOME.""; - if ($wht == $_CONFIG['index_home']) + if ($wht == getConfig('index_home')) { // Is current home $LINK = ""._IS_CURRENT_HOME.""; diff --git a/inc/modules/admin/what-config_mediadata.php b/inc/modules/admin/what-config_mediadata.php index 428d0f1cb3..2ea9b1b18d 100644 --- a/inc/modules/admin/what-config_mediadata.php +++ b/inc/modules/admin/what-config_mediadata.php @@ -77,10 +77,10 @@ if (isset($_POST['ok'])) else { // Start of this exchange - if ($_CONFIG['mt_start'] > 0) + if (getConfig('mt_start') > 0) { // Only show start - define('__MT_START', "".MAKE_DATETIME($_CONFIG['mt_start'], "3").""); + define('__MT_START', "".MAKE_DATETIME(getConfig('mt_start'), "3").""); } else { @@ -93,7 +93,7 @@ if (isset($_POST['ok'])) } // Next stage of this MT - define('__MT_STAGE', $_CONFIG['mt_stage']); + define('__MT_STAGE', getConfig('mt_stage')); // Load template LOAD_TEMPLATE("admin_config_mediadata"); diff --git a/inc/modules/admin/what-config_newsletter.php b/inc/modules/admin/what-config_newsletter.php index d8564cec27..d1ae33fc83 100644 --- a/inc/modules/admin/what-config_newsletter.php +++ b/inc/modules/admin/what-config_newsletter.php @@ -47,7 +47,7 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Prepare contants for the template - define('__CHARGE_VALUE' , TRANSLATE_COMMA($_CONFIG['nl_charge'], false)); + define('__CHARGE_VALUE' , TRANSLATE_COMMA(getConfig('nl_charge'), false)); // Prepare constants and load template LOAD_TEMPLATE("admin_config_newsletter", false); diff --git a/inc/modules/admin/what-config_order.php b/inc/modules/admin/what-config_order.php index 68489f219d..04febbd6ea 100644 --- a/inc/modules/admin/what-config_order.php +++ b/inc/modules/admin/what-config_order.php @@ -45,7 +45,7 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Prepare constants for the template - switch ($_CONFIG['order_max_full']) + switch (getConfig('order_max_full')) { case "ORDER": define('__ORDER_DEFAULT', " checked=\"checked\""); @@ -59,10 +59,10 @@ if (isset($_POST['ok'])) { } // Minimum mails / order - define('__MIN_VALUE', $_CONFIG['order_min']); + define('__MIN_VALUE', getConfig('order_min')); // Sorting mode (ascending / descending) - switch ($_CONFIG['order_mode']) + switch (getConfig('order_mode')) { case "ASC": define('__ASC_DEFAULT' , " selected=\"selected\""); @@ -76,10 +76,10 @@ if (isset($_POST['ok'])) { } // Transfer other config data into constants for the template (DO NOT set $_CONFIG as global in LOAD_TEMPLATE!!!) - define('_CFG_UNCONFIRMED' , $_CONFIG['unconfirmed']); - define('_CFG_MAX_TLENGTH' , $_CONFIG['max_tlength']); + define('_CFG_UNCONFIRMED' , getConfig('unconfirmed')); + define('_CFG_MAX_TLENGTH' , getConfig('max_tlength')); - if ($_CONFIG['test_text'] == "N") { + if (getConfig('test_text') == "N") { define('_CFG_TEST_TEXT_N', " checked=\"checked\""); define('_CFG_TEST_TEXT_Y', ""); } else { @@ -87,7 +87,7 @@ if (isset($_POST['ok'])) { define('_CFG_TEST_TEXT_Y', " checked=\"checked\""); } - switch ($_CONFIG['repay_deleted_mails']) { + switch (getConfig('repay_deleted_mails')) { case "REPAY": define('_CFG_REPAY_POINTS_REPAY' , " selected=\"selected\""); define('_CFG_REPAY_POINTS_JACKPOT', ""); @@ -107,7 +107,7 @@ if (isset($_POST['ok'])) { break; } - if ($_CONFIG['test_subj'] == "N") { + if (getConfig('test_subj') == "N") { define('_CFG_TEST_SUBJ_N', " checked=\"checked\""); define('_CFG_TEST_SUBJ_Y', ""); } else { @@ -115,7 +115,7 @@ if (isset($_POST['ok'])) { define('_CFG_TEST_SUBJ_Y', " checked=\"checked\""); } - if ($_CONFIG['url_blacklist'] == "N") { + if (getConfig('url_blacklist') == "N") { define('_CFG_URL_BLIST_N', " checked=\"checked\""); define('_CFG_URL_BLIST_Y', ""); } else { @@ -124,7 +124,7 @@ if (isset($_POST['ok'])) { } // Selection list - define('__ORDER_SELECT', ORDER_SELECT_OPTION_LIST($_CONFIG['order_select'])); + define('__ORDER_SELECT', ORDER_SELECT_OPTION_LIST(getConfig('order_select'))); // Load template LOAD_TEMPLATE("admin_config_order"); diff --git a/inc/modules/admin/what-config_other.php b/inc/modules/admin/what-config_other.php index ba171a2831..3b6d1266a0 100644 --- a/inc/modules/admin/what-config_other.php +++ b/inc/modules/admin/what-config_other.php @@ -75,30 +75,30 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Transfer config data into constants for the template (DO NOT set $_CONFIG as global in LOAD_TEMPLATE!!!) - define('_CFG_CODE_LENGTH' , $_CONFIG['code_length']); - define('_CFG_ACT_SYSTEM' , $_CONFIG['activate_xchange']); - define('_CFG_MAX_SEND' , $_CONFIG['max_send']); - define('_CFG_REJECT_URL' , $_CONFIG['reject_url']); - define('_CFG_MIN_AGE' , $_CONFIG['min_age']); + define('_CFG_CODE_LENGTH', getConfig('code_length')); + define('_CFG_ACT_SYSTEM' , getConfig('activate_xchange')); + define('_CFG_MAX_SEND' , getConfig('max_send')); + define('_CFG_REJECT_URL' , getConfig('reject_url')); + define('_CFG_MIN_AGE' , getConfig('min_age')); // Is there the pro-version function avaiable to create selection boxes instead of input boxes? if (function_exists('CREATE_TIME_SELECTIONS')) { // Only pro versions: time selection boxes - define('_CFG_ONLINE_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['online_timeout'], "ip_timeout" , "ms")); - define('_CFG_URL_TLOCK' , CREATE_TIME_SELECTIONS($_CONFIG['url_tlock'] , "url_tlock" , "WDh")); - define('_CFG_PROFILE_LOCK' , CREATE_TIME_SELECTIONS($_CONFIG['profile_lock'] , "profile_lock" , "WDh")); - define('_CFG_PROFILE_UPDATE', CREATE_TIME_SELECTIONS($_CONFIG['profile_update'], "profile_update" , "YM")); - define('_CFG_PROF_REUPDATE' , CREATE_TIME_SELECTIONS($_CONFIG['resend_profile_update'] , "resend_profile_update", "MWD")); + define('_CFG_ONLINE_TIMEOUT', CREATE_TIME_SELECTIONS(getConfig('online_timeout'), "ip_timeout" , "ms")); + define('_CFG_URL_TLOCK' , CREATE_TIME_SELECTIONS(getConfig('url_tlock') , "url_tlock" , "WDh")); + define('_CFG_PROFILE_LOCK' , CREATE_TIME_SELECTIONS(getConfig('profile_lock') , "profile_lock" , "WDh")); + define('_CFG_PROFILE_UPDATE', CREATE_TIME_SELECTIONS(getConfig('profile_update'), "profile_update" , "YM")); + define('_CFG_PROF_REUPDATE' , CREATE_TIME_SELECTIONS(getConfig('resend_profile_update') , "resend_profile_update", "MWD")); } else { // Normal input boxes - define('_CFG_ONLINE_TIMEOUT', " ("._SECONDS.")"); - define('_CFG_URL_TLOCK' , " ("._SECONDS.")"); - define('_CFG_PROFILE_LOCK' , " ("._SECONDS.")"); - define('_CFG_PROFILE_UPDATE', " ("._SECONDS.")"); - define('_CFG_PROF_REUPDATE' , " ("._SECONDS.")"); + define('_CFG_ONLINE_TIMEOUT', " ("._SECONDS.")"); + define('_CFG_URL_TLOCK' , " ("._SECONDS.")"); + define('_CFG_PROFILE_LOCK' , " ("._SECONDS.")"); + define('_CFG_PROFILE_UPDATE', " ("._SECONDS.")"); + define('_CFG_PROF_REUPDATE' , " ("._SECONDS.")"); } - if ($_CONFIG['order_multi_page'] == "N") { + if (getConfig('order_multi_page') == "N") { define('_CFG_ORDER_MULTI_N', " checked=\"checked\""); define('_CFG_ORDER_MULTI_Y', ""); } else { @@ -106,7 +106,7 @@ if (isset($_POST['ok'])) { define('_CFG_ORDER_MULTI_Y', " checked=\"checked\""); } - if ($_CONFIG['autosend_active'] == "N") { + if (getConfig('autosend_active') == "N") { define('_CFG_AUTOSEND_ACTIVE_N', " checked=\"checked\""); define('_CFG_AUTOSEND_ACTIVE_Y', ""); } else { @@ -114,7 +114,7 @@ if (isset($_POST['ok'])) { define('_CFG_AUTOSEND_ACTIVE_Y', " checked=\"checked\""); } - if ($_CONFIG['send_prof_update'] == "N") { + if (getConfig('send_prof_update') == "N") { define('_CFG_SEND_UPDATE_N', " checked=\"checked\""); define('_CFG_SEND_UPDATE_Y', ""); } else { @@ -122,7 +122,7 @@ if (isset($_POST['ok'])) { define('_CFG_SEND_UPDATE_Y', " checked=\"checked\""); } - if ($_CONFIG['admin_notify'] == "N") { + if (getConfig('admin_notify') == "N") { define('_CFG_ADMIN_NOTIFY_N', " checked=\"checked\""); define('_CFG_ADMIN_NOTIFY_Y', ""); } else { @@ -130,7 +130,7 @@ if (isset($_POST['ok'])) { define('_CFG_ADMIN_NOTIFY_Y', " checked=\"checked\""); } - if ($_CONFIG['css_php'] == "DIRECT") { + if (getConfig('css_php') == "DIRECT") { define('_CFG_CSS_PHP_DIRECT', " checked=\"checked\""); define('_CFG_CSS_PHP_FILE', ""); } else { @@ -138,7 +138,7 @@ if (isset($_POST['ok'])) { define('_CFG_CSS_PHP_FILE', " checked=\"checked\""); } - if ($_CONFIG['guest_menu'] == "Y") { + if (getConfig('guest_menu') == "Y") { define('_CFG_GUEST_MENU_ACTIVE', " checked=\"checked\""); define('_CFG_GUEST_MENU_INACTIVE', ""); } else { @@ -146,7 +146,7 @@ if (isset($_POST['ok'])) { define('_CFG_GUEST_MENU_INACTIVE', " checked=\"checked\""); } - if ($_CONFIG['member_menu'] == "Y") { + if (getConfig('member_menu') == "Y") { define('_CFG_MEMBER_MENU_ACTIVE', " checked=\"checked\""); define('_CFG_MEMBER_MENU_INACTIVE', ""); } else { @@ -154,7 +154,7 @@ if (isset($_POST['ok'])) { define('_CFG_MEMBER_MENU_INACTIVE', " checked=\"checked\""); } - if ($_CONFIG['youre_here'] == "Y") { + if (getConfig('youre_here') == "Y") { define('_CFG_YOURE_HERE_ACTIVE', " checked=\"checked\""); define('_CFG_YOURE_HERE_INACTIVE', ""); } else { @@ -162,7 +162,7 @@ if (isset($_POST['ok'])) { define('_CFG_YOURE_HERE_INACTIVE', " checked=\"checked\""); } - if ($_CONFIG['show_timings'] == "Y") { + if (getConfig('show_timings') == "Y") { define('_CFG_SHOW_TIMINGS_Y', " checked=\"checked\""); define('_CFG_SHOW_TIMINGS_N', ""); } else { @@ -170,7 +170,7 @@ if (isset($_POST['ok'])) { define('_CFG_SHOW_TIMINGS_N', " checked=\"checked\""); } - if ($_CONFIG['show_points_unconfirmed'] == "Y") { + if (getConfig('show_points_unconfirmed') == "Y") { define('_CFG_SHOW_POINTS_UNCONFIRMED_Y', " checked=\"checked\""); define('_CFG_SHOW_POINTS_UNCONFIRMED_N', ""); } else { @@ -178,7 +178,7 @@ if (isset($_POST['ok'])) { define('_CFG_SHOW_POINTS_UNCONFIRMED_N', " checked=\"checked\""); } - if ($_CONFIG['mailid_error_redirect'] == 'INDEX') { + if (getConfig('mailid_error_redirect') == 'INDEX') { define('_CFG_MAILID_REDIRECT_INDEX', " checked=\"checked\""); define('_CFG_MAILID_REDIRECT_REJECT', ""); } else { @@ -188,7 +188,7 @@ if (isset($_POST['ok'])) { for ($i = 0; $i <= 5; $i++) { $eval = "define('_COMMA_DEF_".$i."', \"\");"; - if ($_CONFIG['max_comma'] == $i) $eval = "define('_COMMA_DEF_".$i."', \" selected\");"; + if (getConfig('max_comma') == $i) $eval = "define('_COMMA_DEF_".$i."', ' selected=\"selected\"');"; eval($eval); } diff --git a/inc/modules/admin/what-config_points.php b/inc/modules/admin/what-config_points.php index 112a00992e..1e93a7ff51 100644 --- a/inc/modules/admin/what-config_points.php +++ b/inc/modules/admin/what-config_points.php @@ -118,13 +118,13 @@ WHERE config=0 LIMIT 1", $_POST['reg_points_mode'], $REF ); - if (($_CONFIG['ref_payout'] == 0) && ($_POST['ref_payout'] > 0)) + if ((getConfig('ref_payout') == 0) && ($_POST['ref_payout'] > 0)) { // Update account's ref_payout for "must-confirm" $SQL[] = sprintf("UPDATE `"._MYSQL_PREFIX."_user_data` SET ref_payout=(%s - mails_confirmed) WHERE mails_confirmed < %s", $REF, $REF); } - elseif (($_CONFIG['ref_payout'] > 0) && ($_POST['ref_payout'] == 0)) + elseif ((getConfig('ref_payout') > 0) && ($_POST['ref_payout'] == 0)) { // Update account's ref_payout for "not-must-confirm" $SQL[] = "UPDATE `"._MYSQL_PREFIX."_user_data` SET ref_payout=0 WHERE ref_payout > 0"; @@ -170,28 +170,28 @@ WHERE mails_confirmed < %s", $REF, $REF); { // Setup some settings like direct pay and so on // Including new add-mode for one-time referal bonus - switch ($_CONFIG['allow_direct_pay']) + switch (getConfig('allow_direct_pay')) { - case 'Y': + case "Y": define('__DIRECT_Y', " checked=\"checked\""); define('__DIRECT_N', ""); break; - case 'N': + case "N": define('__DIRECT_Y', ""); define('__DIRECT_N', " checked=\"checked\""); break; } // One-time referal bonus add-mode - switch ($_CONFIG['reg_points_mode']) + switch (getConfig('reg_points_mode')) { case "ref" : define('__MODE_REF', " checked=\"checked\""); define('__MODE_DIRECT', ""); break; case "direct": define('__MODE_REF', ""); define('__MODE_DIRECT', " checked=\"checked\""); break; } // Referal payout value - define('__REF_PAYOUT', round($_CONFIG['ref_payout'])); + define('__REF_PAYOUT', round(getConfig('ref_payout'))); // Load template LOAD_TEMPLATE("admin_config_point_settings"); @@ -294,8 +294,8 @@ WHERE mails_confirmed < %s", $REF, $REF); elseif ($_GET['sub'] == "points") { // First points for registration and other fixed points including new add-mode for one-time referal bonus... - define('P_REG_VALUE', $_CONFIG['points_register']); - define('P_REF_VALUE', $_CONFIG['points_ref']); + define('P_REG_VALUE', getConfig('points_register')); + define('P_REF_VALUE', getConfig('points_ref')); // Load templates LOAD_TEMPLATE("admin_config_sub_points"); diff --git a/inc/modules/admin/what-config_primera.php b/inc/modules/admin/what-config_primera.php index 873eea58e2..69afcbf6cd 100644 --- a/inc/modules/admin/what-config_primera.php +++ b/inc/modules/admin/what-config_primera.php @@ -42,7 +42,7 @@ ADD_DESCR("admin", __FILE__); if (isset($_POST['ok'])) { // First merge temporarily the new API data into the current config - $_CONFIG = array_merge($_CONFIG, $_POST); + $_CONFIG = merge_array($_CONFIG, $_POST); // Is the password set? if (isset($_POST['pass'])) { @@ -62,10 +62,11 @@ if (isset($_POST['ok'])) { } else { // Prepare data for template output $content = array( - 'min_payout' => bigintval($_CONFIG['primera_min_payout']), - 'min_withdraw' => bigintval($_CONFIG['primera_min_withdraw']), - 'api_name' => $_CONFIG['primera_api_name'], - 'api_md5' => $_CONFIG['primera_api_md5'] + 'min_payout' => bigintval(getConfig('primera_min_payout')), + 'min_withdraw' => bigintval(getConfig('primera_min_withdraw')), + 'api_name' => getConfig('primera_api_name'), + 'api_md5' => getConfig('primera_api_md5'), + 'refid' => getConfig('primera_refid') ); // Load template diff --git a/inc/modules/admin/what-config_proxy.php b/inc/modules/admin/what-config_proxy.php index 8eba046009..3a2f37ec31 100644 --- a/inc/modules/admin/what-config_proxy.php +++ b/inc/modules/admin/what-config_proxy.php @@ -52,10 +52,10 @@ if (isset($_POST['ok'])) { } else { // Prepare content $content = array( - 'proxy_host' => $_CONFIG['proxy_host'], - 'proxy_port' => $_CONFIG['proxy_port'], - 'proxy_username' => $_CONFIG['proxy_username'], - 'proxy_password' => $_CONFIG['proxy_password'], + 'proxy_host' => getConfig('proxy_host'), + 'proxy_port' => getConfig('proxy_port'), + 'proxy_username' => getConfig('proxy_username'), + 'proxy_password' => getConfig('proxy_password'), ); // Load template diff --git a/inc/modules/admin/what-config_refback.php b/inc/modules/admin/what-config_refback.php index 0b9c2cf3a6..3939a8c389 100644 --- a/inc/modules/admin/what-config_refback.php +++ b/inc/modules/admin/what-config_refback.php @@ -46,12 +46,12 @@ if (isset($_POST['ok'])) { } else { // Prepare content $content = array( - 'refback_min_perc' => bigintval($_CONFIG['refback_min_perc']), - 'refback_max_perc' => bigintval($_CONFIG['refback_max_perc']) + 'refback_min_perc' => bigintval(getConfig('refback_min_perc')), + 'refback_max_perc' => bigintval(getConfig('refback_max_perc')) ); // Add more content - switch ($_CONFIG['refback_enabled']) { + switch (getConfig('refback_enabled')) { case "Y": // Refback enabled $content['refback_enabled_y'] = " checked=\"checked\""; $content['refback_enabled_n'] = ""; diff --git a/inc/modules/admin/what-config_refid.php b/inc/modules/admin/what-config_refid.php index 7bc5d32eb0..e737934136 100644 --- a/inc/modules/admin/what-config_refid.php +++ b/inc/modules/admin/what-config_refid.php @@ -45,9 +45,9 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Prepare contants for the template - define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['def_refid'], false, true, true, "def_refid")); + define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('def_refid'), false, true, true, "def_refid")); - switch ($_CONFIG['refid_target']) { + switch (getConfig('refid_target')) { case "index": define('__DEF_RT_INDEX' , " selected=\"selected\""); define('__DEF_RT_REGISTER', ""); @@ -59,7 +59,7 @@ if (isset($_POST['ok'])) { break; } // END - switch - switch ($_CONFIG['select_user_zero_refid']) { + switch (getConfig('select_user_zero_refid')) { case "Y": define('__RAND_REFID_Y', " selected=\"selected\""); define('__RAND_REFID_N', ""); @@ -73,7 +73,7 @@ if (isset($_POST['ok'])) { // Prepare content $content = array( - 'user_min_confirmed' => $_CONFIG['user_min_confirmed'] + 'user_min_confirmed' => getConfig('user_min_confirmed') ); // Load template diff --git a/inc/modules/admin/what-config_reg.php b/inc/modules/admin/what-config_reg.php index d64d2aa869..f87b68fd31 100644 --- a/inc/modules/admin/what-config_reg.php +++ b/inc/modules/admin/what-config_reg.php @@ -1,73 +1,3 @@ diff --git a/inc/modules/admin/what-config_register2.php b/inc/modules/admin/what-config_register2.php index 78e3506a1d..0b66142186 100644 --- a/inc/modules/admin/what-config_register2.php +++ b/inc/modules/admin/what-config_register2.php @@ -49,12 +49,12 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Remember stuff in constants - define('LEAST_CATS_VALUE' , round($_CONFIG['least_cats'])); - define('__CFG_SHOW_REFID' , ADD_SELECTION("yn", $_CONFIG['display_refid'] , "display_refid")); - define('__TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['ip_timeout'] , "ip_timeout", "Dhm")); - define('__CFG_DBL_EMAIL' , ADD_SELECTION("yn", $_CONFIG['check_double_email'] , "check_double_email")); - define('__CFG_DBL_PASS' , ADD_SELECTION("yn", $_CONFIG['check_double_pass'] , "check_double_pass")); - define('__CFG_CAT_DEFAULT' , ADD_SELECTION("yn", $_CONFIG['register_default'], "register_default")); + define('LEAST_CATS_VALUE' , round(getConfig('least_cats'))); + define('__CFG_SHOW_REFID' , ADD_SELECTION("yn", getConfig('display_refid') , "display_refid")); + define('__TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS(getConfig('ip_timeout') , "ip_timeout", "Dhm")); + define('__CFG_DBL_EMAIL' , ADD_SELECTION("yn", getConfig('check_double_email') , "check_double_email")); + define('__CFG_DBL_PASS' , ADD_SELECTION("yn", getConfig('check_double_pass') , "check_double_pass")); + define('__CFG_CAT_DEFAULT' , ADD_SELECTION("yn", getConfig('register_default'), "register_default")); // Load normal template LOAD_TEMPLATE("admin_config_register2"); diff --git a/inc/modules/admin/what-config_removeip.php b/inc/modules/admin/what-config_removeip.php index bdd72a4888..3340076b32 100644 --- a/inc/modules/admin/what-config_removeip.php +++ b/inc/modules/admin/what-config_removeip.php @@ -45,103 +45,103 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Prepare data - switch ($_CONFIG['removeip_anon_ip']) { - case 'Y': + switch (getConfig('removeip_anon_ip')) { + case "Y": define('__CFG_REMOVEIP_ANON_IP_Y', " checked=\"checked\""); define('__CFG_REMOVEIP_ANON_IP_N', ""); break; - case 'N': + case "N": define('__CFG_REMOVEIP_ANON_IP_Y', ""); define('__CFG_REMOVEIP_ANON_IP_N', " checked=\"checked\""); break; } // END - switch - switch ($_CONFIG['removeip_anon_host']) { - case 'Y': + switch (getConfig('removeip_anon_host')) { + case "Y": define('__CFG_REMOVEIP_ANON_HOST_Y', " checked=\"checked\""); define('__CFG_REMOVEIP_ANON_HOST_N', ""); break; - case 'N': + case "N": define('__CFG_REMOVEIP_ANON_HOST_Y', ""); define('__CFG_REMOVEIP_ANON_HOST_N', " checked=\"checked\""); break; } // END - switch - switch ($_CONFIG['removeip_anon_ua']) { - case 'Y': + switch (getConfig('removeip_anon_ua')) { + case "Y": define('__CFG_REMOVEIP_ANON_UA_Y', " checked=\"checked\""); define('__CFG_REMOVEIP_ANON_UA_N', ""); break; - case 'N': + case "N": define('__CFG_REMOVEIP_ANON_UA_Y', ""); define('__CFG_REMOVEIP_ANON_UA_N', " checked=\"checked\""); break; } // END - switch - switch ($_CONFIG['removeip_anon_ref']) { - case 'Y': + switch (getConfig('removeip_anon_ref')) { + case "Y": define('__CFG_REMOVEIP_ANON_REF_Y', " checked=\"checked\""); define('__CFG_REMOVEIP_ANON_REF_N', ""); break; - case 'N': + case "N": define('__CFG_REMOVEIP_ANON_REF_Y', ""); define('__CFG_REMOVEIP_ANON_REF_N', " checked=\"checked\""); break; } // END - switch - switch ($_CONFIG['removeip_admin_show']) { - case 'Y': + switch (getConfig('removeip_admin_show')) { + case "Y": define('__CFG_REMOVEIP_ADMIN_SHOW_Y', " checked=\"checked\""); define('__CFG_REMOVEIP_ADMIN_SHOW_N', ""); break; - case 'N': + case "N": define('__CFG_REMOVEIP_ADMIN_SHOW_Y', ""); define('__CFG_REMOVEIP_ADMIN_SHOW_N', " checked=\"checked\""); break; } // END - switch - switch ($_CONFIG['removeip_guest_show']) { - case 'Y': + switch (getConfig('removeip_guest_show')) { + case "Y": define('__CFG_REMOVEIP_GUEST_SHOW_Y', " checked=\"checked\""); define('__CFG_REMOVEIP_GUEST_SHOW_N', ""); break; - case 'N': + case "N": define('__CFG_REMOVEIP_GUEST_SHOW_Y', ""); define('__CFG_REMOVEIP_GUEST_SHOW_N', " checked=\"checked\""); break; } // END - switch - switch ($_CONFIG['removeip_member_show']) { - case 'Y': + switch (getConfig('removeip_member_show')) { + case "Y": define('__CFG_REMOVEIP_MEMBER_SHOW_Y', " checked=\"checked\""); define('__CFG_REMOVEIP_MEMBER_SHOW_N', ""); break; - case 'N': + case "N": define('__CFG_REMOVEIP_MEMBER_SHOW_Y', ""); define('__CFG_REMOVEIP_MEMBER_SHOW_N', " checked=\"checked\""); break; } // END - switch - switch ($_CONFIG['removeip_sponsor_show']) { - case 'Y': + switch (getConfig('removeip_sponsor_show')) { + case "Y": define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', " checked=\"checked\""); define('__CFG_REMOVEIP_SPONSOR_SHOW_N', ""); break; - case 'N': + case "N": define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', ""); define('__CFG_REMOVEIP_SPONSOR_SHOW_N', " checked=\"checked\""); break; } // END - switch - switch ($_CONFIG['anonymous_ip']) { + switch (getConfig('anonymous_ip')) { case "127.0.0.1": define('__CFG_ANONYMOUS_IP_LOCAL' , " selected=\"selected\""); define('__CFG_ANONYMOUS_IP_ZERO' , ""); diff --git a/inc/modules/admin/what-config_rewrite.php b/inc/modules/admin/what-config_rewrite.php index f2f9ef8134..0beb356e45 100644 --- a/inc/modules/admin/what-config_rewrite.php +++ b/inc/modules/admin/what-config_rewrite.php @@ -66,7 +66,7 @@ if (isset($_POST['ok'])) { if (empty($title)) $title = "---"; // Already registered module? - if (ereg($mod, $_CONFIG['rewrite_skip'])) { + if (ereg($mod, getConfig('rewrite_skip'))) { // Found $y = " checked=\"checked\""; $n = ""; diff --git a/inc/modules/admin/what-config_secure.php b/inc/modules/admin/what-config_secure.php index 2f9e327ce6..e241ce7d65 100644 --- a/inc/modules/admin/what-config_secure.php +++ b/inc/modules/admin/what-config_secure.php @@ -39,11 +39,9 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { // Add description as navigation point ADD_DESCR("admin", __FILE__); -if (isset($_POST['ok'])) -{ +if (isset($_POST['ok'])) { // If salt length is empty or null then we shall generate new passwords - if (empty($_POST['salt_length']) || ($_POST['salt_length'] == "0")) - { + if (empty($_POST['salt_length']) || ($_POST['salt_length'] == "0")) { // Generate new passwords for all! require(PATH."/inc/gen_sql_patches.php"); @@ -52,18 +50,16 @@ if (isset($_POST['ok'])) // Redirect to logout link LOAD_URL("modules.php?module=admin&logout=1"); - } + } // END - if // Save settings ADMIN_SAVE_SETTINGS($_POST); -} - else -{ +} else { // Remember stuff in constants - define('__PASS_LEN' , $_CONFIG['pass_len']); + define('__PASS_LEN' , getConfig('pass_len')); // Password-salt length - define('__SALT_LENGTH', $_CONFIG['salt_length']); + define('__SALT_LENGTH', getConfig('salt_length')); // Load template LOAD_TEMPLATE("admin_config_secure"); diff --git a/inc/modules/admin/what-config_session.php b/inc/modules/admin/what-config_session.php index 1bd3b00661..79f9dd9666 100644 --- a/inc/modules/admin/what-config_session.php +++ b/inc/modules/admin/what-config_session.php @@ -52,7 +52,7 @@ if (isset($_POST['ok'])) { } else { // Prepare content $content = array( - 'session_save_path' => $_CONFIG['session_save_path'], + 'session_save_path' => getConfig('session_save_path'), ); // Load template diff --git a/inc/modules/admin/what-config_sponsor.php b/inc/modules/admin/what-config_sponsor.php index cdfaa8f280..ba900de273 100644 --- a/inc/modules/admin/what-config_sponsor.php +++ b/inc/modules/admin/what-config_sponsor.php @@ -49,8 +49,8 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Remember config data in constants for the template - define('__SPONSOR_MIN_POINTS', $_CONFIG['sponsor_min_points']); - define('__SPONSOR_REF_POINTS', $_CONFIG['sponsor_ref_points']); + define('__SPONSOR_MIN_POINTS', getConfig('sponsor_min_points')); + define('__SPONSOR_REF_POINTS', getConfig('sponsor_ref_points')); // Load template LOAD_TEMPLATE("admin_config_sponsor"); diff --git a/inc/modules/admin/what-config_stats.php b/inc/modules/admin/what-config_stats.php index 50e87881bc..dd24fbee6e 100644 --- a/inc/modules/admin/what-config_stats.php +++ b/inc/modules/admin/what-config_stats.php @@ -46,21 +46,21 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Guest stats - switch (strtolower($_CONFIG['guest_stats'])) + switch (getConfig('guest_stats')) { - case "members": + case "MEMBERS": define('__MEMBERS_RADIO', " checked selected"); define('__MODULES_RADIO', ""); define('__INACTIVE_RADIO', ""); break; - case "modules": + case "MODULES": define('__MEMBERS_RADIO', ""); define('__MODULES_RADIO', " checked selected"); define('__INACTIVE_RADIO', ""); break; - case "inactive": + case "INACTIVE": define('__MEMBERS_RADIO', ""); define('__MODULES_RADIO', ""); define('__INACTIVE_RADIO', " checked selected"); @@ -68,7 +68,7 @@ if (isset($_POST['ok'])) { } // Max stats entries per page - define('__STATS_LIMIT', $_CONFIG['stats_limit']); + define('__STATS_LIMIT', getConfig('stats_limit')); // Load template LOAD_TEMPLATE("admin_config_stats"); diff --git a/inc/modules/admin/what-config_surfbar.php b/inc/modules/admin/what-config_surfbar.php index 2d0d6d38ca..dcbea25333 100644 --- a/inc/modules/admin/what-config_surfbar.php +++ b/inc/modules/admin/what-config_surfbar.php @@ -52,23 +52,23 @@ if (isset($_POST['ok'])) { } else { // Prepare content $content = array( - 'surfbar_static_reward' => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']), - 'surfbar_static_costs' => TRANSLATE_COMMA($_CONFIG['surfbar_static_costs']), - 'surfbar_static_time' => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_static_time'] , "surfbar_static_time" , "ms" , "left"), - 'surfbar_static_lock' => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_static_lock'] , "surfbar_static_lock" , "hm" , "left"), - 'surfbar_restart_time' => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_restart_time'] , "surfbar_restart_time" , "ms" , "left"), - 'surfbar_dynamic_percent' => TRANSLATE_COMMA($_CONFIG['surfbar_dynamic_percent']), - 'surfbar_max_order' => $_CONFIG['surfbar_max_order'], - 'surfbar_stats_reload' => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_stats_reload'] , "surfbar_stats_reload" , "ms" , "left"), - 'surfbar_purge_deleted' => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_purge_deleted'] , "surfbar_purge_deleted" , "WDh", "left"), - 'surfbar_purge_migrated' => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_purge_migrated'], "surfbar_purge_migrated", "WDh", "left"), - 'surfbar_pause_url' => $_CONFIG['surfbar_pause_url'], - 'surfbar_warn_low_points' => $_CONFIG['surfbar_warn_low_points'], - 'surfbar_low_interval' => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_low_interval'] , "surfbar_low_interval" , "WDh", "left"), + 'surfbar_static_reward' => TRANSLATE_COMMA(getConfig('surfbar_static_reward')), + 'surfbar_static_costs' => TRANSLATE_COMMA(getConfig('surfbar_static_costs')), + 'surfbar_static_time' => CREATE_TIME_SELECTIONS(getConfig('surfbar_static_time') , "surfbar_static_time" , "ms" , "left"), + 'surfbar_static_lock' => CREATE_TIME_SELECTIONS(getConfig('surfbar_static_lock') , "surfbar_static_lock" , "hm" , "left"), + 'surfbar_restart_time' => CREATE_TIME_SELECTIONS(getConfig('surfbar_restart_time') , "surfbar_restart_time" , "ms" , "left"), + 'surfbar_dynamic_percent' => TRANSLATE_COMMA(getConfig('surfbar_dynamic_percent')), + 'surfbar_max_order' => getConfig('surfbar_max_order'), + 'surfbar_stats_reload' => CREATE_TIME_SELECTIONS(getConfig('surfbar_stats_reload') , "surfbar_stats_reload" , "ms" , "left"), + 'surfbar_purge_deleted' => CREATE_TIME_SELECTIONS(getConfig('surfbar_purge_deleted') , "surfbar_purge_deleted" , "WDh", "left"), + 'surfbar_purge_migrated' => CREATE_TIME_SELECTIONS(getConfig('surfbar_purge_migrated'), "surfbar_purge_migrated", "WDh", "left"), + 'surfbar_pause_url' => getConfig('surfbar_pause_url'), + 'surfbar_warn_low_points' => getConfig('surfbar_warn_low_points'), + 'surfbar_low_interval' => CREATE_TIME_SELECTIONS(getConfig('surfbar_low_interval') , "surfbar_low_interval" , "WDh", "left"), ); // Prepare payment model for template - if ($_CONFIG['surfbar_pay_model'] == "STATIC") { + if (getConfig('surfbar_pay_model') == "STATIC") { // Static model define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , " checked=\"checked\""); define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', ""); @@ -79,7 +79,7 @@ if (isset($_POST['ok'])) { } // Prepare auto-sart - if ($_CONFIG['surfbar_autostart'] == "Y") { + if (getConfig('surfbar_autostart') == "Y") { // Yes selected define('__CONFIG_SURFBAR_AUTOSTART_Y', " checked=\"checked\""); define('__CONFIG_SURFBAR_AUTOSTART_N', ""); @@ -90,7 +90,7 @@ if (isset($_POST['ok'])) { } // Prepare notify limits - if ($_CONFIG['surfbar_notify_limits'] == "Y") { + if (getConfig('surfbar_notify_limits') == "Y") { // Yes selected define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', " checked=\"checked\""); define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', ""); @@ -100,8 +100,19 @@ if (isset($_POST['ok'])) { define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', " checked=\"checked\""); } + // Prepare notify admin about unlocked emails + if (getConfig('surfbar_notify_admin_unlock') == "Y") { + // Yes selected + define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', " checked=\"checked\""); + define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', ""); + } else { + // No selected + define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', ""); + define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', " checked=\"checked\""); + } + // Prepare order migration - if ($_CONFIG['surfbar_migrate_order'] == "Y") { + if (getConfig('surfbar_migrate_order') == "Y") { // Yes selected define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', " checked=\"checked\""); define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', ""); @@ -112,7 +123,7 @@ if (isset($_POST['ok'])) { } // Pause URL mode - if ($_CONFIG['surfbar_pause_mode'] == "INTERNAL") { + if (getConfig('surfbar_pause_mode') == "INTERNAL") { // Internal pause page define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', " checked=\"checked\""); define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', ""); @@ -123,7 +134,7 @@ if (isset($_POST['ok'])) { } // Notification mode - if ($_CONFIG['surfbar_notification_mode'] == "INSTANT") { + if (getConfig('surfbar_notification_mode') == "INSTANT") { // Instant notification define('__CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', " selected=\"selected\""); define('__CONFIG_SURFBAR_NOTIFICATION_MODE_RESET' , ""); diff --git a/inc/modules/admin/what-config_title.php b/inc/modules/admin/what-config_title.php index 176cc48793..8ebb2a9335 100644 --- a/inc/modules/admin/what-config_title.php +++ b/inc/modules/admin/what-config_title.php @@ -48,12 +48,12 @@ if (isset($_POST['ok'])) else { // Remember config data in constants for the template - define('__CFG_TITLE_LEFT' , $_CONFIG['title_left']); - define('__CFG_TITLE_MIDDLE' , $_CONFIG['title_middle']); - define('__CFG_TITLE_RIGHT' , $_CONFIG['title_right']); - define('__CFG_TITLE_DECOS' , ADD_SELECTION("yn", $_CONFIG['enable_title_deco'], "enable_title_deco")); - define('__CFG_TITLE_MOD_SHOW' , ADD_SELECTION("yn", $_CONFIG['enable_mod_title'] , "enable_mod_title" )); - define('__CFG_TITLE_WHAT_SHOW', ADD_SELECTION("yn", $_CONFIG['enable_what_title'], "enable_what_title")); + define('__CFG_TITLE_LEFT' , getConfig('title_left')); + define('__CFG_TITLE_MIDDLE' , getConfig('title_middle')); + define('__CFG_TITLE_RIGHT' , getConfig('title_right')); + define('__CFG_TITLE_DECOS' , ADD_SELECTION("yn", getConfig('enable_title_deco'), "enable_title_deco")); + define('__CFG_TITLE_MOD_SHOW' , ADD_SELECTION("yn", getConfig('enable_mod_title') , "enable_mod_title" )); + define('__CFG_TITLE_WHAT_SHOW', ADD_SELECTION("yn", getConfig('enable_what_title'), "enable_what_title")); // Load template LOAD_TEMPLATE("admin_config_title"); diff --git a/inc/modules/admin/what-config_top10.php b/inc/modules/admin/what-config_top10.php index 018db8f184..4eeaf49ac6 100644 --- a/inc/modules/admin/what-config_top10.php +++ b/inc/modules/admin/what-config_top10.php @@ -48,7 +48,7 @@ if (isset($_POST['ok'])) else { // Prepare constants for the template - define('__MAX_VALUE', $_CONFIG['top10_max']); + define('__MAX_VALUE', getConfig('top10_max')); // Load form template LOAD_TEMPLATE("admin_config_top10"); diff --git a/inc/modules/admin/what-config_transfer.php b/inc/modules/admin/what-config_transfer.php index 2c6165ca32..5e6e755869 100644 --- a/inc/modules/admin/what-config_transfer.php +++ b/inc/modules/admin/what-config_transfer.php @@ -46,26 +46,26 @@ if (isset($_POST['ok'])) { } // Prepare constants for template -define('__TRANS_MAX_VALUE' , $_CONFIG['transfer_max']); -define('__TRANS_BALANCE_VALUE', $_CONFIG['transfer_balance']); -define('__TRANS_CODE_VALUE' , $_CONFIG['transfer_code']); +define('__TRANS_MAX_VALUE' , bigintval(getConfig('transfer_max'))); +define('__TRANS_BALANCE_VALUE', bigintval(getConfig('transfer_balance'))); +define('__TRANS_CODE_VALUE' , bigintval(getConfig('transfer_code'))); // Autppurge expired transfer entries? -switch ($_CONFIG['autopurge_inactive']) { - case 'Y': +switch (getConfig('ap_transfer')) { + case "Y": define('__YES_AP', " selected=\"selected\""); define('__NO_AP', ""); break; - case 'N': + case "N": define('__YES_AP', ""); define('__NO_AP', " selected=\"selected\""); break; } // Time selection box -define('__TRANS_AGE_SELECTION' , CREATE_TIME_SELECTIONS($_CONFIG['transfer_age'], "transfer_age", "MWDh")); -define('__TRANS_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['transfer_timeout'], "transfer_timeout", "MWDh")); +define('__TRANS_AGE_SELECTION' , CREATE_TIME_SELECTIONS(getConfig('transfer_age'), "transfer_age", "MWDh")); +define('__TRANS_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS(getConfig('transfer_timeout'), "transfer_timeout", "MWDh")); // Load template LOAD_TEMPLATE("admin_config_transfer"); diff --git a/inc/modules/admin/what-config_user.php b/inc/modules/admin/what-config_user.php index f2fcbbcbc2..62df2811ff 100644 --- a/inc/modules/admin/what-config_user.php +++ b/inc/modules/admin/what-config_user.php @@ -44,8 +44,8 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Prepare constants for the template - define('__LIMIT_VALUE', $_CONFIG['user_limit']); - define('__ALPHA_VALUE', $_CONFIG['user_alpha']); + define('__LIMIT_VALUE', getConfig('user_limit')); + define('__ALPHA_VALUE', getConfig('user_alpha')); // Load form template LOAD_TEMPLATE("admin_config_user"); diff --git a/inc/modules/admin/what-config_wernis.php b/inc/modules/admin/what-config_wernis.php index 887d56bc17..3e79f811a4 100644 --- a/inc/modules/admin/what-config_wernis.php +++ b/inc/modules/admin/what-config_wernis.php @@ -42,7 +42,7 @@ ADD_DESCR("admin", __FILE__); if (isset($_POST['ok'])) { // First merge temporarily the new API data into the current config - $_CONFIG = array_merge($_CONFIG, $_POST); + $_CONFIG = merge_array($_CONFIG, $_POST); // Let's test the API first (hold your horses here, cowboy! Thank you. :) ) if (WERNIS_TEST_API()) { @@ -64,22 +64,22 @@ if (isset($_POST['ok'])) { } else { // Prepare data for template output $content = array( - 'min_payout' => bigintval($_CONFIG['wernis_min_payout']), - 'min_withdraw' => bigintval($_CONFIG['wernis_min_withdraw']), - 'api_id' => bigintval($_CONFIG['wernis_api_id']), - 'api_md5' => $_CONFIG['wernis_api_md5'], - 'api_url' => $_CONFIG['wernis_api_url'], - 'refid' => bigintval($_CONFIG['wernis_refid']), - 'payout_factor' => TRANSLATE_COMMA($_CONFIG['wernis_payout_factor']), - 'withdraw_factor' => TRANSLATE_COMMA($_CONFIG['wernis_withdraw_factor']), - 'payout_fee_percent' => TRANSLATE_COMMA($_CONFIG['wernis_payout_fee_percent']), - 'withdraw_fee_percent' => TRANSLATE_COMMA($_CONFIG['wernis_withdraw_fee_percent']), - 'payout_fee_fix' => bigintval($_CONFIG['wernis_payout_fee_fix']), - 'withdraw_fee_fix' => bigintval($_CONFIG['wernis_withdraw_fee_fix']) + 'min_payout' => bigintval(getConfig('wernis_min_payout')), + 'min_withdraw' => bigintval(getConfig('wernis_min_withdraw')), + 'api_id' => bigintval(getConfig('wernis_api_id')), + 'api_md5' => getConfig('wernis_api_md5'), + 'api_url' => getConfig('wernis_api_url'), + 'refid' => bigintval(getConfig('wernis_refid')), + 'payout_factor' => TRANSLATE_COMMA(getConfig('wernis_payout_factor')), + 'withdraw_factor' => TRANSLATE_COMMA(getConfig('wernis_withdraw_factor')), + 'payout_fee_percent' => TRANSLATE_COMMA(getConfig('wernis_payout_fee_percent')), + 'withdraw_fee_percent' => TRANSLATE_COMMA(getConfig('wernis_withdraw_fee_percent')), + 'payout_fee_fix' => bigintval(getConfig('wernis_payout_fee_fix')), + 'withdraw_fee_fix' => bigintval(getConfig('wernis_withdraw_fee_fix')) ); // Prepare payout Y/N selection - if ($_CONFIG['wernis_payout_active'] == "Y") { + if (getConfig('wernis_payout_active') == "Y") { // Payout allowed define('__CFG_WERNIS_PAYOUT_ACTIVE_Y', " checked=\"checked\""); define('__CFG_WERNIS_PAYOUT_ACTIVE_N', ""); @@ -90,7 +90,7 @@ if (isset($_POST['ok'])) { } // Prepare withdraw Y/N selection - if ($_CONFIG['wernis_withdraw_active'] == "Y") { + if (getConfig('wernis_withdraw_active') == "Y") { // Payout allowed define('__CFG_WERNIS_WITHDRAW_ACTIVE_Y', " checked=\"checked\""); define('__CFG_WERNIS_WITHDRAW_ACTIVE_N', ""); diff --git a/inc/modules/admin/what-config_yoomedia.php b/inc/modules/admin/what-config_yoomedia.php index e93cc9bb4a..b50caf3a30 100644 --- a/inc/modules/admin/what-config_yoomedia.php +++ b/inc/modules/admin/what-config_yoomedia.php @@ -56,17 +56,17 @@ if (isset($_POST['ok'])) { } else { // Prepare content $content = array( - 'yoomedia_id' => bigintval($_CONFIG['yoomedia_id']), - 'yoomedia_sid' => bigintval($_CONFIG['yoomedia_sid']), - 'yoomedia_passwd' => $_CONFIG['yoomedia_passwd'], - 'yoomedia_tm_max_reload' => bigintval($_CONFIG['yoomedia_tm_max_reload']), - 'yoomedia_tm_min_wait' => bigintval($_CONFIG['yoomedia_tm_min_wait']), - 'yoomedia_tm_clicks_remain' => bigintval($_CONFIG['yoomedia_tm_clicks_remain']), - 'yoomedia_tm_min_pay' => bigintval($_CONFIG['yoomedia_tm_min_pay']) + 'yoomedia_id' => bigintval(getConfig('yoomedia_id')), + 'yoomedia_sid' => bigintval(getConfig('yoomedia_sid')), + 'yoomedia_passwd' => getConfig('yoomedia_passwd'), + 'yoomedia_tm_max_reload' => bigintval(getConfig('yoomedia_tm_max_reload')), + 'yoomedia_tm_min_wait' => bigintval(getConfig('yoomedia_tm_min_wait')), + 'yoomedia_tm_clicks_remain' => bigintval(getConfig('yoomedia_tm_clicks_remain')), + 'yoomedia_tm_min_pay' => bigintval(getConfig('yoomedia_tm_min_pay')) ); // Erotic? - switch ($_CONFIG['yoomedia_erotic_allowed']) { + switch (getConfig('yoomedia_erotic_allowed')) { case 0: // No erotic at all define('__CFG_YOOMEDIA_EROTIC_NONE' , " selected=\"selected\""); define('__CFG_YOOMEDIA_EROTIC_INCLUDE', ""); diff --git a/inc/modules/admin/what-del_email.php b/inc/modules/admin/what-del_email.php index 13d4b6ef0f..10ddba988c 100644 --- a/inc/modules/admin/what-del_email.php +++ b/inc/modules/admin/what-del_email.php @@ -94,11 +94,11 @@ WHERE s.pool_id=%s LIMIT 1", $totalPoints = $links * $price; // Shall we pay the points back to the user? - if ($_CONFIG['repay_deleted_mails'] != 'SHRED') { + if (getConfig('repay_deleted_mails') != "SHRED") { //* DEBUG: */ echo $stats_id.":".$totalPoints."/".$links."/".$price."
\n"; if ($totalPoints > 0) { // Shall we payback to user or jackpot? - if ($_CONFIG['repay_deleted_mails'] == "JACKPOT") { + if (getConfig('repay_deleted_mails') == "JACKPOT") { // Set jackpot $sender = 0; } // END - if @@ -108,7 +108,7 @@ WHERE s.pool_id=%s LIMIT 1", ADD_POINTS_REFSYSTEM("mail_deleted", $sender, $totalPoints, true, "0", false,"direct"); // Output message - if ($_CONFIG['repay_deleted_mails'] == 'REPAY') { + if (getConfig('repay_deleted_mails') == "REPAY") { // Repayed LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_POINTS_REPAYED, TRANSLATE_COMMA($totalPoints) diff --git a/inc/modules/admin/what-email_archiv.php b/inc/modules/admin/what-email_archiv.php index 2eb11fb039..e67b4c3a40 100644 --- a/inc/modules/admin/what-email_archiv.php +++ b/inc/modules/admin/what-email_archiv.php @@ -54,7 +54,7 @@ $result_normal = SQL_QUERY($SQL, __FILE__, __LINE__); // Set offset an current page to default values if (empty($_GET['page'])) $_GET['page'] = "1"; -if (empty($_GET['offset'])) $_GET['offset'] = $_CONFIG['mails_page']; +if (empty($_GET['offset'])) $_GET['offset'] = getConfig('mails_page'); // Add limitation to SQL string $SQL .= " LIMIT ".($_GET['offset'] * $_GET['page'] - $_GET['offset']).", ".$_GET['offset']; @@ -63,7 +63,7 @@ $SQL .= " LIMIT ".($_GET['offset'] * $_GET['page'] - $_GET['offset']).", ".$_GET $result = SQL_QUERY($SQL, __FILE__, __LINE__); // Calculate pages -$PAGES = round(SQL_NUMROWS($result_normal) / $_CONFIG['mails_page'] + 0.5); +$PAGES = round(SQL_NUMROWS($result_normal) / getConfig('mails_page') + 0.5); SQL_FREERESULT($result_normal); if (SQL_NUMROWS($result) > 0) @@ -73,8 +73,8 @@ if (SQL_NUMROWS($result) > 0) // Add navigation table rows if ($PAGES > 1) { - define('__TOP_EMAIL_NAV' , ADD_EMAIL_NAV($PAGES, $_CONFIG['mails_page'], true , "3", true)); - define('__BOTTOM_EMAIL_NAV', ADD_EMAIL_NAV($PAGES, $_CONFIG['mails_page'], false, "3", true)); + define('__TOP_EMAIL_NAV' , ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), true , "3", true)); + define('__BOTTOM_EMAIL_NAV', ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true)); } else { diff --git a/inc/modules/admin/what-email_details.php b/inc/modules/admin/what-email_details.php index ee06841fda..1795e056ab 100644 --- a/inc/modules/admin/what-email_details.php +++ b/inc/modules/admin/what-email_details.php @@ -98,7 +98,7 @@ $result_normal = SQL_QUERY($SQL, __FILE__, __LINE__); // Set offset an current page to default values if (empty($_GET['page'])) $_GET['page'] = "1"; -if (empty($_GET['offset'])) $_GET['offset'] = $_CONFIG['mails_page']; +if (empty($_GET['offset'])) $_GET['offset'] = getConfig('mails_page'); // Add limitation to SQL string if (empty($_GET['mid'])) @@ -118,7 +118,7 @@ $result_list = SQL_QUERY($SQL, __FILE__, __LINE__); if ((!empty($SQL2)) && ($WHO == _ALL)) $result_bonus = SQL_QUERY($SQL2, __FILE__, __LINE__); // Calculate pages -$PAGES = round(SQL_NUMROWS($result_normal) / $_CONFIG['mails_page'] + 0.3); +$PAGES = round(SQL_NUMROWS($result_normal) / getConfig('mails_page') + 0.3); SQL_FREERESULT($result_normal); $MAIL = false; @@ -166,7 +166,7 @@ if (SQL_NUMROWS($result_list) > 0) { // Add navigation (with change box and colspan=3) $content['nav'] = ""; - if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, $_CONFIG['mails_page'], false, "3", true); + if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true); // Prepare content $content['rows'] = $OUT; @@ -186,7 +186,7 @@ if ((EXT_IS_ACTIVE("bonus")) && ($WHO == _ALL)) { // Load bonus mails only when extension is active if (SQL_NUMROWS($result_bonus) > 0) { // Calculate pages - $PAGES = round(SQL_NUMROWS($result_bonus) / $_CONFIG['mails_page'] + 0.5); + $PAGES = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5); // List emails $OUT = ""; $content = array(); @@ -215,7 +215,7 @@ if ((EXT_IS_ACTIVE("bonus")) && ($WHO == _ALL)) { // Add navigation (without change box but with colspan=3) $content['nav'] = ""; - if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, $_CONFIG['mails_page'], false, "3", true); + if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true); // Prepare content $content['rows'] = $OUT; diff --git a/inc/modules/admin/what-extensions.php b/inc/modules/admin/what-extensions.php index 204d1974b2..d1d373d2ba 100644 --- a/inc/modules/admin/what-extensions.php +++ b/inc/modules/admin/what-extensions.php @@ -93,8 +93,8 @@ if (!empty($_GET['reg_ext'])) { // Run SQLs on activation / deactivation switch ($active) { - case 'Y': $EXT_LOAD_MODE = "activate"; break; - case 'N': $EXT_LOAD_MODE = "deactivate"; break; + case "Y": $EXT_LOAD_MODE = "activate"; break; + case "N": $EXT_LOAD_MODE = "deactivate"; break; } // Run embeded SQL commands @@ -163,7 +163,7 @@ if (!empty($_GET['reg_ext'])) { // Get extension name $ext_name = GET_EXT_NAME($ext_id); - if ($_CONFIG['verbose_sql'] == "Y") { + if (getConfig('verbose_sql') == "Y") { // Load SQL commands in remove mode if (LOAD_EXTENSION($ext_name, "remove", "", true)) { // Generate extra table with loaded SQL commands diff --git a/inc/modules/admin/what-list_autopurge.php b/inc/modules/admin/what-list_autopurge.php index 28eb8c2419..855f4236c0 100644 --- a/inc/modules/admin/what-list_autopurge.php +++ b/inc/modules/admin/what-list_autopurge.php @@ -42,14 +42,14 @@ ADD_DESCR("admin", __FILE__); // Exclude default referal id if set $EXCLUDE_LIST = ""; -if ($_CONFIG['def_refid'] > 0) { - $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid'].""; +if (getConfig('def_refid') > 0) { + $EXCLUDE_LIST = " AND d.userid != ".getConfig('def_refid').""; } // END - if // Check for more extensions -if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['beg_uid'].""; -if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['bonus_uid'].""; -if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['doubler_uid'].""; +if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_uid').""; +if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_uid').""; +if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_uid').""; if (GET_EXT_VERSION("holiday") >= "0.1.3") $EXCLUDE_LIST .= " AND d.holiday_active='N'"; // Check for all accounts @@ -57,7 +57,7 @@ $result = SQL_QUERY_ESC("SELECT DISTINCT d.userid, d.gender, d.surname, d.family FROM `"._MYSQL_PREFIX."_user_data` AS d WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - %s) AND d.last_online < (UNIX_TIMESTAMP() - %s) AND d.ap_notified < (UNIX_TIMESTAMP() - %s) ".$EXCLUDE_LIST." -ORDER BY d.userid", array($_CONFIG['ap_inactive_since'], $_CONFIG['ap_inactive_since'], $_CONFIG['ap_inactive_since']), __FILE__, __LINE__); +ORDER BY d.userid", array(getConfig('ap_inactive_since'), getConfig('ap_inactive_since'), getConfig('ap_inactive_since')), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { diff --git a/inc/modules/admin/what-list_beg.php b/inc/modules/admin/what-list_beg.php index 5fb3f71b9f..61ef7cfb55 100644 --- a/inc/modules/admin/what-list_beg.php +++ b/inc/modules/admin/what-list_beg.php @@ -39,27 +39,24 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { // Add description as navigation point ADD_DESCR("admin", __FILE__); -if ($_CONFIG['beg_rallye'] == "Y") -{ +if (getConfig('beg_rallye') == "Y") { // Shall I withdraw now? - if (isset($_POST['withdraw'])) - { + if (isset($_POST['withdraw'])) { // Okay, let's prepare... $curr = date("m", time()) - 1; if (strlen($curr) == 1) $curr = "0".$curr; UPDATE_CONFIG("last_month", $curr); LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BEG_WITHDRAW_PREPARED); OUTPUT_HTML("
"); - } + } // END - if // Autopurge installed? $LAST = "%s"; $ONLINE = ""; - if (EXT_IS_ACTIVE("autopurge")) - { + if (EXT_IS_ACTIVE("autopurge")) { // Use last online timestamp to keep inactive members away from here $LAST = " AND last_online >= (UNIX_TIMESTAMP() - %s)"; - $ONLINE = $_CONFIG['ap_inactive_since']; - } + $ONLINE = getConfig('ap_inactive_since'); + } // END - if // Check if at least one is in the active rallye $result = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, beg_points, last_online @@ -68,20 +65,19 @@ WHERE status='CONFIRMED' AND beg_points > 0".$LAST." ORDER BY beg_points DESC, last_online DESC, userid", array($ONLINE), __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) - { + if (SQL_NUMROWS($result) > 0) { // List users $OUT = "";$SW = 2; $cnt = 1; $total = 0; - while(list($uid, $email, $gender, $sname, $fname, $turbo, $last) = SQL_FETCHROW($result)) - { - // Generate array fore the dynamic template + while(list($uid, $email, $gender, $sname, $fname, $turbo, $last) = SQL_FETCHROW($result)) { + // Init variables $WIN1 = ""; $WIN2 = ""; - if ($cnt <= $_CONFIG['beg_ranks']) - { + if ($cnt <= getConfig('beg_ranks')) { // Maybe he can win his active beg? $WIN1 = ""; $WIN2 = ""; - } + } // END - if + + // Prepare content $content = array( 'uid' => $uid, 'email' => CREATE_EMAIL_LINK($email, "user_data"), @@ -104,35 +100,28 @@ ORDER BY beg_points DESC, last_online DESC, userid", define('__TOTAL', TRANSLATE_COMMA($total)); // Check if we need to display form or not with manuel withdraw - if ($_CONFIG['last_month'] == date("m", time())) - { + if (getConfig('last_month') == date("m", time())) { // Load form define('__BEG_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_beg_form", true)); - } - else - { + } else { // Display message "no manual withdraw possible" define('__BEG_WITHDRAW_FORM', "".ADMIN_BEG_ALREADY_WITHDRAW.""); } // Prepare constant for timemark if (EXT_IS_ACTIVE("autopurge")) { - define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - $_CONFIG['ap_inactive_since'], "2")); + define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - getConfig('ap_inactive_since'), "2")); } else { define('__AUTOPURGE_TIMEOUT', sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "autopurge")); } // Load final template LOAD_TEMPLATE("admin_list_beg"); - } - else - { + } else { // No one has joined the begging rallye... LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BEG_NO_RALLYE); } -} - else -{ +} else { // Rallye deactivated LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BEG_RALLYE_DEACTIVATED); } diff --git a/inc/modules/admin/what-list_bonus.php b/inc/modules/admin/what-list_bonus.php index 88fe74fd79..6796a44b64 100644 --- a/inc/modules/admin/what-list_bonus.php +++ b/inc/modules/admin/what-list_bonus.php @@ -40,7 +40,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { // Add description as navigation point ADD_DESCR("admin", __FILE__); -if ($_CONFIG['bonus_active'] == "Y") { +if (getConfig('bonus_active') == "Y") { // Shall I withdraw now? if (isset($_POST['withdraw'])) { // Okay, let's prepare... @@ -54,11 +54,11 @@ if ($_CONFIG['bonus_active'] == "Y") { if (GET_EXT_VERSION("bonus") >= "0.6.9") { // Add more bonus points here $USE = "(0"; - if ($_CONFIG['bonus_click_yn'] == "Y") $USE .= " + turbo_bonus"; - if ($_CONFIG['bonus_login_yn'] == "Y") $USE .= " + login_bonus"; - if ($_CONFIG['bonus_order_yn'] == "Y") $USE .= " + bonus_order"; - if ($_CONFIG['bonus_stats_yn'] == "Y") $USE .= " + bonus_stats"; - if ($_CONFIG['bonus_ref_yn'] == "Y") $USE .= " + bonus_ref"; + if (getConfig('bonus_click_yn') == "Y") $USE .= " + turbo_bonus"; + if (getConfig('bonus_login_yn') == "Y") $USE .= " + login_bonus"; + if (getConfig('bonus_order_yn') == "Y") $USE .= " + bonus_order"; + if (getConfig('bonus_stats_yn') == "Y") $USE .= " + bonus_stats"; + if (getConfig('bonus_ref_yn') == "Y") $USE .= " + bonus_ref"; $USE .= ")"; } else { // Old version ??? @@ -70,7 +70,7 @@ if ($_CONFIG['bonus_active'] == "Y") { if (EXT_IS_ACTIVE("autopurge")) { // Use last online timestamp to keep inactive members away from here $LAST = " AND last_online >= (UNIX_TIMESTAMP() - %s)"; - $ONLINE = $_CONFIG['ap_inactive_since']; + $ONLINE = getConfig('ap_inactive_since'); } // Check if at least one is in the active rallye @@ -89,7 +89,7 @@ ORDER BY points DESC, last_online DESC, userid", // Generate array fore the dynamic template $WIN1 = ""; $WIN2 = ""; - if ($cnt <= $_CONFIG['bonus_ranks']) { + if ($cnt <= getConfig('bonus_ranks')) { // Maybe he can win his active bonus? $WIN1 = ""; $WIN2 = ""; @@ -114,35 +114,28 @@ ORDER BY points DESC, last_online DESC, userid", define('__TOTAL', TRANSLATE_COMMA($total)); // Check if we need to display form or not with manuel withdraw - if ($_CONFIG['last_month'] == date("m", time())) - { + if (getConfig('last_month') == date("m", time())) { // Load form define('__BONUS_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_bonus_form", true)); - } - else - { + } else { // Display message "no manual withdraw possible" define('__BONUS_WITHDRAW_FORM', "".ADMIN_BONUS_ALREADY_WITHDRAW.""); } // Prepare constant for timemark if (EXT_IS_ACTIVE("autopurge")) { - define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - $_CONFIG['ap_inactive_since'], "2")); + define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - getConfig('ap_inactive_since'), "2")); } else { define('__AUTOPURGE_TIMEOUT', sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "autopurge")); } // Load final template LOAD_TEMPLATE("admin_list_bonus"); - } - else - { + } else { // No one has become an "activity bonus"... LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_NO_ACTIVE_RALLYE); } -} - else -{ +} else { // Aktive-Rallye not activated LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_RALLYE_DEACTIVATED); } diff --git a/inc/modules/admin/what-list_notifications.php b/inc/modules/admin/what-list_notifications.php index c333c2d346..a7e3bbf1ba 100644 --- a/inc/modules/admin/what-list_notifications.php +++ b/inc/modules/admin/what-list_notifications.php @@ -46,7 +46,7 @@ $SQL2 = ""; // Set offset an current page to default values if (empty($_GET['page'])) $_GET['page'] = "1"; -if (empty($_GET['offset'])) $_GET['offset'] = $_CONFIG['mails_page']; +if (empty($_GET['offset'])) $_GET['offset'] = getConfig('mails_page'); if ((EXT_IS_ACTIVE("bonus")) && ($WHO == _ALL)) { // Bonus mails sent by you @@ -75,7 +75,7 @@ if ((EXT_IS_ACTIVE("bonus")) && (SQL_NUMROWS($result_max) > 0) && (!empty($SQL2) // Load bonus mails only when extension is active if (SQL_NUMROWS($result_bonus) > 0) { // Calculate pages - $PAGES = round(SQL_NUMROWS($result_bonus) / $_CONFIG['mails_page'] + 0.5); + $PAGES = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5); // List emails $OUT = ""; $content = array(); @@ -104,7 +104,7 @@ if ((EXT_IS_ACTIVE("bonus")) && (SQL_NUMROWS($result_max) > 0) && (!empty($SQL2) // Add navigation (without change box but with colspan=3) $content['nav'] = ""; - if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, $_CONFIG['mails_page'], false, "3", true); + if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true); // Prepare content $content['rows'] = $OUT; diff --git a/inc/modules/admin/what-list_payouts.php b/inc/modules/admin/what-list_payouts.php index 5b90adfd98..de61dd27e9 100644 --- a/inc/modules/admin/what-list_payouts.php +++ b/inc/modules/admin/what-list_payouts.php @@ -40,8 +40,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { // Add description as navigation point ADD_DESCR("admin", __FILE__); -if (!empty($_GET['pid'])) -{ +if (!empty($_GET['pid'])) { // First let's get the member's ID $result = SQL_QUERY_ESC("SELECT userid, target_account, payout_total, payout_timestamp, password FROM "._MYSQL_PREFIX."_user_payouts WHERE id=%s LIMIT 1", array($_GET['pid']), __FILE__, __LINE__); @@ -74,27 +73,23 @@ if (!empty($_GET['pid'])) // Konstante bauen define('PAYOUT_USERDATA_VALUE', "".TRANSLATE_GENDER($gender)." ".$surname." ".$family.""); - if (($_GET['do'] == "accept") && (!empty($email))) - { + if (($_GET['do'] == "accept") && (!empty($email))) { // Ok, now we can output the form or execute accepting - if (isset($_POST['ok'])) - { + if (isset($_POST['ok'])) { // Obtain payout type and other data $result = SQL_QUERY_ESC("SELECT payout_id FROM "._MYSQL_PREFIX."_user_payouts WHERE id=%s LIMIT 1", array(bigintval($_GET['pid'])), __FILE__, __LINE__); list($ptype) = SQL_FETCHROW($result); SQL_FREERESULT($result); - if (!empty($ptype)) - { + if (!empty($ptype)) { // Obtain data from payout type $result = SQL_QUERY_ESC("SELECT from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url FROM "._MYSQL_PREFIX."_payout_types WHERE id=%s LIMIT 1", array(bigintval($ptype)), __FILE__, __LINE__); list($fuid, $fpass, $eurl, $eok, $failed, $eenc, $allow) = SQL_FETCHROW($result); SQL_FREERESULT($result); - if (!empty($eurl)) - { + if (!empty($eurl)) { // Ok, run URL... $eurl = COMPILE_CODE($eurl); switch ($eenc) @@ -119,14 +114,12 @@ if (!empty($_GET['pid'])) // Execute transfer $ret = GET_URL($URL); - } - else - { + } else { // No URL to run $ret[0] = $eok; } - if ($ret[0] == $eok) - { + + if ($ret[0] == $eok) { // Clear task if ($task > 0) { ADMIN_SOLVE_TASK($task); @@ -134,50 +127,38 @@ if (!empty($_GET['pid'])) // Clear payout request $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_payouts SET status='ACCEPTED' WHERE id=%s LIMIT 1", - array(bigintval($_GET['pid'])), __FILE__, __LINE__); + array(bigintval($_GET['pid'])), __FILE__, __LINE__); // Send out mail $msg = LOAD_EMAIL_TEMPLATE("member_payout_accepted", $_POST['text'], $uid); // Output message - if ($allow == "Y") - { + if ($allow == "Y") { // Banner / Textlink request LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_BANNER_ACCEPTED_NOTIFIED); - } - else - { + } else { // Normal request LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_ACCEPTED_NOTIFIED); } // Finally send mail SEND_EMAIL($email, PAYOUT_ACCEPTED_SUBJECT, $msg); - } - else - { + } else { // Something goes wrong... :-( $content = implode("
", $ret); LOAD_TEMPLATE("admin_payout_failed_transfer", false, $content); } - } - else - { + } else { // Cannot load payout id OUTPUT_HTML("".PAYOUT_FAILED_OBTAIN_PAYOUT_ID.""); } - } - else - { + } else { // Load template LOAD_TEMPLATE("admin_payout_accept_form", false, $task); } - } - elseif (($_GET['do'] == "reject") && (!empty($email))) - { + } elseif (($_GET['do'] == "reject") && (!empty($email))) { // Ok, now we can output the form or execute rejecting - if (isset($_POST['ok'])) - { + if (isset($_POST['ok'])) { if ($task > 0) { // Clear task ADMIN_SOLVE_TASK($task); @@ -195,30 +176,21 @@ if (!empty($_GET['pid'])) // Finally send mail SEND_EMAIL($email, PAYOUT_REJECTED_SUBJECT, $msg); - } - else - { + } else { // Load template LOAD_TEMPLATE("admin_payout_reject_form", false, $task); } - } - else - { + } else { // Cannot load user data LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_FAILED_OBTAIN_USERDATA); } - } - elseif((empty($task)) || ($task == "0")) - { + } elseif ((empty($task)) || ($task == "0")) { // Failed loading task ID LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_FAILED_OBTAIN_TASK_ID); } -} - else -{ +} else { if (empty($_GET['do'])) $_GET['do'] = ""; - if ($_GET['do'] == "delete") - { + if ($_GET['do'] == "delete") { // Delete all requests $result = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_payouts", __FILE__, __LINE__); } @@ -229,19 +201,14 @@ FROM "._MYSQL_PREFIX."_user_payouts AS p, "._MYSQL_PREFIX."_payout_types AS t WHERE p.payout_id=t.id ORDER BY p.payout_timestamp DESC", __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) - { + if (SQL_NUMROWS($result) > 0) { // List found payouts $OUT = ""; $SW = 2; - while (list($pid, $uid, $total, $account, $bank, $type, $tstamp, $status, $allow, $url, $alt, $banner) = SQL_FETCHROW($result)) - { - if ($status == "NEW") - { + while (list($pid, $uid, $total, $account, $bank, $type, $tstamp, $status, $allow, $url, $alt, $banner) = SQL_FETCHROW($result)) { + if ($status == "NEW") { // Generate links for direct accepting and rejecting $status = "".PAYOUT_ACCEPT_PAYOUT." | ".PAYOUT_REJECT_PAYOUT.""; - } - else - { + } else { // Translate status $status = constant('PAYOUT_STATUS_'.strtoupper($status).''); $status = "".$status.""; @@ -299,9 +266,7 @@ ORDER BY p.payout_timestamp DESC", __FILE__, __LINE__); // Load final template LOAD_TEMPLATE("admin_list_payouts"); - } - else - { + } else { // No payout requests are sent so far LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_ADMIN_NO_REQUESTS_FOUND); } diff --git a/inc/modules/admin/what-list_rallyes.php b/inc/modules/admin/what-list_rallyes.php index 552acec06f..dddae955bb 100644 --- a/inc/modules/admin/what-list_rallyes.php +++ b/inc/modules/admin/what-list_rallyes.php @@ -338,14 +338,14 @@ ORDER BY start_time DESC", // Is the rallye active or not? switch ($active) { - case 'Y': + case "Y": // Rallye is active so do not edit it! $content['select'] = "".$id.""; $content['active_title'] = RALLYE_DEACTIVATE_NOW; $content['active'] = 0; break; - case 'N': + case "N": $content['active_title'] = RALLYE_ACTIVATE_NOW; $content['active'] = "1"; break; @@ -354,12 +354,12 @@ ORDER BY start_time DESC", // Notification to members? switch ($notify) { - case 'Y': + case "Y": $content['notify_title'] = RALLYE_STOP_NOTIFY_NOW; $content['notify'] = 0; break; - case 'N': + case "N": $content['notify_title'] = RALLYE_START_NOTIFY_NOW; $content['notify'] = "1"; break; @@ -368,12 +368,12 @@ ORDER BY start_time DESC", // Auto-add of new joined members? switch ($auto_add) { - case 'Y': + case "Y": $content['auto_title'] = RALLYE_STOP_AUTO_ADD_NOW; $content['auto'] = 0; break; - case 'N': + case "N": $content['auto_title'] = RALLYE_START_AUTO_ADD_NOW; $content['auto'] = "1"; break; diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php index 8618702c4d..15990d4acc 100644 --- a/inc/modules/admin/what-list_user.php +++ b/inc/modules/admin/what-list_user.php @@ -222,16 +222,16 @@ LIMIT 1", $result_master = SQL_QUERY($SQL, __FILE__, __LINE__); // Calculate page count (0.5 fixes a bug with page count) - if ($_CONFIG['user_limit'] == 0) { - $_CONFIG['user_limit'] = 100; + if (getConfig('user_limit') == 0) { + getConfig('user_limit') = 100; LOAD_TEMPLATE("admin_settings_saved", false, EXTENSION_WARNING_USER_LIMIT); } // END - if // Activate the extension please! - $PAGES = round(SQL_NUMROWS($result_master) / $_CONFIG['user_limit'] + 0.5); + $PAGES = round(SQL_NUMROWS($result_master) / getConfig('user_limit') + 0.5); if (empty($_GET['page'])) $_GET['page'] = "1"; - if (empty($_GET['offset'])) $_GET['offset'] = $_CONFIG['user_limit']; + if (empty($_GET['offset'])) $_GET['offset'] = getConfig('user_limit'); // Add limitation to SQL string and run him again $SQL .= " LIMIT ".($_GET['offset'] * $_GET['page'] - $_GET['offset']).", ".$_GET['offset']; @@ -259,7 +259,7 @@ LIMIT 1", } if ($PAGES > 1) { - define('__PAGE_NAV', ADD_PAGENAV($PAGES, $_CONFIG['user_limit'], true, $colspan, true)); + define('__PAGE_NAV', ADD_PAGENAV($PAGES, getConfig('user_limit'), true, $colspan, true)); } else { // No page navigation is required define('__PAGE_NAV', ""); diff --git a/inc/modules/admin/what-list_yoomedia_tm.php b/inc/modules/admin/what-list_yoomedia_tm.php index 252bd0d2f7..1e9e49e317 100644 --- a/inc/modules/admin/what-list_yoomedia_tm.php +++ b/inc/modules/admin/what-list_yoomedia_tm.php @@ -62,7 +62,7 @@ if (isset($_POST['ok'])) { } // Enougth queries left? -if ($_CONFIG['yoomedia_requests_remain'] == 0) { +if (getConfig('yoomedia_requests_remain') == 0) { // Output message LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_YOOMEDIA_REQUESTS_DEPLETED); diff --git a/inc/modules/admin/what-maintenance.php b/inc/modules/admin/what-maintenance.php index 481b418cb1..282e6c679e 100644 --- a/inc/modules/admin/what-maintenance.php +++ b/inc/modules/admin/what-maintenance.php @@ -43,14 +43,14 @@ ADD_DESCR("admin", __FILE__); if (isset($_POST['ok'])) { // De- or activate maintenance mode - switch ($_CONFIG['maintenance']) + switch (getConfig('maintenance')) { - case 'Y': + case "Y": $target_mode = "N"; $out = ADMIN_MAINTENANCE_DEACTIVATED; break; - case 'N': + case "N": $target_mode = "Y"; $out = ADMIN_MAINTENANCE_ACTIVATED; break; @@ -62,13 +62,13 @@ if (isset($_POST['ok'])) // Load template LOAD_TEMPLATE("admin_settings_saved", false, $out); } else { - switch ($_CONFIG['maintenance']) + switch (getConfig('maintenance')) { - case 'Y': // Maintenance mode is active + case "Y": // Maintenance mode is active define('ADMIN_MAINTENANCE_MODE', ADMIN_MAINTENANCE_MODE_IS_ACTIVE); break; - case 'N': // Maintenance mode is inactive + case "N": // Maintenance mode is inactive define('ADMIN_MAINTENANCE_MODE', ADMIN_MAINTENANCE_MODE_IS_INACTIVE); break; } diff --git a/inc/modules/admin/what-unlock_emails.php b/inc/modules/admin/what-unlock_emails.php index 73d60306a7..c26b9bcda1 100644 --- a/inc/modules/admin/what-unlock_emails.php +++ b/inc/modules/admin/what-unlock_emails.php @@ -82,19 +82,19 @@ LIMIT 1", SQL_FREERESULT($result); // Is the surfbar installed? - if ((EXT_IS_ACTIVE("surfbar")) && ($_CONFIG['surfbar_migrate_order'] == "Y")) { + if ((EXT_IS_ACTIVE("surfbar")) && (getConfig('surfbar_migrate_order') == "Y")) { // Then "migrate" the URL to the surfbar SURFBAR_ADMIN_MIGRATE_URL($DATA['url'], $DATA['sender']); } // END - if // Check for bonus extension version >= 0.4.4 for the order bonus - if ((GET_EXT_VERSION("bonus") >= "0.4.4") && ($_CONFIG['bonus_active'] == "Y")) { + if ((GET_EXT_VERSION("bonus") >= "0.4.4") && (getConfig('bonus_active') == "Y")) { // Add points directly - $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET bonus_order=bonus_order+".$_CONFIG['bonus_order']." WHERE userid=%s LIMIT 1", - array(bigintval($DATA['sender'])), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET bonus_order=bonus_order+".getConfig('bonus_order')." WHERE userid=%s LIMIT 1", + array(bigintval($DATA['sender'])), __FILE__, __LINE__); // Subtract bonus points from system - BONUS_POINTS_HANDLER($_CONFIG['bonus_order']); + BONUS_POINTS_HANDLER(getConfig('bonus_order')); } // END - if // Load email template @@ -128,7 +128,7 @@ LIMIT 1", // Load URL and subject from pool $result = SQL_QUERY_ESC("SELECT url, subject, sender FROM "._MYSQL_PREFIX."_pool WHERE id=%s LIMIT 1", - array($id), __FILE__, __LINE__); + array($id), __FILE__, __LINE__); // Load data $DATA = SQL_FETCHARRAY($result); @@ -145,7 +145,7 @@ LIMIT 1", // Redirect URL $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET url='%s', data_type='NEW' WHERE id=%s LIMIT 1", - array($_POST['redirect'], $id),__FILE__, __LINE__); + array($_POST['redirect'], $id),__FILE__, __LINE__); // Prepare data for the row template $content = array( @@ -172,11 +172,11 @@ LIMIT 1", foreach ($_POST['sel'] as $id => $url) { // Lookup in blacklist $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_url_blist WHERE url='%s' LIMIT 1", - array($url), __FILE__, __LINE__); + array($url), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Did not find a record so we can add it... :) $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_url_blist (url, timestamp) VALUES ('%s', UNIX_TIMESTAMP())", - array($url), __FILE__, __LINE__); + array($url), __FILE__, __LINE__); } else { // Free memory SQL_FREERESULT($result); @@ -223,7 +223,7 @@ LIMIT 1", // Prepare rejection URL $REJECT = "http://"; - if (GET_EXT_VERSION("other") >= "0.1.6") $REJECT = $_CONFIG['reject_url']; + if (GET_EXT_VERSION("other") >= "0.1.6") $REJECT = getConfig('reject_url'); define('__REJECT_URL', $REJECT); // Load main template diff --git a/inc/modules/admin/what-unlock_sponsor.php b/inc/modules/admin/what-unlock_sponsor.php index 81328dc904..b970743b93 100644 --- a/inc/modules/admin/what-unlock_sponsor.php +++ b/inc/modules/admin/what-unlock_sponsor.php @@ -113,7 +113,7 @@ WHERE id='%s' AND status='PENDING' LIMIT 1", $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET points_amount=points_amount+%s, ref_count=ref_count+1 WHERE id='%s' LIMIT 1", - array($_CONFIG['sponsor_ref_points'], bigintval($refid)), __FILE__, __LINE__); + array(getConfig('sponsor_ref_points'), bigintval($refid)), __FILE__, __LINE__); // Whas that update fine? if (SQL_AFFECTEDROWS() == 1) { @@ -129,7 +129,7 @@ WHERE id='%s' LIMIT 1", if ($REFERRAL['receive_warnings'] == "Y") { // Translate some data $REFERRAL['points'] = TRANSLATE_COMMA($REFERRAL['points']); - $REFERRAL['ref_points'] = TRANSLATE_COMMA($_CONFIG['sponsor_ref_points']); + $REFERRAL['ref_points'] = TRANSLATE_COMMA(getConfig('sponsor_ref_points')); $REFERRAL['gender'] = TRANSLATE_GENDER($REFERRAL['gender']); // Send notification to referal diff --git a/inc/modules/admin/what-updates.php b/inc/modules/admin/what-updates.php index cd689af7ad..efff80d7fb 100644 --- a/inc/modules/admin/what-updates.php +++ b/inc/modules/admin/what-updates.php @@ -90,11 +90,11 @@ if (empty($response[0]) && empty($response[1]) && empty($response[2]) && empty($ // Maximum of available pacthes extracted (above). Now we can get all informations for ($idx = 0; $idx < $max; $idx++) { // List only newer patches - $TEST = substr(str_replace("\n", "", $response[$idx * 5 + 2]), 0, strlen($_CONFIG['patch_level'])); + $TEST = substr(str_replace("\n", "", $response[$idx * 5 + 2]), 0, strlen(getConfig('patch_level'))); // I have removed the addional test for the stored timemark in database or you cannot find // new updates on my server when you haven't installed it before I upload a patch... :-( - if (bigintval($TEST) > bigintval($_CONFIG['patch_level'])) { + if (bigintval($TEST) > bigintval(getConfig('patch_level'))) { // Copy every data from the response array $PATCHES['fname'][] = str_replace("\n", "", $response[$idx * 5 + 2]); $PATCHES['fsize'][] = str_replace("\n", "", $response[$idx * 5 + 3]); diff --git a/inc/modules/admin/what-user_online.php b/inc/modules/admin/what-user_online.php index 07582a9fea..ca6809212e 100644 --- a/inc/modules/admin/what-user_online.php +++ b/inc/modules/admin/what-user_online.php @@ -120,7 +120,7 @@ if (SQL_NUMROWS($result) > 0) } OUTPUT_HTML("
- ".ONLINE_TIMEOUT_IS_1.CREATE_FANCY_TIME($_CONFIG['online_timeout']).ONLINE_TIMEOUT_IS_2." + ".ONLINE_TIMEOUT_IS_1.CREATE_FANCY_TIME(getConfig('online_timeout')).ONLINE_TIMEOUT_IS_2."
"); diff --git a/inc/modules/admin/what-usr_online.php b/inc/modules/admin/what-usr_online.php index 063fbb7612..5a50a372d6 100644 --- a/inc/modules/admin/what-usr_online.php +++ b/inc/modules/admin/what-usr_online.php @@ -114,7 +114,7 @@ if (EXT_IS_ACTIVE("online", true)) SQL_FREERESULT($result); // Load footer template - define('__FANCY_ONLINE_TIMEOUT', CREATE_FANCY_TIME($_CONFIG['online_timeout'])); + define('__FANCY_ONLINE_TIMEOUT', CREATE_FANCY_TIME(getConfig('online_timeout'))); LOAD_TEMPLATE("admin_online_footer"); } } diff --git a/inc/modules/chk_login.php b/inc/modules/chk_login.php index b1bd8016e6..88f9d5281a 100644 --- a/inc/modules/chk_login.php +++ b/inc/modules/chk_login.php @@ -79,7 +79,7 @@ LIMIT 1", // Bonus is not given by default ;-) $bonus = false; - if ((GET_EXT_VERSION("sql_patches") >= "0.2.8") && (GET_EXT_VERSION("bonus") >= "0.2.1") && ($_CONFIG['bonus_login_yn'] == "Y")) { + if ((GET_EXT_VERSION("sql_patches") >= "0.2.8") && (GET_EXT_VERSION("bonus") >= "0.2.1") && (getConfig('bonus_login_yn') == "Y")) { // Update last login if far enougth away $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET last_login=UNIX_TIMESTAMP() @@ -87,7 +87,7 @@ WHERE userid=%s AND last_login < (UNIX_TIMESTAMP() - %s) LIMIT 1", array( $GLOBALS['userid'], - $_CONFIG['login_timeout'] + getConfig('login_timeout') ), __FILE__, __LINE__ ); if (SQL_AFFECTEDROWS() == 1) $bonus = true; @@ -97,7 +97,7 @@ LIMIT 1", // Output message with added points OUTPUT_HTML(" ".BONUS_LOGIN_BONUS_ADDED_1." - ".TRANSLATE_COMMA($_CONFIG['login_bonus'])." ".POINTS." + ".TRANSLATE_COMMA(getConfig('login_bonus'))." ".POINTS." ".BONUS_LOGIN_BONUS_ADDED_2." "); } elseif (EXT_IS_ACTIVE("bonus")) { diff --git a/inc/modules/frametester.php b/inc/modules/frametester.php index 4e3f4f3054..947753f18a 100644 --- a/inc/modules/frametester.php +++ b/inc/modules/frametester.php @@ -41,7 +41,7 @@ $MODE = "guest"; if (!empty($_GET['order'])) { // Order number placed, is he also logged in? - if(IS_MEMBER()) { + if (IS_MEMBER()) { // Ok, test passed... :) $result = SQL_QUERY_ESC("SELECT subject, url FROM "._MYSQL_PREFIX."_pool WHERE id=%s AND sender=%s AND data_type='TEMP' LIMIT 1", array(bigintval($_GET['order']), $GLOBALS['userid']), __FILE__, __LINE__); diff --git a/inc/modules/guest/action-online.php b/inc/modules/guest/action-online.php index c7acfbbab8..37e623e572 100644 --- a/inc/modules/guest/action-online.php +++ b/inc/modules/guest/action-online.php @@ -46,12 +46,12 @@ $result_admins = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_ad // Total visitors online $total = SQL_NUMROWS($result_guests) + SQL_NUMROWS($result_members) + SQL_NUMROWS($result_admins); -if ($_CONFIG['mad_count'] < $total) { +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 define('GUESTS_ONLINE_CNT' , SQL_NUMROWS($result_guests)); @@ -64,7 +64,7 @@ LOAD_TEMPLATE("online_now"); if (EXT_IS_ACTIVE("active")) { // Init content $content = array( - 'menu' => "".$_CONFIG['menu_blur_spacer'].GUEST_ACTIVE_LINK."", + 'menu' => "".getConfig('menu_blur_spacer').GUEST_ACTIVE_LINK."", 'what' => "active" ); diff --git a/inc/modules/guest/what-active.php b/inc/modules/guest/what-active.php index 69a16d1de0..e0d1a6e95e 100644 --- a/inc/modules/guest/what-active.php +++ b/inc/modules/guest/what-active.php @@ -54,7 +54,7 @@ $result = SQL_QUERY_ESC("SELECT userid, ".$ADD.", last_online FROM "._MYSQL_PREFIX."_user_data WHERE last_online >= %s AND status='CONFIRMED' ORDER BY last_online DESC LIMIT %s", - array(START_TDAY, $_CONFIG['active_limit']), __FILE__, __LINE__); + array(START_TDAY, getConfig('active_limit')), __FILE__, __LINE__); // Entries found? if (SQL_NUMROWS($result) > 0) { diff --git a/inc/modules/guest/what-beg.php b/inc/modules/guest/what-beg.php index 4d627db775..88b8d4695e 100644 --- a/inc/modules/guest/what-beg.php +++ b/inc/modules/guest/what-beg.php @@ -44,22 +44,22 @@ if (!defined('__SECURITY')) { ADD_DESCR("guest", __FILE__); // Prepare constants -define('__BEG_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points'])); -define('__BEG_POINTS_MAX', TRANSLATE_COMMA($_CONFIG['beg_points_max'])); +define('__BEG_POINTS' , TRANSLATE_COMMA(getConfig('beg_points'))); +define('__BEG_POINTS_MAX', TRANSLATE_COMMA(getConfig('beg_points_max'))); if ($GLOBALS['refid'] > 0) { // Take referal ID from URL/Cookie define('__BEG_UID' , $GLOBALS['refid']); } else { // Take default referal ID - define('__BEG_UID' , $_CONFIG['def_refid']); + define('__BEG_UID' , getConfig('def_refid')); } if (function_exists('CREATE_FANCY_TIME')) { - define('__BEG_TIMEOUT' , CREATE_FANCY_TIME($_CONFIG['beg_timeout'])); - define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME($_CONFIG['beg_uid_timeout'])); + define('__BEG_TIMEOUT' , CREATE_FANCY_TIME(getConfig('beg_timeout'))); + define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME(getConfig('beg_uid_timeout'))); } else { - define('__BEG_TIMEOUT ' , round($_CONFIG['beg_timeout'] / 60)." ".MINUTES); - define('__BEG_UID_TIMEOUT', round($_CONFIG['beg_uid_timeout'] / 60)." ".MINUTES); + define('__BEG_TIMEOUT ' , round(getConfig('beg_timeout') / 60)." ".MINUTES); + define('__BEG_UID_TIMEOUT', round(getConfig('beg_uid_timeout') / 60)." ".MINUTES); } // Load final template diff --git a/inc/modules/guest/what-confirm.php b/inc/modules/guest/what-confirm.php index fa40e682f1..6f5a7cbe9d 100644 --- a/inc/modules/guest/what-confirm.php +++ b/inc/modules/guest/what-confirm.php @@ -53,9 +53,9 @@ if (!empty($_GET['hash'])) { // Unlock his account (but only when it is on UNCONFIRMED!) $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET status='CONFIRMED', ref_payout=%s, user_hash=NULL WHERE user_hash='%s' AND status='UNCONFIRMED' LIMIT 1", - array($_CONFIG['ref_payout'], $_GET['hash']), __FILE__, __LINE__); + array(getConfig('ref_payout'), $_GET['hash']), __FILE__, __LINE__); if (SQL_AFFECTEDROWS() == 1) { - $msg = LOAD_EMAIL_TEMPLATE("confirm-member", array('points' => $_CONFIG['points_register']), bigintval($uid)); + $msg = LOAD_EMAIL_TEMPLATE("confirm-member", array('points' => getConfig('points_register')), bigintval($uid)); // And send him right away the confirmation mail SEND_EMAIL($email, GUEST_THANX_CONFIRM, $msg); @@ -73,7 +73,7 @@ if (!empty($_GET['hash'])) { unset($DEPTH); // Shall I "pay" the referal points imidiately? - if ($_CONFIG['ref_payout'] == "0") { + if (getConfig('ref_payout') == "0") { // Yes, "pay" it now $locked = false; } else { @@ -82,18 +82,18 @@ if (!empty($_GET['hash'])) { } // If version matches add ref bonus to refid's account - if ((GET_EXT_VERSION("bonus") >= "0.4.4") && ($_CONFIG['bonus_active'] == "Y")) { + if ((GET_EXT_VERSION("bonus") >= "0.4.4") && (getConfig('bonus_active') == "Y")) { // Add points (directly only!) $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET bonus_ref=bonus_ref+%s WHERE userid=%s LIMIT 1", - array($_CONFIG['bonus_ref'], bigintval($rid)), __FILE__, __LINE__); + array(getConfig('bonus_ref'), bigintval($rid)), __FILE__, __LINE__); // Subtract points from system - BONUS_POINTS_HANDLER($_CONFIG['bonus_ref']); + BONUS_POINTS_HANDLER(getConfig('bonus_ref')); } // END - if // Add one-time referal bonus over referal system or directly unset($DEPTH); - ADD_POINTS_REFSYSTEM("referal_bonus", $rid, $_CONFIG['points_ref'], true, bigintval($uid), $locked, $_CONFIG['reg_points_mode']); + ADD_POINTS_REFSYSTEM("referal_bonus", $rid, getConfig('points_ref'), true, bigintval($uid), $locked, getConfig('reg_points_mode')); } // END - if } // END - if diff --git a/inc/modules/guest/what-doubler.php b/inc/modules/guest/what-doubler.php index aea44a2132..b50ddca2a7 100644 --- a/inc/modules/guest/what-doubler.php +++ b/inc/modules/guest/what-doubler.php @@ -44,20 +44,20 @@ if (!defined('__SECURITY')) { ADD_DESCR("guest", __FILE__); // Percent values etc. -define('__CHARGE_VALUE', TRANSLATE_COMMA($_CONFIG['doubler_charge'] * 100)); -define('__REF_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_ref'] * 100)); -define('__TOTAL_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_points'])); -define('__MIN_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_min'])); -define('__MAX_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_max'])); +define('__CHARGE_VALUE', TRANSLATE_COMMA(getConfig('doubler_charge') * 100)); +define('__REF_VALUE' , TRANSLATE_COMMA(getConfig('doubler_ref') * 100)); +define('__TOTAL_VALUE' , TRANSLATE_COMMA(getConfig('doubler_points'))); +define('__MIN_VALUE' , TRANSLATE_COMMA(getConfig('doubler_min'))); +define('__MAX_VALUE' , TRANSLATE_COMMA(getConfig('doubler_max'))); // Transfer referal ID define('__REFID', $GLOBALS['refid']); // Usage counter -define('__DOUBLER_COUNTER', $_CONFIG['doubler_counter']); +define('__DOUBLER_COUNTER', getConfig('doubler_counter')); // Which mail-send-mode did the admin setup? -switch ($_CONFIG['doubler_send_mode']) +switch (getConfig('doubler_send_mode')) { case "DIRECT": define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_DIRECT); @@ -75,7 +75,7 @@ define('__DOUBLER_PAYOUT_HISTORY', DOUBLER_GENERATE_TABLE("0", "Y", "N", "DESC") define('__DOUBLER_PAYOUT_NEXT', DOUBLER_GENERATE_TABLE()); // Generate timemark -define('__TIMEOUT_MARK', CREATE_FANCY_TIME($_CONFIG['doubler_timeout'])); +define('__TIMEOUT_MARK', CREATE_FANCY_TIME(getConfig('doubler_timeout'))); // Points left to double define('__LEFT_VALUE', DOUBLER_GET_TOTAL_POINTS_LEFT()); diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index 6c7cb58b65..6035504fb8 100644 --- a/inc/modules/guest/what-login.php +++ b/inc/modules/guest/what-login.php @@ -133,15 +133,15 @@ if (IS_MEMBER()) { // Probe for last online timemark $probe = time() - $online; if (!empty($login)) $probe = time() - $login; - if ((GET_EXT_VERSION("bonus") >= "0.2.2") && ($probe >= $_CONFIG['login_timeout'])) { + if ((GET_EXT_VERSION("bonus") >= "0.2.2") && ($probe >= getConfig('login_timeout'))) { // Add login bonus to user's account $ADD = sprintf(", login_bonus=login_bonus+%s", - (float)$_CONFIG['login_bonus'] + (float)getConfig('login_bonus') ); $BONUS = true; // Subtract login bonus from userid's account or jackpot - if ((GET_EXT_VERSION("bonus") >= "0.3.5") && ($_CONFIG['bonus_mode'] != "ADD")) BONUS_POINTS_HANDLER('login_bonus'); + if ((GET_EXT_VERSION("bonus") >= "0.3.5") && (getConfig('bonus_mode') != "ADD")) BONUS_POINTS_HANDLER('login_bonus'); } // END - if // Init variables diff --git a/inc/modules/guest/what-mediadata.php b/inc/modules/guest/what-mediadata.php index fba0bdcb9f..e2f2fabaf7 100644 --- a/inc/modules/guest/what-mediadata.php +++ b/inc/modules/guest/what-mediadata.php @@ -57,15 +57,15 @@ define('user_locked' , round(GET_TOTAL_DATA("LOCKED" , "user_data", "use define('user_count' , (user_confirmed + user_unconfirmed + user_locked)); // Start of this exchange -define('__MT_START', MAKE_DATETIME($_CONFIG['mt_start'], "3")); +define('__MT_START', MAKE_DATETIME(getConfig('mt_start'), "3")); // Projected number of members -define('__MT_STAGE', $_CONFIG['mt_stage']); +define('__MT_STAGE', getConfig('mt_stage')); // Project timestamp when number of members are reached $PROJECTED = 0; if (user_count > 0) { - $PROJECTED = round((time() - $_CONFIG['mt_start']) / user_count * $_CONFIG['mt_stage'] + $_CONFIG['mt_start']); + $PROJECTED = round((time() - getConfig('mt_start')) / user_count * getConfig('mt_stage') + getConfig('mt_start')); } $YEAR = date('Y', $PROJECTED); $MONTH = date("m", $PROJECTED); $DAY = date("d", $PROJECTED); @@ -308,8 +308,8 @@ define('__ROWSPAN_POINTS' , $rowNameS_POINTS); define('__ROWSPAN_USER' , $rowNameS_USER); // Patch level and it's timespamp -define('__PATCH_LEVEL', $_CONFIG['patch_level']); -define('__PATCH_CTIME', MAKE_DATETIME($_CONFIG['patch_ctime'], "2")); +define('__PATCH_LEVEL', getConfig('patch_level')); +define('__PATCH_CTIME', MAKE_DATETIME(getConfig('patch_ctime'), "2")); // Load template LOAD_TEMPLATE("mediadata"); diff --git a/inc/modules/guest/what-rallyes.php b/inc/modules/guest/what-rallyes.php index 4c8acf31c0..edf07850d4 100644 --- a/inc/modules/guest/what-rallyes.php +++ b/inc/modules/guest/what-rallyes.php @@ -66,7 +66,7 @@ if (SQL_NUMROWS($result) == 1) define('__RALLYE_EXTRAS', RALLYE_HAS_EXPIRED); $expired = true; } - elseif (time() >= ($end - $_CONFIG['one_day'])) + elseif (time() >= ($end - getConfig('one_day'))) { // Rallye will expire in less one day! define('__RALLYE_EXTRAS', RALLYE_EXPIRE_ONE_DAY); diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index e240aaaf07..7fe0bf2b7c 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-register.php @@ -79,8 +79,8 @@ if ($GLOBALS['refid'] > 0) { //* DEBUG: */ die("refid={$GLOBALS['refid']}/numRows=".SQL_NUMROWS($result).""); if (SQL_NUMROWS($result) == 0) { // Not found so we set your refid! - $_POST['refid'] = $_CONFIG['def_refid']; - set_session('refid', $_CONFIG['def_refid']); + $_POST['refid'] = getConfig('def_refid'); + set_session('refid', getConfig('def_refid')); } else { // Use the refid here $_POST['refid'] = $GLOBALS['refid']; @@ -129,7 +129,7 @@ if (isset($_POST['ok'])) { } // END - if // Is the password long enouth? - if ((strlen($_POST['pass1']) < $_CONFIG['pass_len']) && (!$FAILED)) { + if ((strlen($_POST['pass1']) < getConfig('pass_len')) && (!$FAILED)) { $SHORT_PASS = true; $FAILED = true; } // END - if @@ -141,23 +141,23 @@ if (isset($_POST['ok'])) { if ($answer == "Y") $cats++; } // END - foreach - if ($cats < $_CONFIG['least_cats']) { + if ($cats < getConfig('least_cats')) { // ... nope! $FAILED = true; } // END - if } // END - if - if (($_POST['addy'] != "!") && ($_CONFIG['check_double_email'] == "Y")) { + if (($_POST['addy'] != "!") && (getConfig('check_double_email') == "Y")) { // Does the email address already exists in our database? $CHK = SEARCH_EMAIL_USERTAB($_POST['addy']); if ($CHK) { $_POST['addy'] = "?"; $FAILED = true; } } // END - if // Check for IP timeout? - if ($_CONFIG['ip_timeout'] > 0) { + if (getConfig('ip_timeout') > 0) { // Check his IP number $result = SQL_QUERY_ESC("SELECT joined, last_update FROM `"._MYSQL_PREFIX."_user_data` WHERE REMOTE_ADDR='%s' AND (joined > (UNIX_TIMESTAMP() - %s) OR last_update > (UNIX_TIMESTAMP() - %s)) LIMIT 1", - array(GET_REMOTE_ADDR(), $_CONFIG['ip_timeout'], $_CONFIG['ip_timeout']), __FILE__, __LINE__); + array(GET_REMOTE_ADDR(), getConfig('ip_timeout'), getConfig('ip_timeout')), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Same IP in timeout range and different email address entered... Eat this, faker! ;-) // But admins are allowed to fake their own exchange service. @@ -199,7 +199,7 @@ if ((isset($_POST['ok'])) && ((!$FAILED) || (IS_ADMIN()))) { // First comes first: begging rallye if (GET_EXT_VERSION("beg") >= "0.1.7") { // Okay, shall I disable now? - if ($_CONFIG['beg_new_mem_notify'] == "N") { + if (getConfig('beg_new_mem_notify') == "N") { $ADD1 .= ", beg_ral_notify, beg_ral_en_notify"; $ADD2 .= ", UNIX_TIMESTAMP(), UNIX_TIMESTAMP()"; } // END - if @@ -208,7 +208,7 @@ if ((isset($_POST['ok'])) && ((!$FAILED) || (IS_ADMIN()))) { // Second: active rallye if (GET_EXT_VERSION("bonus") >= "0.7.7") { // Okay, shall I disable now? - if ($_CONFIG['bonus_new_mem_notify'] == "N") { + if (getConfig('bonus_new_mem_notify') == "N") { $ADD1 .= ", bonus_ral_notify, bonus_ral_en_notify"; $ADD2 .= ", UNIX_TIMESTAMP(), UNIX_TIMESTAMP()"; } // END - if @@ -274,14 +274,14 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF if (SQL_NUMROWS($result) == 0) { // Add only when the line was not found (maybe some more secure?) $locked = "points"; - if ($_CONFIG['ref_payout'] > 0) $locked = "locked_points"; // Pay him later. First he has to confirm some mails! + if (getConfig('ref_payout') > 0) $locked = "locked_points"; // Pay him later. First he has to confirm some mails! $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_points (userid, ref_depth, ".$locked.") VALUES (%s,0,'%s')", - array(bigintval($userid), $_CONFIG['points_register']), __FILE__, __LINE__); + array(bigintval($userid), getConfig('points_register')), __FILE__, __LINE__); // Update mediadata as well if ((GET_EXT_VERSION("mediadata") >= "0.0.4") && ($locked == "points")) { // Update database - MEDIA_UPDATE_ENTRY(array("total_points"), "add", $_CONFIG['points_register']); + MEDIA_UPDATE_ENTRY(array("total_points"), "add", getConfig('points_register')); } // END - if } // END - if @@ -395,15 +395,15 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF } if ($SHORT_PASS) { - OUTPUT_HTML("".SHORT_PASS.": ".$_CONFIG['pass_len']."

"); + OUTPUT_HTML("".SHORT_PASS.": ".getConfig('pass_len')."

"); } // END - if if ($IP_TIMEOUT) { OUTPUT_HTML("".REMOTE_ADDR_TIMEOUT."

"); } // END - if - if ((!empty($cats)) && ($cats < $_CONFIG['least_cats'])) { - OUTPUT_HTML("".CATS_LEAST.": ".$_CONFIG['least_cats']."

"); + if ((!empty($cats)) && ($cats < getConfig('least_cats'))) { + OUTPUT_HTML("".CATS_LEAST.": ".getConfig('least_cats')."

"); } // END - if // Generate birthday selection @@ -425,7 +425,7 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF define('MAX_RECEIVE_LIST', ADD_MAX_RECEIVE_LIST("guest", "", true)); // Shall I display the refid or shall I make it editable? - if ($_CONFIG['display_refid'] == "Y") { + if (getConfig('display_refid') == "Y") { // Load "hide" form template define('REFID_CONTENT', LOAD_TEMPLATE("guest_register_refid_hide", true, $GLOBALS['refid'])); } else { @@ -437,7 +437,7 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF define('REGISTER_HEADER_CONTENT', LOAD_TEMPLATE("register_header", true)); // Please select at least x categories - define('LEAST_CATS_VALUE', $_CONFIG['least_cats']); + define('LEAST_CATS_VALUE', getConfig('least_cats')); // Other values define('__SURNAME', SQL_ESCAPE($_POST['surname'])); diff --git a/inc/modules/guest/what-sponsor_login.php b/inc/modules/guest/what-sponsor_login.php index 3586e33e88..895e2280de 100644 --- a/inc/modules/guest/what-sponsor_login.php +++ b/inc/modules/guest/what-sponsor_login.php @@ -226,7 +226,7 @@ WHERE id='%s' AND password='%s' LIMIT 1", if ($status == "CONFIRMED") { // Calculate cookie lifetime, maybe we have to change this so the admin can setup a // seperate timeout for these two cookies? - $life = (time() + $_CONFIG['online_timeout']); + $life = (time() + getConfig('online_timeout')); // Is confirmed so both is fine and we can continue with login procedure $login = ((setcookie("sponsorid" , bigintval($_POST['sponsorid']), $life, COOKIE_PATH)) && diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php index a101f17ae3..7060952e9d 100644 --- a/inc/modules/guest/what-sponsor_reg.php +++ b/inc/modules/guest/what-sponsor_reg.php @@ -186,15 +186,14 @@ if (isset($_POST['ok'])) { } } // Is the password long enough? - elseif (strlen($_POST['pass1']) < $_CONFIG['pass_len']) + elseif (strlen($_POST['pass1']) < getConfig('pass_len')) { // Too short! $FORM_ERRORS[] = SPONSOR_PASSWORD_TOO_SHORT; } // Check if he has accepted the terms&conditions - if (empty($_POST['terms'])) - { + if (empty($_POST['terms'])) { // Homepage URL is empty $FORM_ERRORS[] = SPONSOR_TERMS_NOT_ACCEPTED; } @@ -203,8 +202,7 @@ if (isset($_POST['ok'])) { if (count($FORM_ERRORS) > 0) unset($_POST['ok']); } -if ((isset($_POST['ok'])) && (count($FORM_ERRORS) == 0)) -{ +if ((isset($_POST['ok'])) && (count($FORM_ERRORS) == 0)) { // Generate message array $MSGs = array( 'failed' => SPONSOR_REGISTRATION_FAILED, diff --git a/inc/modules/guest/what-stats.php b/inc/modules/guest/what-stats.php index 3676670a05..c7cfbdd3bc 100644 --- a/inc/modules/guest/what-stats.php +++ b/inc/modules/guest/what-stats.php @@ -41,14 +41,14 @@ if (!defined('__SECURITY')) { 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($_CONFIG['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; +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; } -switch ($_CONFIG['guest_stats']) +switch (getConfig('guest_stats')) { case "MEMBERS": // Statistics about your members // Members yesterday / today online diff --git a/inc/modules/guest/what-top10.php b/inc/modules/guest/what-top10.php index 705a45fa7a..5259cdf1e6 100644 --- a/inc/modules/guest/what-top10.php +++ b/inc/modules/guest/what-top10.php @@ -49,7 +49,7 @@ if (EXT_IS_ACTIVE("nickname")) $ADD = "nickname"; $result = SQL_QUERY_ESC("SELECT userid, ".$ADD.", total_logins, last_online FROM "._MYSQL_PREFIX."_user_data WHERE total_logins>0 AND status='CONFIRMED' ORDER BY total_logins DESC LIMIT %s", - array($_CONFIG['top10_max']), __FILE__, __LINE__); + array(getConfig('top10_max')), __FILE__, __LINE__); $OUT = ""; $SW = 2; $cnt = 1; while(list($uid, $nick, $logins, $last) = SQL_FETCHROW($result)) @@ -74,10 +74,10 @@ while(list($uid, $nick, $logins, $last) = SQL_FETCHROW($result)) // Switch colors and count one up $SW = 3 - $SW; $cnt++; } -if ($cnt < $_CONFIG['top10_max']) +if ($cnt < getConfig('top10_max')) { // Add more "blank" rows - for ($i = $cnt; $i <= $_CONFIG['top10_max']; $i++) + for ($i = $cnt; $i <= getConfig('top10_max'); $i++) { // Prepare data for template $content = array( @@ -101,7 +101,7 @@ WHERE p.points > 0 AND d.status='CONFIRMED' GROUP BY p.userid ORDER BY tpoints DESC, d.last_online DESC LIMIT %s", - array($_CONFIG['top10_max']), __FILE__, __LINE__); + array(getConfig('top10_max')), __FILE__, __LINE__); $OUT = ""; $SW = 2; $cnt = 1; while(list($uid, $nick, $points, $last) = SQL_FETCHROW($result)) @@ -125,10 +125,10 @@ while(list($uid, $nick, $points, $last) = SQL_FETCHROW($result)) // Switch colors and count one up $SW = 3 - $SW; $cnt++; } -if ($cnt < $_CONFIG['top10_max']) +if ($cnt < getConfig('top10_max')) { // Add more "blank" rows - for ($i = $cnt; $i <= $_CONFIG['top10_max']; $i++) + for ($i = $cnt; $i <= getConfig('top10_max'); $i++) { // Prepare data for template $content = array( @@ -152,7 +152,7 @@ WHERE r.counter > 0 AND d.status='CONFIRMED' GROUP BY r.userid ORDER BY refs DESC, d.last_online DESC LIMIT %s", - array($_CONFIG['top10_max']), __FILE__, __LINE__); + array(getConfig('top10_max')), __FILE__, __LINE__); $OUT = ""; $SW = 2; $cnt = 1; while(list($uid, $nick, $refs, $last) = SQL_FETCHROW($result)) @@ -177,10 +177,10 @@ while(list($uid, $nick, $refs, $last) = SQL_FETCHROW($result)) // Switch colors and count one up $SW = 3 - $SW; $cnt++; } -if ($cnt < $_CONFIG['top10_max']) +if ($cnt < getConfig('top10_max')) { // Add more "blank" rows - for ($i = $cnt; $i <= $_CONFIG['top10_max']; $i++) + for ($i = $cnt; $i <= getConfig('top10_max'); $i++) { // Prepare data for template $content = array( @@ -196,7 +196,7 @@ if ($cnt < $_CONFIG['top10_max']) define('__TOP_REFERRAL_ROWS', $OUT); // Remember other values in constants -define('__TOP10_MAX', $_CONFIG['top10_max']); +define('__TOP10_MAX', getConfig('top10_max')); // Load final template LOAD_TEMPLATE("guest_top10"); diff --git a/inc/modules/guest/what-welcome.php b/inc/modules/guest/what-welcome.php index 72e0f5b55f..fe2a7e9b85 100644 --- a/inc/modules/guest/what-welcome.php +++ b/inc/modules/guest/what-welcome.php @@ -51,9 +51,9 @@ SQL_FREERESULT($result); // Prepare content $content = array( - 'register' => TRANSLATE_COMMA($_CONFIG['points_register']), + 'register' => TRANSLATE_COMMA(getConfig('points_register')), 'ref_levels' => $cnt, - 'ref_points' => TRANSLATE_COMMA($_CONFIG['points_ref']) + 'ref_points' => TRANSLATE_COMMA(getConfig('points_ref')) ); // Load default template diff --git a/inc/modules/guest/what-wernis_portal.php b/inc/modules/guest/what-wernis_portal.php index c891089b7e..b816ef637c 100644 --- a/inc/modules/guest/what-wernis_portal.php +++ b/inc/modules/guest/what-wernis_portal.php @@ -56,20 +56,20 @@ $rdf->set_Options( array( 'textinput' => "hidden", 'sitelink' => "http://www.wds66.com", - 'refid' => bigintval($_CONFIG['wernis_refid']), + 'refid' => bigintval(getConfig('wernis_refid')), 'reflink' => "/ref.php?refid=", ) ); // Use proxy? -if ((!empty($_CONFIG['proxy_host'])) && (!empty($_CONFIG['proxy_port']))) { +if ((getConfig('proxy_host') != "") && (getConfig('proxy_port') > 0)) { // Set proxy data - $rdf->set_proxy($_CONFIG['proxy_host'], $_CONFIG['proxy_port']); + $rdf->set_proxy(getConfig('proxy_host'), getConfig('proxy_port')); // Use auth? - if (!empty($_CONFIG['proxy_username'])) { + if (getConfig('proxy_username') != "") { // Set auth data - $rdf->set_proxy_auth($_CONFIG['proxy_username'], $_CONFIG['proxy_password']); + $rdf->set_proxy_auth(getConfig('proxy_username'), getConfig('proxy_password')); } // END - if } // END - if diff --git a/inc/modules/index.php b/inc/modules/index.php index fb602ae722..06fd11d42f 100644 --- a/inc/modules/index.php +++ b/inc/modules/index.php @@ -87,7 +87,7 @@ if (!empty($_GET['msg'])) { LOAD_TEMPLATE("guest_menu_td"); // When no what value is provided take the "home" value -if (empty($GLOBALS['what'])) $GLOBALS['what'] = $_CONFIG['index_home']; +if (empty($GLOBALS['what'])) $GLOBALS['what'] = getConfig('index_home'); // Adding the main content module here if (empty($GLOBALS['action'])) { @@ -99,7 +99,7 @@ if (empty($GLOBALS['action'])) { } // Add the guest's menu here... -if (($_CONFIG['guest_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) { +if ((getConfig('guest_menu') == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) { // Show only when guest menu is active ADD_MENU("guest", $act, $GLOBALS['what']); } // END - if @@ -119,7 +119,7 @@ if ((FILE_READABLE($INC_ACTION)) && (VALIDATE_MENU_ACTION("guest", $act, $GLOBAL LOAD_URL("modules.php?module=index"); } -if (($_CONFIG['guest_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) { +if ((getConfig('guest_menu') == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) { // Right side of content (hint: a good place for 120x600 skyscraper banner!) LOAD_TEMPLATE("guest_content_footer"); diff --git a/inc/modules/login.php b/inc/modules/login.php index cdf0e72676..b308473f75 100644 --- a/inc/modules/login.php +++ b/inc/modules/login.php @@ -84,7 +84,7 @@ if (empty($GLOBALS['action'])) { } // Add the member's menu here... -if (($_CONFIG['member_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) { +if ((getConfig('member_menu') == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) { ADD_MENU("member", GET_ACTION("member", $GLOBALS['what']), $GLOBALS['what']); } // END - if @@ -101,7 +101,7 @@ if ((FILE_READABLE($INC_ACTION)) && (VALIDATE_MENU_ACTION("member", GET_ACTION(" LOAD_URL("modules.php?module=login"); } -if (($_CONFIG['member_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) { +if ((getConfig('member_menu') == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) { // Right side of content (hint: a good place for 120x600 skyscraper banner!) LOAD_TEMPLATE("member_content_right"); diff --git a/inc/modules/member/what-beg.php b/inc/modules/member/what-beg.php index a48cd88338..3c52da3487 100644 --- a/inc/modules/member/what-beg.php +++ b/inc/modules/member/what-beg.php @@ -72,18 +72,18 @@ if (empty($uid)) { $uid = $GLOBALS['userid']; $nickname = false; } // Prepare constants define('__BEG_UID' , $uid); define('__BEG_CLICKS' , $clicks); -define('__BEG_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points'])); -define('__BEG_POINTS_MAX', TRANSLATE_COMMA($_CONFIG['beg_points_max'])); +define('__BEG_POINTS' , TRANSLATE_COMMA(getConfig('beg_points'))); +define('__BEG_POINTS_MAX', TRANSLATE_COMMA(getConfig('beg_points_max'))); if (function_exists('CREATE_FANCY_TIME')) { - define('__BEG_TIMEOUT' , CREATE_FANCY_TIME($_CONFIG['beg_timeout'])); - define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME($_CONFIG['beg_uid_timeout'])); + define('__BEG_TIMEOUT' , CREATE_FANCY_TIME(getConfig('beg_timeout'))); + define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME(getConfig('beg_uid_timeout'))); } else { - define('__BEG_TIMEOUT ' , round($_CONFIG['beg_timeout'] / 60)." ".MINUTES); - define('__BEG_UID_TIMEOUT', round($_CONFIG['beg_uid_timeout'] / 60)." ".MINUTES); + define('__BEG_TIMEOUT ' , round(getConfig('beg_timeout') / 60)." ".MINUTES); + define('__BEG_UID_TIMEOUT', round(getConfig('beg_uid_timeout') / 60)." ".MINUTES); } // Load template diff --git a/inc/modules/member/what-beg2.php b/inc/modules/member/what-beg2.php index d3ce12bbc0..dad1353420 100644 --- a/inc/modules/member/what-beg2.php +++ b/inc/modules/member/what-beg2.php @@ -50,23 +50,21 @@ $LAST = "%s"; $ONLINE = ""; if (EXT_IS_ACTIVE("autopurge")) { // Use last online timestamp to keep inactive members away from here $LAST = " AND last_online >= (UNIX_TIMESTAMP() - %s)"; - $ONLINE = $_CONFIG['ap_inactive_since']; + $ONLINE = getConfig('ap_inactive_since'); } // Let's check if there are some points left we can "pay"... $result = SQL_QUERY_ESC("SELECT userid, beg_points AS beg, last_online FROM "._MYSQL_PREFIX."_user_data WHERE beg_points > 0 AND status='CONFIRMED'".$LAST." ORDER BY beg_points DESC, last_online DESC, userid LIMIT %s", - array($ONLINE, $_CONFIG['beg_ranks']), __FILE__, __LINE__); + array($ONLINE, getConfig('beg_ranks')), __FILE__, __LINE__); // Reset temporary variable and check for users $OUT = ""; -if (SQL_NUMROWS($result) > 0) -{ +if (SQL_NUMROWS($result) > 0) { // Load our winners... $SW = 2; $cnt = 1; - while(list($uid, $turbo, $last) = SQL_FETCHROW($result)) - { + while(list($uid, $turbo, $last) = SQL_FETCHROW($result)) { // Prepare data for the template $content = array( 'sw' => $SW, @@ -82,9 +80,7 @@ if (SQL_NUMROWS($result) > 0) // Count one up and switch colors $cnt++;$SW = 3 - $SW; } -} - else -{ +} else { // No one is interested in our "active rallye" ! :-( $OUT = LOAD_TEMPLATE("member_beg_404", true); } diff --git a/inc/modules/member/what-bonus.php b/inc/modules/member/what-bonus.php index 324fbda0e5..15861a7bcf 100644 --- a/inc/modules/member/what-bonus.php +++ b/inc/modules/member/what-bonus.php @@ -49,11 +49,11 @@ if (GET_EXT_VERSION("bonus") >= "0.6.9") { // Add more bonus points here $USE = "(0"; - if ($_CONFIG['bonus_click_yn'] == "Y") $USE .= " + turbo_bonus"; - if ($_CONFIG['bonus_login_yn'] == "Y") $USE .= " + login_bonus"; - if ($_CONFIG['bonus_order_yn'] == "Y") $USE .= " + bonus_order"; - if ($_CONFIG['bonus_stats_yn'] == "Y") $USE .= " + bonus_stats"; - if ($_CONFIG['bonus_ref_yn'] == "Y") $USE .= " + bonus_ref"; + if (getConfig('bonus_click_yn') == "Y") $USE .= " + turbo_bonus"; + if (getConfig('bonus_login_yn') == "Y") $USE .= " + login_bonus"; + if (getConfig('bonus_order_yn') == "Y") $USE .= " + bonus_order"; + if (getConfig('bonus_stats_yn') == "Y") $USE .= " + bonus_stats"; + if (getConfig('bonus_ref_yn') == "Y") $USE .= " + bonus_ref"; $USE .= ")"; } else @@ -67,7 +67,7 @@ $LAST = "%s"; $ONLINE = ""; if (EXT_IS_ACTIVE("autopurge")) { // Use last online timestamp to keep inactive members away from here $LAST = " AND last_online >= (UNIX_TIMESTAMP() - %s)"; - $ONLINE = $_CONFIG['ap_inactive_since']; + $ONLINE = getConfig('ap_inactive_since'); } // Let's check if there are some points left we can "pay"... @@ -75,7 +75,7 @@ $result = SQL_QUERY_ESC("SELECT userid, ".$USE." AS points, last_online FROM "._ WHERE ".$USE." > 0 AND status='CONFIRMED'".$LAST." ORDER BY points DESC, last_online DESC, userid LIMIT %s", - array($ONLINE, $_CONFIG['bonus_ranks']), __FILE__, __LINE__); + array($ONLINE, getConfig('bonus_ranks')), __FILE__, __LINE__); // Reset temporary variable and check for users $OUT = ""; diff --git a/inc/modules/member/what-categories.php b/inc/modules/member/what-categories.php index 3a7bbc9e04..796eb90adf 100644 --- a/inc/modules/member/what-categories.php +++ b/inc/modules/member/what-categories.php @@ -59,7 +59,7 @@ if ($cats > 0) { if ($joined == "N") $cnt++; } - if (($cats - $cnt) < $_CONFIG['least_cats']) + if (($cats - $cnt) < getConfig('least_cats')) { unset($_POST['ok']); $LEAST = true; @@ -71,7 +71,7 @@ if ($cats > 0) { switch ($joined) { - case 'Y': + case "Y": $sql = ""; $result_user = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_cats WHERE userid=%s AND cat_id=%s LIMIT 1", array($UID, bigintval($cat)), __FILE__, __LINE__); @@ -87,7 +87,7 @@ if ($cats > 0) } break; - case 'N': + case "N": $sql = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_cats WHERE userid=%s AND cat_id=%s LIMIT 1"; break; } @@ -105,7 +105,7 @@ if ($cats > 0) if ($LEAST) { // Also here we have to secure it... :( - LOAD_TEMPLATE("admin_settings_saved", true, CATS_LEAST.": ".$_CONFIG['least_cats']); + LOAD_TEMPLATE("admin_settings_saved", true, CATS_LEAST.": ".getConfig('least_cats')); } // Put some data into constants for the template define('__ROWS', ($cats*2+4)); diff --git a/inc/modules/member/what-doubler.php b/inc/modules/member/what-doubler.php index cdb130df20..631f8420f8 100644 --- a/inc/modules/member/what-doubler.php +++ b/inc/modules/member/what-doubler.php @@ -46,11 +46,11 @@ if (!defined('__SECURITY')) { ADD_DESCR("member", __FILE__); // Percent values etc. -define('__CHARGE_VALUE', TRANSLATE_COMMA($_CONFIG['doubler_charge'] * 100)); -define('__REF_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_ref'] * 100)); -define('__TOTAL_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_points'])); -define('__MIN_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_min'])); -define('__MAX_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_max'])); +define('__CHARGE_VALUE', TRANSLATE_COMMA(getConfig('doubler_charge') * 100)); +define('__REF_VALUE' , TRANSLATE_COMMA(getConfig('doubler_ref') * 100)); +define('__TOTAL_VALUE' , TRANSLATE_COMMA(getConfig('doubler_points'))); +define('__MIN_VALUE' , TRANSLATE_COMMA(getConfig('doubler_min'))); +define('__MAX_VALUE' , TRANSLATE_COMMA(getConfig('doubler_max'))); // Transfer referal ID if (EXT_IS_ACTIVE("nickname")) @@ -76,10 +76,10 @@ if (EXT_IS_ACTIVE("nickname")) } // Usage counter -define('__DOUBLER_COUNTER', $_CONFIG['doubler_counter']); +define('__DOUBLER_COUNTER', getConfig('doubler_counter')); // Which mail-send-mode did the admin setup? -switch ($_CONFIG['doubler_send_mode']) +switch (getConfig('doubler_send_mode')) { case "DIRECT": define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_DIRECT); @@ -100,7 +100,7 @@ define('__DOUBLER_PAYOUT_NEXT', DOUBLER_GENERATE_TABLE($GLOBALS['userid'])); define('__DOUBLER_PAYOUT_REF', DOUBLER_GENERATE_TABLE($GLOBALS['userid'], "N", "Y", "DESC")); // Generate timemark -define('__TIMEOUT_MARK', CREATE_FANCY_TIME($_CONFIG['doubler_timeout'])); +define('__TIMEOUT_MARK', CREATE_FANCY_TIME(getConfig('doubler_timeout'))); // Points left to double define('__LEFT_VALUE', DOUBLER_GET_TOTAL_POINTS_LEFT()); diff --git a/inc/modules/member/what-holiday.php b/inc/modules/member/what-holiday.php index 0a840a1882..ecbbe17930 100644 --- a/inc/modules/member/what-holiday.php +++ b/inc/modules/member/what-holiday.php @@ -61,13 +61,13 @@ if ((SQL_NUMROWS($result1) == 1) || (SQL_NUMROWS($result2) == 1)) if (empty($stamp1)) $stamp1 = 0; if (empty($stamp2)) $stamp2 = 0; - if ((($stamp1 + $_CONFIG['holiday_lock']) > time()) || (($stamp2 + $_CONFIG['holiday_lock']) > time())) + if ((($stamp1 + getConfig('holiday_lock')) > time()) || (($stamp2 + getConfig('holiday_lock')) > time())) { // Mail order is to close away! unset($_POST['ok']); unset($_POST['stop']); - if (($stamp1 + $_CONFIG['holiday_lock']) > time()) + if (($stamp1 + getConfig('holiday_lock')) > time()) { // Mail found in pool $stamp = $stamp1; @@ -96,7 +96,7 @@ if (isset($_POST['ok'])) // Test both values $TEST = $END - $START; - if (($TEST < 0) || ($TEST > ($_CONFIG['one_day'] * $_CONFIG['holiday_max'])) || ($START < time()) || ($END < time())) + if (($TEST < 0) || ($TEST > (getConfig('one_day') * getConfig('holiday_max'))) || ($START < time()) || ($END < time())) { // Time test failed unset($_POST['ok']); @@ -146,7 +146,7 @@ WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); list($active, $locked) = SQL_FETCHROW($result); SQL_FREERESULT($result); - if (($active == "Y") && (($locked + $_CONFIG['holiday_lock']) < time())) + if (($active == "Y") && (($locked + getConfig('holiday_lock')) < time())) { // Load data $result = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM "._MYSQL_PREFIX."_user_holidays @@ -199,12 +199,12 @@ WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); SQL_FREERESULT($result); // Check for lock - if (($locked + $_CONFIG['holiday_lock']) < time()) + if (($locked + getConfig('holiday_lock')) < time()) { // User can deactivate his holiday request switch ($active) { - case 'Y': // Display deactivation form + case "Y": // Display deactivation form // Load starting and ending date $result = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM "._MYSQL_PREFIX."_user_holidays WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); @@ -236,16 +236,16 @@ WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); } break; - case 'N': // Display activation form + case "N": // Display activation form // Starting day - define('_START_DAY' , ADD_SELECTION("day" , date("d", (time() + $_CONFIG['one_day'])), "start")); - define('_START_MONTH', ADD_SELECTION("month", date("m", (time() + $_CONFIG['one_day'])), "start")); - define('_START_YEAR' , ADD_SELECTION("year" , date('Y', (time() + $_CONFIG['one_day'])), "start")); + define('_START_DAY' , ADD_SELECTION("day" , date("d", (time() + getConfig('one_day'))), "start")); + define('_START_MONTH', ADD_SELECTION("month", date("m", (time() + getConfig('one_day'))), "start")); + define('_START_YEAR' , ADD_SELECTION("year" , date('Y', (time() + getConfig('one_day'))), "start")); // Calcualte ending date - $D = date("d", time() + $_CONFIG['one_day'] + ($_CONFIG['one_day'] * $_CONFIG['holiday_max'])); - $M = date("m", time() + $_CONFIG['one_day'] + ($_CONFIG['one_day'] * $_CONFIG['holiday_max'])); - $Y = date('Y', time() + $_CONFIG['one_day'] + ($_CONFIG['one_day'] * $_CONFIG['holiday_max'])); + $D = date("d", time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max'))); + $M = date("m", time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max'))); + $Y = date('Y', time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max'))); // Ending day define('_END_DAY' , ADD_SELECTION("day" , $D, "end")); @@ -253,7 +253,7 @@ WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); define('_END_YEAR' , ADD_SELECTION("year" , $Y, "end")); // Copy value from configuration - define('__HOLIDAY_MAX', $_CONFIG['holiday_max']); + define('__HOLIDAY_MAX', getConfig('holiday_max')); // Output form LOAD_TEMPLATE("member_holiday_form"); diff --git a/inc/modules/member/what-mydata.php b/inc/modules/member/what-mydata.php index 37715eccb3..185681b6b2 100644 --- a/inc/modules/member/what-mydata.php +++ b/inc/modules/member/what-mydata.php @@ -76,10 +76,10 @@ case "show": // Show his data $DATA[13] = MAKE_DATETIME($DATA[13], "0"); // How far is last change on his profile away from now? - if ((($DATA[13] + $_CONFIG['profile_lock']) > time()) && (!IS_ADMIN()) && ($_CONFIG['profile_lock'] > 0)) + if ((($DATA[13] + getConfig('profile_lock')) > time()) && (!IS_ADMIN()) && (getConfig('profile_lock') > 0)) { // You cannot change your account - define('CHANGE', "".MEMBER_PROFILE_LOCKED_1.MAKE_DATETIME($DATA[13] + $_CONFIG['profile_lock'], "0").MEMBER_PROFILE_LOCKED_2.""); + define('CHANGE', "".MEMBER_PROFILE_LOCKED_1.MAKE_DATETIME($DATA[13] + getConfig('profile_lock'), "0").MEMBER_PROFILE_LOCKED_2.""); } else { @@ -119,12 +119,12 @@ FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", $DATA = SQL_FETCHROW($result); SQL_FREERESULT($result); - $DATA[13] = $DATA[12] + $_CONFIG['profile_lock']; + $DATA[13] = $DATA[12] + getConfig('profile_lock'); // How far is last change on his profile away from now? - if (($DATA[13] > time()) && (!IS_ADMIN()) && ($_CONFIG['profile_lock'] > 0)) + if (($DATA[13] > time()) && (!IS_ADMIN()) && (getConfig('profile_lock') > 0)) { - $DATA[13] = MAKE_DATETIME($DATA[13] + $_CONFIG['profile_lock'], "0"); + $DATA[13] = MAKE_DATETIME($DATA[13] + getConfig('profile_lock'), "0"); // You cannot change your account LOAD_TEMPLATE("member_mydata_locked"); } @@ -196,11 +196,11 @@ case "save": // Save entered data array(UID_VALUE), __FILE__, __LINE__); $DATA = SQL_FETCHROW($result); SQL_FREERESULT($result); - $DATA[3] = $DATA[2] + $_CONFIG['profile_lock']; + $DATA[3] = $DATA[2] + getConfig('profile_lock'); // How far is last change on his profile away from now? - if (($DATA[3] > time()) && (!IS_ADMIN()) && ($_CONFIG['profile_lock'] > 0)) { - $DATA[3] = MAKE_DATETIME($DATA[3] + $_CONFIG['profile_lock'], "0"); + if (($DATA[3] > time()) && (!IS_ADMIN()) && (getConfig('profile_lock') > 0)) { + $DATA[3] = MAKE_DATETIME($DATA[3] + getConfig('profile_lock'), "0"); // You cannot change your account LOAD_TEMPLATE("member_mydata_locked"); } elseif (!VALIDATE_EMAIL($_POST['addy'])) { diff --git a/inc/modules/member/what-newsletter.php b/inc/modules/member/what-newsletter.php index 7dd4140d33..8868b04a40 100644 --- a/inc/modules/member/what-newsletter.php +++ b/inc/modules/member/what-newsletter.php @@ -52,12 +52,12 @@ list($status, $until, $span) = SQL_FETCHROW($result); SQL_FREERESULT($result); // Remember charge value -define('__CHARGE_VALUE', TRANSLATE_COMMA($_CONFIG['nl_charge'])); +define('__CHARGE_VALUE', TRANSLATE_COMMA(getConfig('nl_charge'))); if ((isset($_POST['ok'])) && ($status == "Y") && ($span == "0")) { // Save request - $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET nl_timespan='".($_CONFIG['one_day'] * 30)."' WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET nl_timespan='".(getConfig('one_day') * 30)."' WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Load admin message @@ -90,13 +90,13 @@ VALUES ('0','NEW','NL_UNSUBSCRIBE','".ADMIN_NL_SUBJECT."','".$admin_msg."', UNIX // Set status message and submit button switch ($status) { - case 'Y': // Receives the newsletter + case "Y": // Receives the newsletter define('__STATUS_VALUE', NL_MEMBER_ON); define('__UNTIL_VALUE', ""); define('NL_SUBMIT', NL_MEMBER_SUBMIT_OFF); break; - case 'N': // Does not receive the newsletter + case "N": // Does not receive the newsletter define('__STATUS_VALUE', NL_MEMBER_OFF); define('__UNTIL_VALUE', MAKE_DATETIME($until, "2")); define('NL_SUBMIT', NL_MEMBER_SUBMIT_ON); diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index 0ef9854cb3..eace0213cb 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -56,7 +56,7 @@ if (empty($_POST['receiver'])) $_POST['receiver'] = ""; if (IS_ADMIN()) $whereStatement = ""; // Minimum mails / order -define('__MIN_VALUE', $_CONFIG['order_min']); +define('__MIN_VALUE', getConfig('order_min')); // Count unconfirmed mails $result_links = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s", @@ -82,7 +82,7 @@ SQL_FREERESULT($result_mmails); if ($HOLIDAY == $DMY) $HOLIDAY='N'; $ALLOWED = $MAXI - $ORDERS; -if ($_CONFIG['order_max_full'] == "MAX") $ALLOWED = $MAXI; +if (getConfig('order_max_full') == "MAX") $ALLOWED = $MAXI; // Check HTML extension $HTML_EXT = EXT_IS_ACTIVE("html_mail"); @@ -109,7 +109,7 @@ if (($HOLIDAY == "Y") && (GET_EXT_VERSION("holiday") >= "0.1.3")) { $result = SQL_QUERY_ESC("SELECT id, data_type FROM "._MYSQL_PREFIX."_pool WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", - array($GLOBALS['userid'], $_POST['url'], $_CONFIG['url_tlock']), __FILE__, __LINE__); + array($GLOBALS['userid'], $_POST['url'], getConfig('url_tlock')), __FILE__, __LINE__); $type = "TEMP"; $id = 0; if (SQL_NUMROWS($result) == 1) { @@ -123,7 +123,7 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", // No entry found, so we need to check out the stats table as well... :) // We have to add that suff here, now we continue WITHOUT checking and check the text and subject against some filters $URL = ""; - if ($_CONFIG['test_text'] == "Y") { + if (getConfig('test_text') == "Y") { // Test submitted text against some filters (length, URLs in text etc.) if ((strpos(strtolower($_POST['text']), "https://") > -1) || (strpos(strtolower($_POST['text']), "http://") > -1) || (strpos(strtolower($_POST['text']), "www") > -1)) { // URL found! @@ -134,14 +134,14 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", $TEST = str_replace("\n", "", str_replace("\r", "", $_POST['text'])); // Text length within allowed length? - if (strlen($TEST) > $_CONFIG['max_tlength']) { + if (strlen($TEST) > getConfig('max_tlength')) { // Text is too long! $URL = URL."/modules.php?module=login&what=order&msg=".CODE_OVERLENGTH; } // END - if } // END - if // Shall I test the subject line against URLs? - if ($_CONFIG['test_subj'] == "Y") { + if (getConfig('test_subj') == "Y") { // Check the subject line for issues $_POST['subject'] = str_replace("\\", "[nl]", substr($_POST['subject'], 0, 200)); if ((strpos(strtolower($_POST['subject']), "http://") > -1) || (strpos(strtolower($_POST['subject']), "www") > -1)) { @@ -151,7 +151,7 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", } // END - if // And shall I check that his URL is not in the black list? - if ($_CONFIG['url_blacklist'] == "Y") { + if (getConfig('url_blacklist') == "Y") { // Ok, I do that for you know... $result = SQL_QUERY_ESC("SELECT timestamp FROM "._MYSQL_PREFIX."_url_blist WHERE url='%s' LIMIT 1", array($_POST['url']), __FILE__, __LINE__); @@ -165,7 +165,7 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", } // END - if // Enougth receivers entered? - if (($_POST['receiver'] < $_CONFIG['order_min']) && (!IS_ADMIN())) { + if (($_POST['receiver'] < getConfig('order_min')) && (!IS_ADMIN())) { // Less than allowed receivers entered! $URL = URL."/modules.php?module=login&what=order&msg=".CODE_MORE_RECEIVERS3; } // END - if @@ -199,7 +199,7 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", if (empty($URL)) { // Check if category and number of receivers is okay $ADD = ""; - if (($_CONFIG['order_multi_page'] == "Y") && (!empty($_POST['zip']))) { + if ((getConfig('order_multi_page') == "Y") && (!empty($_POST['zip']))) { // Choose recipients by ZIP code $ADD = " AND d.zip LIKE '".bigintval($_POST['zip'])."{PER}'"; } // END - if @@ -213,8 +213,8 @@ ORDER BY d.%s %s", array( bigintval($_POST['cat']), $GLOBALS['userid'], - $_CONFIG['order_select'], - $_CONFIG['order_mode'], + getConfig('order_select'), + getConfig('order_mode'), ), __FILE__, __LINE__); // Do we enougth receivers left? @@ -397,10 +397,10 @@ array( } elseif ($_POST['receiver'] == "0") { // Not enougth receivers selected $URL = URL."/modules.php?module=login&what=order&msg=".CODE_MORE_RECEIVERS1; -} elseif (($ALLOWED == 0) && ($_CONFIG['order_max_full'] == "ORDER")) { +} elseif (($ALLOWED == 0) && (getConfig('order_max_full') == "ORDER")) { // No more mail orders allowed LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_ORDER_ALLOWED_EXHAUSTED); -} elseif (($links < $_CONFIG['unconfirmed']) && ($mmails == "1")) { +} elseif (($links < getConfig('unconfirmed')) && ($mmails == "1")) { // Display order form $result_cats = SQL_QUERY("SELECT id, cat FROM "._MYSQL_PREFIX."_cats".$whereStatement." ORDER BY sort", __FILE__, __LINE__); if (SQL_NUMROWS($result_cats) > 0) { @@ -455,7 +455,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); $result_ver = SQL_QUERY_ESC("SELECT zip FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s".$HTML." AND receive_mails > 0 AND status='CONFIRMED' LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); - if ((SQL_NUMROWS($result_ver) == 1) && (!empty($_POST['zip'])) && ($_CONFIG['order_multi_page'] == "Y")) { + if ((SQL_NUMROWS($result_ver) == 1) && (!empty($_POST['zip'])) && (getConfig('order_multi_page') == "Y")) { list($zip) = SQL_FETCHROW($result_ver); SQL_FREERESULT($result_ver); if (substr($zip, 0, strlen($_POST['zip'])) == $_POST['zip']) { @@ -498,13 +498,13 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); SQL_FREERESULT($result); // Calculate hours... - $STD = round($_CONFIG['url_tlock'] / 60 / 60); + $STD = round(getConfig('url_tlock') / 60 / 60); // Minutes... - $MIN = round(($_CONFIG['url_tlock'] - $STD * 60 * 60) / 60); + $MIN = round((getConfig('url_tlock') - $STD * 60 * 60) / 60); // And seconds - $SEC = $_CONFIG['url_tlock'] - $STD * 60 * 60 - $MIN * 60; + $SEC = getConfig('url_tlock') - $STD * 60 * 60 - $MIN * 60; // Finally contruct the message $MSG = MEMBER_URL_TIME_LOCK."
".CONFIG_URL_TLOCK." ".$STD." ". @@ -549,7 +549,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); break; case CODE_MORE_RECEIVERS3: - $MSG = MEMBER_ENTER_MORE_MIN_RECEIVERS_1.$_CONFIG['order_min'].MEMBER_ENTER_MORE_MIN_RECEIVERS_2; + $MSG = MEMBER_ENTER_MORE_MIN_RECEIVERS_1.getConfig('order_min').MEMBER_ENTER_MORE_MIN_RECEIVERS_2; break; case CODE_INVALID_URL: @@ -582,7 +582,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); $TOTAL = TRANSLATE_COMMA($TOTAL); // Check how many mail orders he has placed today and how many he's allowed to send - switch ($_CONFIG['order_max_full']) + switch (getConfig('order_max_full')) { case "MAX": // He is allowed to send as much as possible define('ORDER_MAX_VALUE', ORDER_ALLOED_MAX); @@ -593,7 +593,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); break; default: // Unknown/invalid - DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", $_CONFIG['order_max_full'])); + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", getConfig('order_max_full'))); define('ORDER_MAX_VALUE', ORDER_ALLOED_UNKNOWN); break; } @@ -624,7 +624,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); } // 01 2 21 12 2 23 443 3 3210 - if ((!empty($_POST['data'])) || (($_CONFIG['order_multi_page'] == "N") && ((!IS_ADMIN()) && (!$HTML_EXT)))) { + if ((!empty($_POST['data'])) || ((getConfig('order_multi_page') == "N") && ((!IS_ADMIN()) && (!$HTML_EXT)))) { // Pre-output categories $CAT = ""; foreach ($CATS['id'] as $key => $value) { @@ -676,7 +676,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); $ADD = ""; if ($HTML_EXT) { // Add some content when html extension is active - if (($_CONFIG['order_multi_page'] == "Y") || (IS_ADMIN())) $ADD = " \n"; + if ((getConfig('order_multi_page') == "Y") || (IS_ADMIN())) $ADD = " \n"; define('MEMBER_HTML_EXTENSION', LOAD_TEMPLATE("member_order-html_intro", true)); } else { // No HTML extension installed @@ -684,10 +684,10 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); } // Do we want ZIP code or not? - if (($_CONFIG['order_multi_page'] == "Y") || (IS_ADMIN())) { + if ((getConfig('order_multi_page') == "Y") || (IS_ADMIN())) { // Yes $content = array( - 'zip' => $_POST['zip'], + 'zip' => bigintval($_POST['zip']), 'add' => $ADD ); define('MEMBER_ZIP_CONTENT', LOAD_TEMPLATE("member_order-zip1", true, $content)); @@ -716,7 +716,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_HAS_ZERO_MMAILS); } else { // Please confirm some mails first! - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_LINKS_LEFT_1.$links.MEMBER_LINKS_LEFT_2.$_CONFIG['unconfirmed'].MEMBER_LINKS_LEFT_3); + LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_LINKS_LEFT_1.$links.MEMBER_LINKS_LEFT_2.getConfig('unconfirmed').MEMBER_LINKS_LEFT_3); } if (!empty($URL)) { diff --git a/inc/modules/member/what-payout.php b/inc/modules/member/what-payout.php index 2ad39b14f0..8fbcba686a 100644 --- a/inc/modules/member/what-payout.php +++ b/inc/modules/member/what-payout.php @@ -49,17 +49,22 @@ ADD_DESCR("member", __FILE__); $result_depths = SQL_QUERY("SELECT level, percents FROM "._MYSQL_PREFIX."_refdepths ORDER BY level", __FILE__, __LINE__); $TPTS = 0; -while (list($lvl, $per) = SQL_FETCHROW($result_depths)) -{ +while (list($lvl, $per) = SQL_FETCHROW($result_depths)) { // Load referal points $result_points = SQL_QUERY_ESC("SELECT points FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND ref_depth=%d LIMIT 1", - array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__); - if (SQL_NUMROWS($result_points) == 1) - { + array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__); + + // Entry found? + if (SQL_NUMROWS($result_points) == 1) { + // Load points list($points) = SQL_FETCHROW($result_points); - SQL_FREERESULT($result_points); + + // Add them to total $TPTS += $points; } + + // Free result + SQL_FREERESULT($result_points); } // Free memory diff --git a/inc/modules/member/what-points.php b/inc/modules/member/what-points.php index dc1fa059bb..642ae6b9cc 100644 --- a/inc/modules/member/what-points.php +++ b/inc/modules/member/what-points.php @@ -137,10 +137,10 @@ 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")) getConfig('bonus_active') = "X"; // Display login bonus and turbo-click bonus -if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && ($_CONFIG['bonus_active'] == "Y")) { +if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && (getConfig('bonus_active') == "Y")) { $ADD = ", 0, 0, 0"; if (GET_EXT_VERSION("bonus") >= "0.4.4") $ADD = ", bonus_ref, bonus_order, bonus_stats"; @@ -168,7 +168,7 @@ if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && ($_CONF // Output rows define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_bonus_rows", true)); -} elseif ($_CONFIG['bonus_active'] == "N") { +} elseif (getConfig('bonus_active') == "N") { // Bonus active rallye deactivated define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_bonus_disabled", true)); } elseif ((IS_ADMIN()) && (EXT_VERSION_IS_OLDER("bonus", "0.2.2")) && (EXT_IS_ACTIVE("bonus"))) { diff --git a/inc/modules/member/what-primera.php b/inc/modules/member/what-primera.php index 67e2215cb2..ae24e03d49 100644 --- a/inc/modules/member/what-primera.php +++ b/inc/modules/member/what-primera.php @@ -48,7 +48,7 @@ if (!defined('__SECURITY')) { ADD_DESCR("member", __FILE__); // Check if the admin has entered the data -if ((empty($_CONFIG['primera_api_name'])) || (empty($_CONFIG['primera_api_md5']))) { +if ((getConfig('primera_api_name') == "") || (getConfig('primera_api_md5') == "")) { // Something important is missing... LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_API_DATA_MISSING); return; @@ -60,7 +60,7 @@ $content = array(); $points = false; // Is the mode set (payout only) if (!isset($_GET['mode'])) { // Get referal id - $content['refid'] = bigintval($_CONFIG['primera_refid']); + $content['refid'] = bigintval(getConfig('primera_refid')); // Get Primus id $result = SQL_QUERY_ESC("SELECT primera_userid FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", @@ -69,14 +69,14 @@ if (!isset($_GET['mode'])) { // Are there some entries? if (SQL_NUMROWS($result) == 1) { // Fetch ID - list($content['primus_nickname']) = SQL_FETCHROW($result); + list($content['primera_nickname']) = SQL_FETCHROW($result); } // END - if // Free result SQL_FREERESULT($result); // Is there an ID? - if ((!empty($content['primus_nickname'])) && (!isset($_GET['mode']))) { + if ((!empty($content['primera_nickname'])) && (!isset($_GET['mode']))) { // Then use an other "mode" $_GET['mode'] = "list"; @@ -118,28 +118,28 @@ if ($_GET['mode'] == "pay") { $points = bigintval($points[0]); // Remove the registration fee - $points = $points - $_CONFIG['points_register']; + $points = $points - getConfig('points_register'); // Is this enougth for a payout? - if ($points < $_CONFIG['primera_min_payout']) { + if ($points < getConfig('primera_min_payout')) { // No, then abort here - LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_MIN_PAYOUT_PAYOUT, TRANSLATE_COMMA($_CONFIG['primera_min_payout']))); + LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_MIN_PAYOUT_PAYOUT, TRANSLATE_COMMA(getConfig('primera_min_payout')))); return; } // Add points to content array $content['points'] = $points; - $content['min_points'] = TRANSLATE_COMMA($_CONFIG['primera_min_payout']); + $content['min_points'] = TRANSLATE_COMMA(getConfig('primera_min_payout')); // Get Primera id - $content['primus_nickname'] = ""; + $content['primera_nickname'] = ""; $result = SQL_QUERY_ESC("SELECT primera_userid FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Are there some entries? if (SQL_NUMROWS($result) == 1) { // Fetch ID - list($content['primus_nickname']) = SQL_FETCHROW($result); + list($content['primera_nickname']) = SQL_FETCHROW($result); } // Free result @@ -156,7 +156,7 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) { switch ($_GET['mode']) { case "pay": // Payout this exchange -> Primus // Is the user ID and password set? - if (empty($_POST['primus_nickname'])) { + if (empty($_POST['primera_nickname'])) { // Nothing entered in Primus nickname LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_EMPTY_USERNAME); OUTPUT_HTML("
"); @@ -172,9 +172,9 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) { // Only numbers in amount! LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_INVALID_AMOUNT); OUTPUT_HTML("
"); - } elseif ($_POST['amount'] < $_CONFIG['primera_min_payout']) { + } elseif ($_POST['amount'] < getConfig('primera_min_payout')) { // Not enougth entered! - LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_AMOUNT_SMALLER_MIN, bigintval($_CONFIG['primera_min_payout']))); + LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_AMOUNT_SMALLER_MIN, bigintval(getConfig('primera_min_payout')))); OUTPUT_HTML("
"); } elseif ($_POST['amount'] > $points) { // Not enougth points left! @@ -182,13 +182,13 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) { OUTPUT_HTML("
"); } else { // All is fine here so do the payout - $success = PRIMERA_EXECUTE_PAYOUT($_POST['primus_nickname'], md5($_POST['primera_password']), $_POST['amount']); + $success = PRIMERA_EXECUTE_PAYOUT($_POST['primera_nickname'], md5($_POST['primera_password']), $_POST['amount']); if ($success) { // Default is locked! $locked = true; // Shall I "pay" the referal points imidiately? - if ($_CONFIG['ref_payout'] == "0") { + if (getConfig('ref_payout') == "0") { // Yes, "pay" it now $locked = false; } // END - if @@ -198,7 +198,7 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) { // Update primera nickname $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET `primera_userid`=%s WHERE userid=%s LIMIT 1", - array($_POST['primus_nickname'], $GLOBALS['userid']), __FILE__, __LINE__); + array($_POST['primera_nickname'], $GLOBALS['userid']), __FILE__, __LINE__); // All done! LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_PAYOUT_DONE); diff --git a/inc/modules/member/what-rallyes.php b/inc/modules/member/what-rallyes.php index 0f8fcc58fe..7d280f1825 100644 --- a/inc/modules/member/what-rallyes.php +++ b/inc/modules/member/what-rallyes.php @@ -68,7 +68,7 @@ if (SQL_NUMROWS($result) == 1) define('__RALLYE_EXTRAS', RALLYE_HAS_EXPIRED); $expired = true; } - elseif (time() >= ($end - $_CONFIG['one_day'])) + elseif (time() >= ($end - getConfig('one_day'))) { // Rallye will expire in less one day! define('__RALLYE_EXTRAS', RALLYE_EXPIRE_ONE_DAY); diff --git a/inc/modules/member/what-refback.php b/inc/modules/member/what-refback.php index eac8db386d..9563cf746e 100644 --- a/inc/modules/member/what-refback.php +++ b/inc/modules/member/what-refback.php @@ -44,7 +44,7 @@ if (!defined('__SECURITY')) { } // Is the refback system enabled? -if ($_CONFIG['refback_enabled'] == "N") { +if (getConfig('refback_enabled') == "N") { // Output message LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_DISABLED); // Abort here @@ -62,7 +62,7 @@ if ((isset($_POST['edit'])) && (isset($_POST['id']))) { $percents = REVERT_COMMA($_POST['percents']); // Validate percents - if ((($percents >= $_CONFIG['refback_min_perc']) || (round($percents) == 0)) && ($percents <= $_CONFIG['refback_max_perc'])) { + if ((($percents >= getConfig('refback_min_perc')) || (round($percents) == 0)) && ($percents <= getConfig('refback_max_perc'))) { // Change ref-back for this direct id $status = REFBACK_CHANGE_MEMBER_PERCENTS($_POST['id'], $_POST['percents']); @@ -79,7 +79,7 @@ if ((isset($_POST['edit'])) && (isset($_POST['id']))) { } } else { // Percents out-of-bounds ;-) - LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS, $_CONFIG['refback_min_perc'], $_CONFIG['refback_max_perc'])); + LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS, getConfig('refback_min_perc'), getConfig('refback_max_perc'))); } // Insert line @@ -90,8 +90,8 @@ if ((isset($_POST['edit'])) && (isset($_POST['id']))) { // Translate comma $content['refback'] = TRANSLATE_COMMA($content['refback']); - $content['min'] = TRANSLATE_COMMA($_CONFIG['refback_min_perc'].".0"); - $content['max'] = TRANSLATE_COMMA($_CONFIG['refback_max_perc'].".0"); + $content['min'] = TRANSLATE_COMMA(getConfig('refback_min_perc').".0"); + $content['max'] = TRANSLATE_COMMA(getConfig('refback_max_perc').".0"); // Load form for editing LOAD_TEMPLATE("member_refback_edit", false, $content); diff --git a/inc/modules/member/what-surfbar_book.php b/inc/modules/member/what-surfbar_book.php index c10c6cdd8f..d38757f1f0 100644 --- a/inc/modules/member/what-surfbar_book.php +++ b/inc/modules/member/what-surfbar_book.php @@ -76,12 +76,12 @@ if (!SURFBAR_IF_USER_BOOK_MORE_URLS()) { $content = array( 'reward' => TRANSLATE_COMMA(SURFBAR_DETERMINE_REWARD(true)), 'costs' => TRANSLATE_COMMA(SURFBAR_DETERMINE_COSTS(true)), - 'max_order' => $_CONFIG['surfbar_max_order'], + 'max_order' => getConfig('surfbar_max_order'), 'curr_order' => SURFBAR_GET_TOTAL_USER_URLS() ); // Load surfbar order form - LOAD_TEMPLATE(sprintf("member_surfbar_book_%s", strtolower($_CONFIG['surfbar_pay_model'])), false, $content); + LOAD_TEMPLATE(sprintf("member_surfbar_book_%s", strtolower(getConfig('surfbar_pay_model'))), false, $content); } // diff --git a/inc/modules/member/what-surfbar_start.php b/inc/modules/member/what-surfbar_start.php index 9fb9095794..ccb4d2dd5c 100644 --- a/inc/modules/member/what-surfbar_start.php +++ b/inc/modules/member/what-surfbar_start.php @@ -48,17 +48,17 @@ ADD_DESCR("member", __FILE__); // Prepare content for output $content = array( - 'surfbar_static_reward' => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']), - 'surfbar_static_time' => CREATE_FANCY_TIME($_CONFIG['surfbar_static_time']), - 'surfbar_static_lock' => CREATE_FANCY_TIME($_CONFIG['surfbar_static_lock']), + 'surfbar_static_reward' => TRANSLATE_COMMA(getConfig('surfbar_static_reward')), + 'surfbar_static_time' => CREATE_FANCY_TIME(getConfig('surfbar_static_time')), + 'surfbar_static_lock' => CREATE_FANCY_TIME(getConfig('surfbar_static_lock')), 'surfbar_total_urls' => SURFBAR_GET_TOTAL_URLS("ACTIVE", "0") ); // In dynamic mode we need some more data -if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") { +if (getConfig('surfbar_pay_model') == "DYNAMIC") { // Total URLs $content = array( - 'surfbar_dynamic_percent' => TRANSLATE_COMMA($_CONFIG['surfbar_dynamic_percent']), + 'surfbar_dynamic_percent' => TRANSLATE_COMMA(getConfig('surfbar_dynamic_percent')), 'surfbar_total_urls' => SURFBAR_GET_TOTAL_URLS("ACTIVE", "0"), 'surfbar_user_urls' => SURFBAR_GET_TOTAL_USER_URLS(), 'surfbar_total_online' => SURFBAR_DETERMINE_TOTAL_ONLINE(), @@ -68,13 +68,13 @@ if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") { 'surfbar_min_time' => CREATE_FANCY_TIME(SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE()), 'surfbar_max_time' => CREATE_FANCY_TIME(SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE()), 'surfbar_dynamic_lock' => CREATE_FANCY_TIME(SURFBAR_CALCULATE_DYNAMIC_LOCK()), - 'surfbar_static_reward' => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']), - 'surfbar_static_time' => CREATE_FANCY_TIME($_CONFIG['surfbar_static_time']) + 'surfbar_static_reward' => TRANSLATE_COMMA(getConfig('surfbar_static_reward')), + 'surfbar_static_time' => CREATE_FANCY_TIME(getConfig('surfbar_static_time')) ); } // END - if // Load the template -LOAD_TEMPLATE("member_surfbar_start_".strtolower($_CONFIG['surfbar_pay_model']), false, $content); +LOAD_TEMPLATE("member_surfbar_start_".strtolower(getConfig('surfbar_pay_model')), false, $content); // Load surfbar link template LOAD_TEMPLATE("member_surfbar_link"); diff --git a/inc/modules/member/what-transfer.php b/inc/modules/member/what-transfer.php index 5b7288dfc4..5d1670bccf 100644 --- a/inc/modules/member/what-transfer.php +++ b/inc/modules/member/what-transfer.php @@ -66,15 +66,15 @@ case "new": // Start new transfer $total = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points") - GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points"); // Remember maximum value for template - define('__TRANSFER_MAX_VALUE', round($total - $_CONFIG['transfer_balance'] - 0.5)); + define('__TRANSFER_MAX_VALUE', round($total - getConfig('transfer_balance') - 0.5)); if (isset($_POST['ok'])) { // Add new transfer - if ($_CONFIG['transfer_code'] > 0) + if (getConfig('transfer_code') > 0) { // Check for code - $code = GEN_RANDOM_CODE($_CONFIG['transfer_code'], $_POST['code_chk'], $GLOBALS['userid'], __TRANSFER_MAX_VALUE); + $code = GEN_RANDOM_CODE(getConfig('transfer_code'), $_POST['code_chk'], $GLOBALS['userid'], __TRANSFER_MAX_VALUE); $valid_code = ($code == $_POST['code']); } else @@ -173,11 +173,11 @@ case "new": // Start new transfer define('__TRANSFER_REASON', $_POST['reason']); if (function_exists('CREATE_FANCY_TIME')) { - define('__TRANSFER_EXPIRES', CREATE_FANCY_TIME($_CONFIG['transfer_age'])); + define('__TRANSFER_EXPIRES', CREATE_FANCY_TIME(getConfig('transfer_age'))); } else { - define('__TRANSFER_EXPIRES', round($_CONFIG['transfer_age']/60/60/24)." ".DAYS); + define('__TRANSFER_EXPIRES', round(getConfig('transfer_age')/60/60/24)." ".DAYS); } // Generate tranafer id @@ -302,10 +302,10 @@ case "new": // Start new transfer define('__TRANSFER_USERID_SELECTION', $OUT); // Generate Code - if ($_CONFIG['transfer_code'] > 0) + if (getConfig('transfer_code') > 0) { $rand = mt_rand(0, 99999); - $code = GEN_RANDOM_CODE($_CONFIG['transfer_code'], $rand, $GLOBALS['userid'], __TRANSFER_MAX_VALUE); + $code = GEN_RANDOM_CODE(getConfig('transfer_code'), $rand, $GLOBALS['userid'], __TRANSFER_MAX_VALUE); $img = GENERATE_IMAGE($code, false); define('__TRANSFER_IMAGE_INPUT', " ".$img); } @@ -337,14 +337,14 @@ case "list_out": // List only outgoing transactions switch ($MODE) { case "list_in": - $SQL = "SELECT trans_id, from_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_in WHERE userid=%s ORDER BY time_trans DESC LIMIT ".$_CONFIG['transfer_max']; + $SQL = "SELECT trans_id, from_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_in WHERE userid=%s ORDER BY time_trans DESC LIMIT ".getConfig('transfer_max'); $NOTHING = TRANSFER_NO_INCOMING_TRANSFERS; define('__TRANSFER_SUM', TRANSFER_TOTAL_INCOMING); define('__TRANSFER_TITLE', TRANSFER_LIST_INCOMING); break; case "list_out": - $SQL = "SELECT trans_id, to_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out WHERE userid=%s ORDER BY time_trans DESC LIMIT ".$_CONFIG['transfer_max']; + $SQL = "SELECT trans_id, to_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out WHERE userid=%s ORDER BY time_trans DESC LIMIT ".getConfig('transfer_max'); $NOTHING = TRANSFER_NO_OUTGOING_TRANSFERS; define('__TRANSFER_SUM', TRANSFER_TOTAL_OUTGOING); define('__TRANSFER_TITLE', TRANSFER_LIST_OUTGOING); @@ -422,7 +422,7 @@ KEY(party_uid) // Let's begin with the incoming list $result = SQL_QUERY_ESC("SELECT trans_id, from_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_in WHERE userid=%s ORDER BY id LIMIT %s", -array($GLOBALS['userid'], $_CONFIG['transfer_max']), __FILE__, __LINE__); +array($GLOBALS['userid'], getConfig('transfer_max')), __FILE__, __LINE__); while ($DATA = SQL_FETCHROW($result)) { $DATA[] = "IN"; @@ -435,7 +435,7 @@ array($GLOBALS['userid'], $_CONFIG['transfer_max']), __FILE__, __LINE__); // As the last table transfer data from outgoing table to temporary $result = SQL_QUERY_ESC("SELECT trans_id, to_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out WHERE userid=%s ORDER BY id LIMIT %s", -array($GLOBALS['userid'], $_CONFIG['transfer_max']), __FILE__, __LINE__); +array($GLOBALS['userid'], getConfig('transfer_max')), __FILE__, __LINE__); while ($DATA = SQL_FETCHROW($result)) { $DATA[] = "OUT"; @@ -566,13 +566,13 @@ case "": // Overview page switch ($opt_in) { - case 'Y': + case "Y": define('__TRANSFER_ALLOW_Y', " checked=\"checked\""); define('__TRANSFER_ALLOW_N', ""); define('__TRANSFER_NEW_LINK', "".TRANSFER_NOW_LINK.""); break; - case 'N': + case "N": define('__TRANSFER_ALLOW_Y', ""); define('__TRANSFER_ALLOW_N', " checked=\"checked\""); define('__TRANSFER_NEW_LINK', TRANSFER_PLEASE_ALLOW_OPT_IN); @@ -580,7 +580,11 @@ case "": // Overview page } // Check for latest out-transfers - $result = SQL_QUERY_ESC("SELECT time_trans FROM "._MYSQL_PREFIX."_user_transfers_out WHERE time_trans > (UNIX_TIMESTAMP() - ".$_CONFIG['transfer_timeout'].") AND userid=%s ORDER BY time_trans DESC LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT time_trans +FROM "._MYSQL_PREFIX."_user_transfers_out +WHERE time_trans > (UNIX_TIMESTAMP() - %s) AND userid=%s +ORDER BY time_trans DESC +LIMIT 1", array(getConfig('transfer_timeout'), $GLOBALS['userid']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Load template define('__TRANSFER_SETTINGS_CONTENT', LOAD_TEMPLATE("member_transfer_settings", true)); diff --git a/inc/modules/member/what-unconfirmed.php b/inc/modules/member/what-unconfirmed.php index f381e43224..0d010865ae 100644 --- a/inc/modules/member/what-unconfirmed.php +++ b/inc/modules/member/what-unconfirmed.php @@ -188,7 +188,7 @@ LIMIT 1", ); // Load row template - if ($_CONFIG['show_points_unconfirmed'] == "Y") { + if (getConfig('show_points_unconfirmed') == "Y") { $OUT .= LOAD_TEMPLATE("member_unconfirmed_row", true, $content); } else { $OUT .= LOAD_TEMPLATE("member_unconfirmed_row_nopoints", true, $content); @@ -205,7 +205,7 @@ LIMIT 1", ); // Display points or not? - if ($_CONFIG['show_points_unconfirmed'] == "Y") { + if (getConfig('show_points_unconfirmed') == "Y") { $OUT .= LOAD_TEMPLATE("member_unconfirmed_404", true, $content); } else { $OUT .= LOAD_TEMPLATE("member_unconfirmed_404_nopoints", true, $content); @@ -229,7 +229,7 @@ LIMIT 1", define('__UNCONFIRMED_ROWS', $OUT); // Load main template - if ($_CONFIG['show_points_unconfirmed'] == "Y") { + if (getConfig('show_points_unconfirmed') == "Y") { LOAD_TEMPLATE("member_unconfirmed_table"); } else { LOAD_TEMPLATE("member_unconfirmed_table_nopoints"); diff --git a/inc/modules/member/what-wernis.php b/inc/modules/member/what-wernis.php index 3c7a323c9a..ae45f45c00 100644 --- a/inc/modules/member/what-wernis.php +++ b/inc/modules/member/what-wernis.php @@ -47,7 +47,7 @@ if (!defined('__SECURITY')) { ADD_DESCR("member", __FILE__); // Check if the admin has entered the data -if ((empty($_CONFIG['wernis_api_id'])) || (empty($_CONFIG['wernis_api_md5']))) { +if ((getConfig('wernis_api_id') == "") || (getConfig('wernis_api_md5') == "")) { // Something important is missing... LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_API_DATA_MISSING); return; @@ -59,7 +59,7 @@ $content = array(); $points = false; // Is the mode set (withdraw or payout) if ((!isset($_GET['mode'])) || ($_GET['mode'] == "choose")) { // Let the user choose what he wants to do - $content['refid'] = bigintval($_CONFIG['wernis_refid']); + $content['refid'] = bigintval(getConfig('wernis_refid')); $content['wds66_id'] = 0; // Get WDS66 id @@ -110,13 +110,13 @@ if ((!isset($_GET['mode'])) || ($_GET['mode'] == "choose")) { $content['withdraw_link'] = "".WERNIS_MEMBER_WITHDRAW_DISABLED.""; // Is the payout mode active? - if ($_CONFIG['wernis_payout_active'] == "Y") { + if (getConfig('wernis_payout_active') == "Y") { // Add link $content['payout_link'] = "
".MEMBER_WERNIS_MODE_PAYOUT."
"; } // END - if // Is the withdraw mode active? - if ($_CONFIG['wernis_withdraw_active'] == "Y") { + if (getConfig('wernis_withdraw_active') == "Y") { // Add link $content['withdraw_link'] = "
".MEMBER_WERNIS_MODE_WITHDRAW."
"; } // END - if @@ -124,20 +124,20 @@ if ((!isset($_GET['mode'])) || ($_GET['mode'] == "choose")) { // Mode chooser! ;-) $_GET['mode'] = "choose"; } -} elseif (($_GET['mode'] == "payout") && ($_CONFIG['wernis_payout_active'] == "Y")) { +} elseif (($_GET['mode'] == "payout") && (getConfig('wernis_payout_active') == "Y")) { // Get total points and check if the user can request a payout $points = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points") - GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points"); // Remove the registration fee - $points = $points - $_CONFIG['points_register']; + $points = $points - getConfig('points_register'); // Is there a percentage or fixed fee? $points = WERNIS_TAKE_FEE($points, "payout"); // Is this enougth for a payout? - if ($points < $_CONFIG['wernis_min_payout']) { + if ($points < getConfig('wernis_min_payout')) { // No, then abort here - LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_MIN_PAYOUT, TRANSLATE_COMMA($_CONFIG['wernis_min_payout']))); + LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_MIN_PAYOUT, TRANSLATE_COMMA(getConfig('wernis_min_payout')))); return; } // END - if @@ -147,7 +147,7 @@ if ((!isset($_GET['mode'])) || ($_GET['mode'] == "choose")) { // Add points to content array $content['points'] = TRANSLATE_COMMA($points); - $content['min_points'] = TRANSLATE_COMMA($_CONFIG['wernis_min_payout']); + $content['min_points'] = TRANSLATE_COMMA(getConfig('wernis_min_payout')); // Add fees to array WERNIS_ADD_FEES_TO_ARRAY($content); @@ -165,13 +165,13 @@ if ((!isset($_GET['mode'])) || ($_GET['mode'] == "choose")) { // Free result SQL_FREERESULT($result); -} elseif (($_GET['mode'] == "withdraw") && ($_CONFIG['wernis_withdraw_active'] == "Y")) { +} elseif (($_GET['mode'] == "withdraw") && (getConfig('wernis_withdraw_active') == "Y")) { // Get total points for just displaying them $points = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points") - GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points"); // Prepare data for the template $content['points'] = TRANSLATE_COMMA($points); - $content['min_points'] = TRANSLATE_COMMA($_CONFIG['wernis_min_withdraw']); + $content['min_points'] = TRANSLATE_COMMA(getConfig('wernis_min_withdraw')); $content['wds66_id'] = ""; // Add fees to array @@ -222,9 +222,9 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) { // Check input data depending on the mode and execute the requested mode switch ($_GET['mode']) { case "withdraw": // Widthdraws WDS66 -> This exchange - if ($_POST['amount'] < $_CONFIG['wernis_min_withdraw']) { + if ($_POST['amount'] < getConfig('wernis_min_withdraw')) { // Not enougth entered! - LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_AMOUNT_SMALLER_MIN, bigintval($_CONFIG['wernis_min_withdraw']))); + LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_AMOUNT_SMALLER_MIN, bigintval(getConfig('wernis_min_withdraw')))); OUTPUT_HTML("
"); } else { // All is fine here so do the withdraw @@ -254,9 +254,9 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) { break; case "payout": // Payout this exchange -> WDS66 - if ($_POST['amount'] < $_CONFIG['wernis_min_payout']) { + if ($_POST['amount'] < getConfig('wernis_min_payout')) { // Not enougth entered! - LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_AMOUNT_SMALLER_MIN, bigintval($_CONFIG['wernis_min_payout']))); + LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_AMOUNT_SMALLER_MIN, bigintval(getConfig('wernis_min_payout')))); OUTPUT_HTML("
"); } elseif ($_POST['amount'] > $points) { // Not enougth points left! diff --git a/inc/modules/order.php b/inc/modules/order.php index 3b98a3e872..0b3a5a4f7d 100644 --- a/inc/modules/order.php +++ b/inc/modules/order.php @@ -50,7 +50,7 @@ if (!defined('__SECURITY')) { // When URL is empty nothing bad happend here if (empty($URL)) { // Is the auto-send mechanism active or inactive? - if ($_CONFIG['autosend_active'] == "Y") { + if (getConfig('autosend_active') == "Y") { // Auto-send is active define('ADMIN_AUTOSEND', COMPILE_CODE(ADMIN_AUTOSEND_ACTIVE)); define('MEMBER_AUTOSEND', COMPILE_CODE(MEMBER_AUTOSEND_ACTIVE)); @@ -86,12 +86,12 @@ if (empty($URL)) { // Update used points $ADD = ""; - if ($_CONFIG['order_max_full'] == "ORDER") $ADD = ", mail_orders=mail_orders+1"; + if (getConfig('order_max_full') == "ORDER") $ADD = ", mail_orders=mail_orders+1"; SUB_POINTS("order", $GLOBALS['userid'], $USED); // Prepare content $content = array( - 'blocks' => $_CONFIG['max_send'], + 'blocks' => getConfig('max_send'), 'subject' => $DATA[0], 'text' => $DATA[1], 'payment' => GET_PAYMENT($DATA[3]), diff --git a/inc/modules/sponsor/account.php b/inc/modules/sponsor/account.php index 5ef7faa807..c402de5dbd 100644 --- a/inc/modules/sponsor/account.php +++ b/inc/modules/sponsor/account.php @@ -73,9 +73,9 @@ if (SQL_NUMROWS($result) == 1) { } elseif ((!empty($_POST['pass1'])) && (empty($_POST['pass2']))) { // No password two entered $MSG = SPONSOR_PASSWORD_TWO_EMPTY; - } elseif ((!empty($_POST['pass1'])) && (strlen($_POST['pass1']) < $_CONFIG['pass_len'])) { + } elseif ((!empty($_POST['pass1'])) && (strlen($_POST['pass1']) < getConfig('pass_len'))) { // Too short password - $MSG = SPONSOR_PASSWORD_TOO_SHORT_1.$_CONFIG['pass_len'].SPONSOR_PASSWORD_TOO_SHORT_2; + $MSG = SPONSOR_PASSWORD_TOO_SHORT_1.getConfig('pass_len').SPONSOR_PASSWORD_TOO_SHORT_2; } else { // Default is we don't want to change password! $PASS_AND = ""; $PASS_DATA = ""; diff --git a/inc/monthly/monthly_beg.php b/inc/monthly/monthly_beg.php index ecc3c3ed92..237c5917b6 100644 --- a/inc/monthly/monthly_beg.php +++ b/inc/monthly/monthly_beg.php @@ -40,25 +40,30 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($CSS == 1) || (!defined('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "N")) return; +if (($CSS == 1) || (!defined('__DAILY_RESET')) || (getConfig('beg_rallye') == "N")) return; //* DEBUG: */ echo basename(__FILE__)."
\n"; // Get current month (2 digits) $curr = date("m", time()); // Check if month is done -if (($curr != $_CONFIG['last_month']) && ($_CONFIG['last_month'] > 0) && ($_CONFIG['beg_ranks'] > 0) && ($CSS != 1)) { +if (($curr != getConfig('last_month')) && (getConfig('last_month') > 0) && (getConfig('beg_ranks') > 0) && ($CSS != 1)) { // Extension "autopurge" is inactive or purging of inactive accounts is deactivated $whereStatement1 = ""; - $whereStatement2 = bigintval($_CONFIG['beg_ranks']); + $whereStatement2 = bigintval(getConfig('beg_ranks')); + + // Shall we exclude webmaster's own userid? + if ((getConfig('beg_include_own') == "N") && (getConfig('beg_uid') > 0)) { + // Exclude it + $whereStatement1 = sprintf(" AND userid != %s", bigintval(getConfig('beg_uid'))); + } // END - if // Let's check if there are some points left we can "pay"... if (EXT_IS_ACTIVE("autopurge")) { // Use last online stamp only when autopurge for inactive members is activated - if (($_CONFIG['ap_inactive_since'] > 0) && ($_CONFIG['beg_active'] == "Y")) { + if ((getConfig('ap_inactive_since') > 0) && (getConfig('beg_active') == "Y")) { // Okay, include last online timestamp - $whereStatement1 = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", bigintval($_CONFIG['ap_inactive_since']));; - $whereStatement2 = bigintval($_CONFIG['beg_ranks']); + $whereStatement1 .= sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", bigintval(getConfig('ap_inactive_since')));; } // END - if } // END - if diff --git a/inc/monthly/monthly_bonus.php b/inc/monthly/monthly_bonus.php index 1ac1f05ea0..c3440470b3 100644 --- a/inc/monthly/monthly_bonus.php +++ b/inc/monthly/monthly_bonus.php @@ -46,28 +46,28 @@ if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; // Get current month (2 digits) $curr = date("m", time()); -if (($curr != $_CONFIG['last_month']) && ($_CONFIG['bonus_ranks'] > 0) && ($CSS != 1)) { +if (($curr != getConfig('last_month')) && (getConfig('bonus_ranks') > 0) && ($CSS != 1)) { // Extension "autopurge" is inactive or purging of inactive accounts is deactivated $whereStatement1 = "WHERE status='CONFIRMED'"; - $whereStatement2 = bigintval($_CONFIG['bonus_ranks']); + $whereStatement2 = bigintval(getConfig('bonus_ranks')); // Shall I keep inactive members away from here? (mostly wanted in an "active-rallye" ...) if (EXT_IS_ACTIVE("autopurge")) { // Use last online stamp only when autopurge for inactive members is activated - if ($_CONFIG['ap_inactive_since'] > 0) { + if (getConfig('ap_inactive_since') > 0) { // Okay, include last online timestamp - $whereStatement1 = sprintf("WHERE status='CONFIRMED' AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']); - $whereStatement2 = bigintval($_CONFIG['bonus_ranks']); + $whereStatement1 = sprintf("WHERE status='CONFIRMED' AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since')); + $whereStatement2 = bigintval(getConfig('bonus_ranks')); } // END - if } // END - if // Add more bonus points here $ADD = ""; - if ($_CONFIG['bonus_click_yn'] == "Y") $ADD .= " + turbo_bonus"; - if ($_CONFIG['bonus_login_yn'] == "Y") $ADD .= " + login_bonus"; - if ($_CONFIG['bonus_order_yn'] == "Y") $ADD .= " + bonus_order"; - if ($_CONFIG['bonus_stats_yn'] == "Y") $ADD .= " + bonus_stats"; - if ($_CONFIG['bonus_ref_yn'] == "Y") $ADD .= " + bonus_ref"; + if (getConfig('bonus_click_yn') == "Y") $ADD .= " + turbo_bonus"; + if (getConfig('bonus_login_yn') == "Y") $ADD .= " + login_bonus"; + if (getConfig('bonus_order_yn') == "Y") $ADD .= " + bonus_order"; + if (getConfig('bonus_stats_yn') == "Y") $ADD .= " + bonus_stats"; + if (getConfig('bonus_ref_yn') == "Y") $ADD .= " + bonus_ref"; // Shall we add some entries? if (!empty($ADD)) { diff --git a/inc/monthly/monthly_newsletter.php b/inc/monthly/monthly_newsletter.php index 1dcbdc51ba..85107a4af8 100644 --- a/inc/monthly/monthly_newsletter.php +++ b/inc/monthly/monthly_newsletter.php @@ -46,7 +46,7 @@ if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; // Get current month (2 digits) $curr = date("m", time()); -if ($_CONFIG['last_month'] != $curr) +if (getConfig('last_month') != $curr) { // Check for unsubscribed members $result = SQL_QUERY("SELECT userid, nl_until FROM `"._MYSQL_PREFIX."_user_data` WHERE nl_receive='N' ORDER BY userid", __FILE__, __LINE__); diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index 6db6dd52f2..fe540b053b 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -103,11 +103,18 @@ if ((empty($MySQL['login'])) && (!defined('mxchange_installing')) && (!isset($_G // Please run the installation script (maybe again) die(DIE_RUN_INSTALL_MYSQL); } -} elseif ((!defined('mxchange_installing')) && (!isset($_GET['installing'])) && (empty($MySQL['password'])) && (isBooleanConstantAndTrue('warn_no_pass'))) { +} elseif ((!isBooleanConstantAndTrue('mxchange_installing')) && (!isset($_GET['installing'])) && (empty($MySQL['password'])) && (isBooleanConstantAndTrue('warn_no_pass'))) { // No database password entered!!! echo "".LANG_WARNING.": ".WARN_NULL_PASSWORD; } +// Set dummy $_CONFIG array +$_CONFIG = array( + 'code_length' => 0, + 'patch_level' => 0, + 'last_update' => time() +); + // Check if this file is writeable or read-only and warn the user if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed'))) { // Check for write-permission for config.php and inc directory @@ -129,12 +136,14 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT // Is it a valid resource? if ($db === true) { - // Remove MySQL array from namespace + // This is required for extension 'optimize' to work define('__DB_NAME', $MySQL['dbase']); + + // Remove MySQL array from namespace unset($MySQL); // Load configuration stuff - $_CONFIG = LOAD_CONFIG(); + $_CONFIG = merge_array($_CONFIG, LOAD_CONFIG()); // Initialize include-file-pool $INC_POOL = array(); @@ -191,7 +200,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT } elseif (($GLOBALS['module'] == "index") || ($GLOBALS['module'] == "login")) { // Set 'what' value to 'welcome' in guest and member menu $GLOBALS['what'] = "welcome"; - if (!empty($_CONFIG['index_home'])) $GLOBALS['what'] = $_CONFIG['index_home']; + if (getConfig('index_home') != "") $GLOBALS['what'] = getConfig('index_home'); } else { // Anything else like begging link $GLOBALS['what'] = ""; @@ -208,7 +217,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT unset($dummy); // Shall we activate the exchange? - if ($_CONFIG['activate_xchange'] > 0) activateExchange(); + if (getConfig('activate_xchange') > 0) activateExchange(); // Is the extension sql_patches installed and at least 0.3.6? if (GET_EXT_VERSION("sql_patches") >= "0.3.6") { @@ -249,11 +258,6 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT // Include neccessary functions for installation // /////////////////////////////////////////////////// - // Set CONFIG array - $_CONFIG = array( - 'code_length' => 0 - ); - // Set other missing variables $link = false; // No database link by default diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 691aa63047..6abad5048f 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -50,7 +50,7 @@ function ADD_MODULE_TITLE($mod) { $name = $cacheArray['modules']['title'][$mod]; // Update cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database $result = SQL_QUERY_ESC("SELECT title FROM "._MYSQL_PREFIX."_mod_reg WHERE module='%s' LIMIT 1", array($mod), __FILE__, __LINE__); @@ -115,7 +115,7 @@ function CHECK_MODULE ($mod) { $mem = $cacheArray['modules']['mem_only'][$mod_chk]; // Update cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } $found = true; } else { // No, then we have to update it! @@ -278,7 +278,7 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { if ($return) { // Return title return $ret; - } elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && ($_CONFIG['youre_here'] == "Y")) || ((IS_ADMIN()) && ($modCheck == "admin"))) { + } elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && (getConfig('youre_here') == "Y")) || ((IS_ADMIN()) && ($modCheck == "admin"))) { // Output HTML code $OUT = $prefix."".$ret."\n"; @@ -290,7 +290,7 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { $OUT .= "
\n"; // Extension removeip activated? - if ((EXT_IS_ACTIVE("removeip")) && (isset($_CONFIG['removeip_'.strtolower($ACC_LVL).'_show'])) && ($_CONFIG['removeip_'.strtolower($ACC_LVL).'_show'] == "Y")) { + if ((EXT_IS_ACTIVE("removeip")) && (getConfig('removeip_'.strtolower($ACC_LVL).'_show') == "Y")) { // Add anoymity/privacy infos $OUT .= REMOVEIP_ADD_INFOS(); } // END - if @@ -301,7 +301,7 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { // Handle failed logins here if not in guest //* DEBUG: */ print __FUNCTION__."(".__LINE__."):type={$type},action={$GLOBALS['action']},what={$GLOBALS['what']},lvl={$ACC_LVL}
\n"; - if ((($type == "what") || ($type == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview") || ($GLOBALS['what'] == $_CONFIG['index_home']))) && ($ACC_LVL != "guest") && ((GET_EXT_VERSION("sql_patches") >= "0.4.7") || (GET_EXT_VERSION("admins") >= "0.7.0"))) { + if ((($type == "what") || ($type == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview") || ($GLOBALS['what'] == getConfig('index_home')))) && ($ACC_LVL != "guest") && ((GET_EXT_VERSION("sql_patches") >= "0.4.7") || (GET_EXT_VERSION("admins") >= "0.7.0"))) { // Handle failture $OUT .= HANDLE_LOGIN_FAILTURES($ACC_LVL); } // END - if @@ -384,7 +384,7 @@ function ADD_MENU($MODE, $act, $wht) { } // Menu title - $content .= $_CONFIG['menu_blur_spacer'].$sub_title; + $content .= getConfig('menu_blur_spacer') . $sub_title; if ($test) { $content .= ""; @@ -459,7 +459,7 @@ function IS_ADMIN($admin="") $valPass = $cacheArray['admin_hash']; } elseif ((!empty($passCookie)) && (isset($cacheArray['admins']['password'][$admin])) && (!empty($admin))) { // Count cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } // Login data is valid or not? $valPass = generatePassString($cacheArray['admins']['password'][$admin]); @@ -700,7 +700,7 @@ function UPDATE_LOGIN_DATA () { if (empty($GLOBALS['what'])) { // Fix it to default $GLOBALS['what'] = "welcome"; - if (!empty($_CONFIG['index_home'])) $GLOBALS['what'] = $_CONFIG['index_home']; + if (getConfig('index_home') != "") $GLOBALS['what'] = getConfig('index_home'); } // END - if // Update last module / online time @@ -767,7 +767,7 @@ function GET_MOD_DESCR($MODE, $wht, $column="what") // Fix empty "what" if (empty($wht)) { $wht = "welcome"; - if (!empty($_CONFIG['index_home'])) $wht = $_CONFIG['index_home']; + if (getConfig('index_home') != "") $wht = getConfig('index_home'); } // END - if // Default is not found @@ -853,7 +853,7 @@ function SEND_MODE_MAILS($mod, $modes) // Load template $msg = LOAD_EMAIL_TEMPLATE("member_mydata_notify", $content, $GLOBALS['userid']); - if ($_CONFIG['admin_notify'] == "Y") { + if (getConfig('admin_notify') == "Y") { // The admin needs to be notified about a profile change $msg_admin = "admin_mydata_notify"; $sub_adm = ADMIN_CHANGED_DATA; @@ -899,7 +899,7 @@ function SEND_MODE_MAILS($mod, $modes) if ((!empty($sub_adm)) && (!empty($msg_admin))) { // Send admin mail SEND_ADMIN_NOTIFICATION($sub_adm, $msg_admin, $content, $GLOBALS['userid']); - } elseif ($_CONFIG['admin_notify'] == "Y") { + } elseif (getConfig('admin_notify') == "Y") { // Cannot send mails to admin! $content = CANNOT_SEND_ADMIN_MAILS; } else { @@ -929,7 +929,7 @@ function GET_ACTION ($MODE, &$wht) //* DEBUG: */ echo __LINE__."=".$MODE."/".$wht."/".$GLOBALS['action']."=
"; if ((empty($wht)) && ($MODE != "admin")) { $wht = "welcome"; - if (!empty($_CONFIG['index_home'])) $wht = $_CONFIG['index_home']; + if (getConfig('index_home') != "") $wht = getConfig('index_home'); } // END - if if ($MODE == "admin") { @@ -1129,7 +1129,7 @@ function GET_REF_LEVEL_PERCENTS ($level) { $per = $cacheArray['ref_depths']['percents'][$key]; // Count cache hit - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } } elseif (!EXT_IS_ACTIVE("cache")) { // Get referal data @@ -1407,7 +1407,7 @@ WHERE sid='%s' LIMIT 1", // Purge old entries $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_online WHERE timestamp <= (UNIX_TIMESTAMP() - %s)", - array($_CONFIG['online_timeout']), __FILE__, __LINE__); + array(getConfig('online_timeout')), __FILE__, __LINE__); } // OBSOLETE: Sends out mail to all administrators function SEND_ADMIN_EMAILS ($subj, $msg) { @@ -1432,7 +1432,7 @@ function GET_ADMIN_ID ($login) { $ret = $cacheArray['admins']['aid'][$login]; // Update cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admins WHERE login='%s' LIMIT 1", @@ -1469,7 +1469,7 @@ function GET_ADMIN_HASH ($aid) $ret = $cacheArray['admins']['password'][$aid]; // Update cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database $result = SQL_QUERY_ESC("SELECT password FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1", @@ -1496,7 +1496,7 @@ function GET_ADMIN_LOGIN ($aid) { $ret = $cacheArray['admins']['login'][$aid]; // Update cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database $result = SQL_QUERY_ESC("SELECT login FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1", @@ -1524,7 +1524,7 @@ function GET_ADMIN_EMAIL ($aid) { $ret = $cacheArray['admins']['email'][$aid]; // Update cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database $result_aid = SQL_QUERY_ESC("SELECT email FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1", @@ -1554,7 +1554,7 @@ function GET_ADMIN_DEFAULT_ACL ($aid) { $ret = $cacheArray['admins']['def_acl'][$aid]; // Update cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database $result_aid = SQL_QUERY_ESC("SELECT default_acl FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1", @@ -1620,7 +1620,7 @@ function ADD_OPTION_LINES($table, $id, $name, $default="",$special="",$where="") function activateExchange() { global $_CONFIG; $result = SQL_QUERY("SELECT userid FROM `"._MYSQL_PREFIX."_user_data` WHERE status='CONFIRMED' AND max_mails > 0", __FILE__, __LINE__); - if (SQL_NUMROWS($result) >= $_CONFIG['activate_xchange']) + if (SQL_NUMROWS($result) >= getConfig('activate_xchange')) { // Free memory SQL_FREERESULT($result); @@ -1691,7 +1691,7 @@ function META_DESCRIPTION ($mod, $wht) { // Exclude admin and member's area if (($mod != "admin") && ($mod != "login")) { // Construct dynamic description - $DESCR = MAIN_TITLE." ".trim($_CONFIG['title_middle'])." ".ADD_DESCR("guest", "what-".$wht, true); + $DESCR = MAIN_TITLE." ".trim(getConfig('title_middle'))." ".ADD_DESCR("guest", "what-".$wht, true); // Output it directly OUTPUT_HTML(""); @@ -1793,7 +1793,7 @@ function GET_WHAT($modCheck) { case "login": case "index": $wht = "welcome"; - if (($modCheck == "index") && (!empty($_CONFIG['index_home']))) $wht = $_CONFIG['index_home']; + if (($modCheck == "index") && (getConfig('index_home') != "")) $wht = getConfig('index_home'); break; default: @@ -1817,11 +1817,11 @@ function MODULE_HAS_MENU ($mod, $forceDb = false) { if (isset($cacheArray['modules']['has_menu'][$mod])) { // Check module cache and count hit $ret = ($cacheArray['modules']['has_menu'][$mod] == "Y"); - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif (isset($cacheArray['extensions']['ext_menu'][$mod])) { // Check cache and count hit $ret = ($cacheArray['extensions']['ext_menu'][$mod] == "Y"); - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } elseif ((IS_ADMIN()) && ($mod == "admin")) { // Admin module has always a menu! $ret = true; @@ -2124,11 +2124,11 @@ function GENERATE_RECEIVER_LIST ($cat, $receiver, $mode="") { if ((EXT_IS_ACTIVE("html_mail")) && ($mode == "html")) { // Only include HTML receivers $result = SQL_QUERY_ESC("SELECT d.userid FROM `"._MYSQL_PREFIX."_user_data` AS d ".$CAT_TABS." WHERE d.status='CONFIRMED' AND d.html='Y'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s", - array($cat, $_CONFIG['order_select'], $_CONFIG['order_mode'], $receiver), __FILE__, __LINE__); + array($cat, getConfig('order_select'), getConfig('order_mode'), $receiver), __FILE__, __LINE__); } else { // Include all $result = SQL_QUERY_ESC("SELECT d.userid FROM `"._MYSQL_PREFIX."_user_data` AS d ".$CAT_TABS." WHERE d.status='CONFIRMED'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s", - array($cat, $_CONFIG['order_select'], $_CONFIG['order_mode'], $receiver), __FILE__, __LINE__); + array($cat, getConfig('order_select'), getConfig('order_mode'), $receiver), __FILE__, __LINE__); } // Entries found? @@ -2253,7 +2253,7 @@ ORDER BY ur.refid ASC", $row['activity'] = MEMBER_ACTIVITY_ACTIVE; // Is autopurge installed and the user inactive? - if ((EXT_IS_ACTIVE("autopurge")) && ((time() - $_CONFIG['ap_inactive_since']) >= $row['last_online'])) { + if ((EXT_IS_ACTIVE("autopurge")) && ((time() - getConfig('ap_inactive_since')) >= $row['last_online'])) { // Inactive user! $row['activity'] = MEMBER_ACTIVITY_INACTIVE; } // END - if diff --git a/inc/patch-system.php b/inc/patch-system.php index 37de071255..e9be455191 100644 --- a/inc/patch-system.php +++ b/inc/patch-system.php @@ -38,7 +38,7 @@ if (!defined('__SECURITY')) { } // Check for patch level differences between databases and current hard-coded -if ((CURR_SVN_REVISION > $_CONFIG['patch_level']) || ($_CONFIG['patch_level'] == "CURR_SVN_REVISION") || ($_CONFIG['patch_ctime'] == "UNIX_TIMES")) { +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; diff --git a/inc/pool/pool-bonus.php b/inc/pool/pool-bonus.php index 264b70857d..19e15b1531 100644 --- a/inc/pool/pool-bonus.php +++ b/inc/pool/pool-bonus.php @@ -47,7 +47,7 @@ if (defined('__DAILY_RESET')) { } // Only send bonus mail when bonus extension is active and maximum send-mails is not reached -if ($cnt < $_CONFIG['max_send']) { +if ($cnt < getConfig('max_send')) { // Do we need to send out bonus mails? if (EXT_IS_ACTIVE("html_mail")) { // 0 1 2 3 4 5 6 7 8 9 10 11 @@ -134,7 +134,7 @@ if ($cnt < $_CONFIG['max_send']) { } // END - if // Do we have send maximum mails? - if (($cnt >= $_CONFIG['max_send']) || (SELECTION_COUNT($dummy) == 0)) { + if (($cnt >= getConfig('max_send')) || (SELECTION_COUNT($dummy) == 0)) { // Yes, we have //* DEBUG: */ echo "*EXIT/L:".__LINE__."
"; break; @@ -169,7 +169,7 @@ if ($cnt < $_CONFIG['max_send']) { //* DEBUG: */ echo "*MEDIA/L:".__LINE__."*
"; MEDIA_UPDATE_ENTRY(array("total_orders", "bonus_orders"), "add", 1); } // END - if - } elseif ($cnt >= $_CONFIG['max_send']) { + } elseif ($cnt >= getConfig('max_send')) { // Update bonus pool $result_done = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_bonus SET data_type='NEW', target_send=%s, receivers='%s' WHERE id=%s LIMIT 1", array(SELECTION_COUNT($dummy), implode(";", $dummy), bigintval($DATA['id'])), __FILE__, __LINE__); diff --git a/inc/pool/pool-user.php b/inc/pool/pool-user.php index f3328a1160..5b79d256db 100644 --- a/inc/pool/pool-user.php +++ b/inc/pool/pool-user.php @@ -185,8 +185,8 @@ if (SQL_NUMROWS($result_main) > 0) { } } - // Do we have reached the maximum to send mails? || ($_CONFIG['max_send'] >= $cnt) - //* DEBUG: */ echo "*L:".__LINE__."/".$cnt.">=".$DATA[8]."/".$_CONFIG['max_send'].">=".$cnt."/".$LAST_SENT_ID."!=".$DATA[0]."*
"; + // Do we have reached the maximum to send mails? || (getConfig('max_send') >= $cnt) + //* DEBUG: */ echo "*L:".__LINE__."/".$cnt.">=".$DATA[8]."/".getConfig('max_send').">=".$cnt."/".$LAST_SENT_ID."!=".$DATA[0]."*
"; if ((($cnt >= $DATA[8])) && ($LAST_SENT_ID != $DATA[0])) { // Prepare content $content = array( @@ -241,7 +241,7 @@ if (SQL_NUMROWS($result_main) > 0) { break; } // Do we have send maximum mails? - elseif (($cnt >= $_CONFIG['max_send']) || ($cnt2 >= $_CONFIG['max_send'])) { + elseif (($cnt >= getConfig('max_send')) || ($cnt2 >= getConfig('max_send'))) { // There are some mails left to send for next round, so we reset the status back to NEW (=still not fully delivered) $ADD = ""; if ($cnt <= $DATA[8]) $ADD = ", target_send=target_send-".$cnt; diff --git a/inc/profile-updte.php b/inc/profile-updte.php index b2aa58ab28..417ad61d30 100644 --- a/inc/profile-updte.php +++ b/inc/profile-updte.php @@ -38,7 +38,7 @@ if (!defined('__SECURITY')) { require($INC); } -if (($_CONFIG['send_prof_update'] == "Y") && ($_CONFIG['profile_update'] > 0) && ($_CONFIG['resend_profile_update'])) { +if ((getConfig('send_prof_update') == "Y") && (getConfig('profile_update') > 0) && (getConfig('resend_profile_update'))) { // Load personal data 0 1 2 3 4 5 6 $result = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, last_update, joined FROM @@ -47,7 +47,7 @@ WHERE (last_update < (UNIX_TIMESTAMP() - %s) AND last_update != 0 AND last_profile_sent < (UNIX_TIMESTAMP() - %s)) OR (last_update=0 AND last_profile_sent=0 AND joined < (UNIX_TIMESTAMP() - %s)) -ORDER BY userid", array($_CONFIG['profile_update'], $_CONFIG['resend_profile_update'], $_CONFIG['profile_update']), __FILE__, __LINE__); +ORDER BY userid", array(getConfig('profile_update'), getConfig('resend_profile_update'), getConfig('profile_update')), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // We need to send-out notifications... diff --git a/inc/reset/reset_beg.php b/inc/reset/reset_beg.php index 51b5b80d70..3fdf322e81 100644 --- a/inc/reset/reset_beg.php +++ b/inc/reset/reset_beg.php @@ -40,7 +40,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($CSS == 1) || (!defined('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "Y")) return; +if (($CSS == 1) || (!defined('__DAILY_RESET')) || (getConfig('beg_rallye') == "Y")) return; //* DEBUG: */ echo basename(__FILE__)."
\n"; // Reset accounts diff --git a/inc/reset/reset_holiday.php b/inc/reset/reset_holiday.php index 6c82e94e93..3048ee5242 100644 --- a/inc/reset/reset_holiday.php +++ b/inc/reset/reset_holiday.php @@ -40,7 +40,7 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($CSS == 1) || ((!defined('__DAILY_RESET')) && ($_CONFIG['holiday_mode'] == "RESET"))) return; +if (($CSS == 1) || ((!defined('__DAILY_RESET')) && (getConfig('holiday_mode') == "RESET"))) return; //* DEBUG: */ echo basename(__FILE__)."
\n"; // Check for holidays we need to enable and send email to user diff --git a/inc/reset/reset_surfbar.php b/inc/reset/reset_surfbar.php index 2d216c6dac..98d5c5600a 100644 --- a/inc/reset/reset_surfbar.php +++ b/inc/reset/reset_surfbar.php @@ -44,8 +44,8 @@ if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; //* DEBUG: */ echo basename(__FILE__)."
\n"; // Reset surfbar counter -UPDATE_CONFIG(array("surfbar_daily_counter", "surfbar_yester_counter"), array(0, $_CONFIG['surfbar_daily_counter'])); -$_CONFIG['surfbar_yester_counter'] = $_CONFIG['surfbar_daily_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; // diff --git a/inc/reset/reset_yoomedia.php b/inc/reset/reset_yoomedia.php index 0d6e41266e..62afb53318 100644 --- a/inc/reset/reset_yoomedia.php +++ b/inc/reset/reset_yoomedia.php @@ -43,7 +43,7 @@ if (!defined('__SECURITY')) { if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; // Simply reset the requests here -UPDATE_CONFIG("yoomedia_requests_remain", $_CONFIG['yoomedia_requests_total']); +UPDATE_CONFIG("yoomedia_requests_remain", getConfig('yoomedia_requests_total')); // ?> diff --git a/inc/session.php b/inc/session.php index 46dd7e3913..89f370509a 100644 --- a/inc/session.php +++ b/inc/session.php @@ -46,9 +46,9 @@ if (empty($VIEW)) $VIEW = 0; if (($VIEW == 1) && ($_SERVER['PHP_SELF'])) return; // Set session save path if set -if (!empty($_CONFIG['session_save_path'])) { +if (getConfig('session_save_path') != "") { // Please make sure this valid! - @session_save_path($_CONFIG['session_save_path']); + @session_save_path(getConfig('session_save_path')); } // END - if // Start the session diff --git a/inc/stats_bonus.php b/inc/stats_bonus.php index 90956ac9cd..77ad76ae39 100644 --- a/inc/stats_bonus.php +++ b/inc/stats_bonus.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (!defined('__SECURITY')) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -41,18 +40,18 @@ if (!defined('__SECURITY')) // Check for 100% klickrate mails $result_bonus = SQL_QUERY("SELECT id, userid, subject, timestamp_ordered, clicks, url FROM "._MYSQL_PREFIX."_user_stats -WHERE max_rec=clicks AND clicks>0 AND bonus_stats='N' +WHERE max_rec=clicks AND clicks>0 AND bonus_stats_active='N' ORDER BY userid", __FILE__, __LINE__); if (SQL_NUMROWS($result_bonus) > 0) { // Remember stats bonus in constant - define('__STATS_BONUS', TRANSLATE_COMMA($_CONFIG['bonus_stats'])); + define('__STATS_BONUS', TRANSLATE_COMMA(getConfig('bonus_stats'))); // We found some mail orders... while(list($id, $uid, $subj, $stamp, $clicks, $url) = SQL_FETCHROW($result_bonus)) { // Add points $result_points = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET bonus_stats=bonus_stats+%s WHERE userid=%s LIMIT 1", - array($_CONFIG['bonus_stats'], bigintval($uid)), __FILE__, __LINE__); + array(getConfig('bonus_stats'), bigintval($uid)), __FILE__, __LINE__); // Prepare array $content = array( @@ -67,12 +66,12 @@ if (SQL_NUMROWS($result_bonus) > 0) { SEND_EMAIL($uid, BONUS_MEMBER_STATS_SUBJECT, $msg); // Update database - $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_stats SET bonus_stats='Y' WHERE id=%s LIMIT 1", - array(bigintval($id)), __FILE__, __LINE__); + $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_stats SET bonus_stats_active='Y' WHERE id=%s LIMIT 1", + array(bigintval($id)), __FILE__, __LINE__); } // Handle bonus points - BONUS_POINTS_HANDLER($_CONFIG['bonus_stats']); + BONUS_POINTS_HANDLER(getConfig('bonus_stats')); } // Free memory diff --git a/inc/stylesheet.php b/inc/stylesheet.php index a8e5748a83..7b83cda953 100644 --- a/inc/stylesheet.php +++ b/inc/stylesheet.php @@ -46,10 +46,10 @@ $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 (empty($_CONFIG['css_php'])) $_CONFIG['css_php'] = "FILE"; +if (getConfig('css_php') == "") $_CONFIG['css_php'] = "FILE"; // Output CSS files or content or link to css.php ? -if (($CSS == "1") || ($_CONFIG['css_php'] == "DIRECT")) { +if (($CSS == "1") || (getConfig('css_php') == "DIRECT")) { // Load CSS files if (is_array($EXT_CSS_FILES)) { // Load extension's CSS files @@ -64,7 +64,7 @@ if (($CSS == "1") || ($_CONFIG['css_php'] == "DIRECT")) { // Do include only existing files and whose are not empty if ((FILE_READABLE($file)) && (filesize($file) > 0)) { - switch ($_CONFIG['css_php']) { + switch (getConfig('css_php')) { case "DIRECT": OUTPUT_HTML(""); break; diff --git a/index.php b/index.php index e0d16d7266..9b98c0f1d3 100644 --- a/index.php +++ b/index.php @@ -51,13 +51,13 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { require(PATH."inc/header.php"); // Fix missing array elements here - if (!isset($_CONFIG['index_delay'])) $_CONFIG['index_delay'] = 0; - if (!isset($_CONFIG['index_cookie'])) $_CONFIG['index_cookie'] = 0; + if (getConfig('index_delay') == null) $_CONFIG['index_delay'] = 0; + if (getConfig('index_cookie') == null) $_CONFIG['index_cookie'] = 0; // Check for cookies - if ((isSessionVariableSet('visited')) || ($_CONFIG['index_delay'] == 0) || ($_CONFIG['index_cookie'] == 0)) { + if ((isSessionVariableSet('visited')) || (getConfig('index_delay') == 0) || (getConfig('index_cookie') == 0)) { // Is the index page configured for redirect pr not? - if ($_CONFIG['index_cookie'] > 0) { + if (getConfig('index_cookie') > 0) { // Set cookie and remeber it for specified time set_session("visited", "true"); } elseif (isSessionVariableSet('visited')) { @@ -69,9 +69,9 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { LOAD_TEMPLATE("index", false, ADD_URL_DATA("")); // Shall I insert an automated forward? - if ($_CONFIG['index_delay'] > 0) { + if (getConfig('index_delay') > 0) { // This will be a JavaScript-redirect! - define('__DELAY_VALUE', ($_CONFIG['index_delay'] * 1000 + 500)); + define('__DELAY_VALUE', (getConfig('index_delay') * 1000 + 500)); define('__MOD_VALUE' , ADD_URL_DATA("index")); LOAD_TEMPLATE("index_forward"); } diff --git a/mailid.php b/mailid.php index b1baa9f2f0..523d319c19 100644 --- a/mailid.php +++ b/mailid.php @@ -202,17 +202,17 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // Error code is set? if (!empty($msg)) { - switch ($_CONFIG['mailid_error_redirect']) { + switch (getConfig('mailid_error_redirect')) { case "INDEX": // Redirect to index page LOAD_URL("modules.php?module=index&msg=".$msg."&ext=mailid"); break; case "REJECT": // Redirect to rejection page - LOAD_URL($_CONFIG['reject_url']); + LOAD_URL(getConfig('reject_url')); break; default: - DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected in mailid_error_redirect.", $_CONFIG['mailid_error_redirect'])); + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected in mailid_error_redirect.", getConfig('mailid_error_redirect'))); LOAD_URL("modules.php?module=index&msg=".CODE_UNKNOWN_STATUS."&ext=mailid"); break; } diff --git a/mailid_top.php b/mailid_top.php index 8316455d88..344bed250c 100644 --- a/mailid_top.php +++ b/mailid_top.php @@ -161,7 +161,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { if (($time > 0) && ($payment > 0)) { if (!empty($code)) { // Generate code - $img_code = GEN_RANDOM_CODE($_CONFIG['code_length'], $code, $url_uid, $DATA); + $img_code = GEN_RANDOM_CODE(getConfig('code_length'), $code, $url_uid, $DATA); } // END - if switch ($mode) { @@ -225,7 +225,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { $template = "mailid_points_done"; // Right code entered add points and remove entry - if (($ref_pay > 0) && ($_CONFIG['allow_direct_pay'] == "N")) { + if (($ref_pay > 0) && (getConfig('allow_direct_pay') == "N")) { // Don't add points over the referal system $locked = true; $template = "mailid_points_locked"; @@ -242,9 +242,9 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // Shall I add bonus points for "turbo clickers" ? if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (function_exists('BONUS_ADD_TURBO_POINTS'))) { // Is an active-rallye running and this is not a notification mail? - if (($_CONFIG['bonus_active'] == "Y") && ($notify == "N")) { + if ((getConfig('bonus_active') == "Y") && ($notify == "N")) { // Shall I exclude the webmaster's own userid from the active-rallye? - if (((($_CONFIG['bonus_uid'] == $url_uid) && ($_CONFIG['bonus_include_own'] == "Y")) || ($_CONFIG['bonus_uid'] != $url_uid)) && ($_CONFIG['def_refid'] != $url_uid)) { + if ((((getConfig('bonus_uid') == $url_uid) && (getConfig('bonus_include_own') == "Y")) || (getConfig('bonus_uid') != $url_uid)) && (getConfig('def_refid') != $url_uid)) { // Add points and remember ranking are done in this function.... BONUS_ADD_TURBO_POINTS($DATA, $url_uid, $type); @@ -293,7 +293,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { define('_TYPE_VALUE', $type); define('_DATA_VALUE', $DATA); define('_TEMPLATE_BANNER', LOAD_TEMPLATE("mailid_banner", true)); - if ($_CONFIG['code_length'] > 0) + if (getConfig('code_length') > 0) { // Generate Code define('_IMAGE_CODE', IMG_CODE($code, $type, $DATA, $url_uid)); diff --git a/modules.php b/modules.php index 1788cf63b3..f8c1a88e38 100644 --- a/modules.php +++ b/modules.php @@ -98,7 +98,7 @@ include (PATH."inc/header.php"); // Modules are by default not valid! $MOD_VALID = false; $check = "failed"; -if ((!empty($_CONFIG['maintenance'])) && ($_CONFIG['maintenance'] == "Y") && (!IS_ADMIN()) && ($GLOBALS['module'] != "admin")) { +if ((getConfig('maintenance') == "Y") && (!IS_ADMIN()) && ($GLOBALS['module'] != "admin")) { // Maintain mode is active and you are no admin ADD_FATAL(LANG_DOWN_MAINTAINCE); } elseif (($link) && ($db) && (sizeof($FATAL) == 0)) { diff --git a/ref.php b/ref.php index 68003f01f8..ba76c41b6d 100644 --- a/ref.php +++ b/ref.php @@ -47,7 +47,7 @@ require("inc/config.php"); // Redirect only to registration page when this script is installed if (isBooleanConstantAndTrue('mxchange_installed')) { // Base URL for redirection - switch ($_CONFIG['refid_target']) + switch (getConfig('refid_target')) { case "register": $URL = URL."/modules.php?module=index&what=register&refid="; diff --git a/show_bonus.php b/show_bonus.php index 8b81926921..61e8ce264a 100644 --- a/show_bonus.php +++ b/show_bonus.php @@ -127,7 +127,7 @@ LIMIT 1", define('__BONUS_FOOTER', LOAD_TEMPLATE("show_bonus_footer", true)); // Total ranks who can win - define('__BONUS_TOTAL_RANKS', $_CONFIG['bonus_ranks']); + define('__BONUS_TOTAL_RANKS', getConfig('bonus_ranks')); // Load final template LOAD_TEMPLATE("show_bonus"); diff --git a/surfbar.php b/surfbar.php index 9cc8187bb4..68b6d38707 100644 --- a/surfbar.php +++ b/surfbar.php @@ -88,12 +88,12 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { $content = array( 'points' => TRANSLATE_COMMA($points), 'online' => SURFBAR_DETERMINE_TOTAL_ONLINE(), - 'reload' => ($_CONFIG['surfbar_stats_reload'] * 1000), - 'c_total' => TRANSLATE_COMMA($_CONFIG['surfbar_total_counter']), - 'c_today' => TRANSLATE_COMMA($_CONFIG['surfbar_daily_counter']), - 'c_yester' => TRANSLATE_COMMA($_CONFIG['surfbar_yester_counter']), - 'c_week' => TRANSLATE_COMMA($_CONFIG['surfbar_weekly_counter']), - 'c_month' => TRANSLATE_COMMA($_CONFIG['surfbar_monthly_counter']), + 'reload' => (getConfig('surfbar_stats_reload') * 1000), + 'c_total' => TRANSLATE_COMMA(getConfig('surfbar_total_counter')), + 'c_today' => TRANSLATE_COMMA(getConfig('surfbar_daily_counter')), + 'c_yester' => TRANSLATE_COMMA(getConfig('surfbar_yester_counter')), + 'c_week' => TRANSLATE_COMMA(getConfig('surfbar_weekly_counter')), + 'c_month' => TRANSLATE_COMMA(getConfig('surfbar_monthly_counter')), ); // Load template for "stats" page @@ -102,7 +102,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // Prepare content $content = array( 'online' => SURFBAR_DETERMINE_TOTAL_ONLINE(), - 'reload' => ($_CONFIG['surfbar_stats_reload'] * 1000) + 'reload' => (getConfig('surfbar_stats_reload') * 1000) ); // Load template for "stats" page @@ -110,9 +110,9 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { } else { // Prepare content $content = array( - 'restart' => $_CONFIG['surfbar_restart_time'], - 'start' => str_repeat("X", strlen($_CONFIG['surfbar_restart_time'])), - 'autostart' => ($_CONFIG['surfbar_autostart'] == "Y") ? "true" : "false" + 'restart' => getConfig('surfbar_restart_time'), + 'start' => str_repeat("X", strlen(getConfig('surfbar_restart_time'))), + 'autostart' => (getConfig('surfbar_autostart') == "Y") ? "true" : "false" ); // Load template for stopped surfbar diff --git a/templates/de/html/admin/admin_config_primera.tpl b/templates/de/html/admin/admin_config_primera.tpl index 0a712c01bc..573896ee37 100644 --- a/templates/de/html/admin/admin_config_primera.tpl +++ b/templates/de/html/admin/admin_config_primera.tpl @@ -34,6 +34,16 @@ »$content[api_md5]« + + {--PRIMERA_ADMIN_REFID--}: +   + + + +   +   diff --git a/templates/de/html/admin/admin_config_surfbar.tpl b/templates/de/html/admin/admin_config_surfbar.tpl index a193384adb..b88c61ea50 100644 --- a/templates/de/html/admin/admin_config_surfbar.tpl +++ b/templates/de/html/admin/admin_config_surfbar.tpl @@ -174,6 +174,17 @@     + + + {--ADMIN_CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK--} + + +  {--YES--} +  {--NO--} + + +   +   {--ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE--} diff --git a/templates/de/html/member/member_primera_mode_pay.tpl b/templates/de/html/member/member_primera_mode_pay.tpl index 620638030f..816d978807 100644 --- a/templates/de/html/member/member_primera_mode_pay.tpl +++ b/templates/de/html/member/member_primera_mode_pay.tpl @@ -20,7 +20,7 @@ {--PRIMERA_MEMBER_NICKNAME--}   - + {--PRIMERA_MEMBER_PASSWORD--} -- 2.30.2