]> git.mxchange.org Git - mailer.git/commitdiff
Mahor rewrite:
authorRoland Häder <roland@mxchange.org>
Wed, 17 Dec 2008 21:15:53 +0000 (21:15 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 17 Dec 2008 21:15:53 +0000 (21:15 +0000)
- 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

188 files changed:
beg.php
birthday_confirm.php
doubler.php
inc/autopurge/purge-general.php
inc/autopurge/purge-inact.php
inc/autopurge/purge-mails.php
inc/autopurge/purge-tsks.php
inc/autopurge/purge-unconfirmed.php
inc/check-reset.php
inc/databases.php
inc/db/lib-mysql3.php
inc/doubler_send.php
inc/extensions.php
inc/extensions/ext-autopurge.php
inc/extensions/ext-beg.php
inc/extensions/ext-birthday.php
inc/extensions/ext-bonus.php
inc/extensions/ext-booking.php
inc/extensions/ext-cache.php
inc/extensions/ext-debug.php
inc/extensions/ext-doubler.php
inc/extensions/ext-holiday.php
inc/extensions/ext-primera.php
inc/extensions/ext-sponsor.php
inc/extensions/ext-sql_patches.php
inc/extensions/ext-surfbar.php
inc/extensions/ext-transfer.php
inc/extensions/ext-user.php
inc/footer.php
inc/functions.php
inc/gen_sql_patches.php
inc/header.php
inc/install-inc.php
inc/language/de.php
inc/language/primera_de.php
inc/language/surfbar_de.php
inc/libs/admins_functions.php
inc/libs/beg_functions.php
inc/libs/bonus_functions.php
inc/libs/doubler_functions.php
inc/libs/primera_functions.php
inc/libs/rallye_functions.php
inc/libs/register_functions.php
inc/libs/removeip_functions.php
inc/libs/rewrite_functions.php
inc/libs/sponsor_functions.php
inc/libs/surfbar_functions.php
inc/libs/task_functions.php
inc/libs/theme_functions.php
inc/libs/user_functions.php
inc/libs/wernis_functions.php
inc/libs/yoomedia_functions.php
inc/load_extensions.php
inc/loader/load_cache-admin.php
inc/loader/load_cache-config.php
inc/loader/load_cache-modreg.php
inc/loader/load_cache-refdepths.php
inc/loader/load_cache-refsystem.php
inc/loader/load_cache-them.php
inc/mails/beg_mails.php
inc/mails/birthday_mails.php
inc/mails/bonus_mails.php
inc/modules/admin.php
inc/modules/admin/admin-inc.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-add_rallye.php
inc/modules/admin/what-add_sponsor.php
inc/modules/admin/what-autopurge.php
inc/modules/admin/what-cache_stats.php
inc/modules/admin/what-config_active.php
inc/modules/admin/what-config_admin.php
inc/modules/admin/what-config_autopurge.php
inc/modules/admin/what-config_beg.php
inc/modules/admin/what-config_birthday.php
inc/modules/admin/what-config_bonus.php
inc/modules/admin/what-config_cache.php
inc/modules/admin/what-config_doubler.php
inc/modules/admin/what-config_extensions.php
inc/modules/admin/what-config_holiday.php
inc/modules/admin/what-config_home.php
inc/modules/admin/what-config_mediadata.php
inc/modules/admin/what-config_newsletter.php
inc/modules/admin/what-config_order.php
inc/modules/admin/what-config_other.php
inc/modules/admin/what-config_points.php
inc/modules/admin/what-config_primera.php
inc/modules/admin/what-config_proxy.php
inc/modules/admin/what-config_refback.php
inc/modules/admin/what-config_refid.php
inc/modules/admin/what-config_reg.php
inc/modules/admin/what-config_register2.php
inc/modules/admin/what-config_removeip.php
inc/modules/admin/what-config_rewrite.php
inc/modules/admin/what-config_secure.php
inc/modules/admin/what-config_session.php
inc/modules/admin/what-config_sponsor.php
inc/modules/admin/what-config_stats.php
inc/modules/admin/what-config_surfbar.php
inc/modules/admin/what-config_title.php
inc/modules/admin/what-config_top10.php
inc/modules/admin/what-config_transfer.php
inc/modules/admin/what-config_user.php
inc/modules/admin/what-config_wernis.php
inc/modules/admin/what-config_yoomedia.php
inc/modules/admin/what-del_email.php
inc/modules/admin/what-email_archiv.php
inc/modules/admin/what-email_details.php
inc/modules/admin/what-extensions.php
inc/modules/admin/what-list_autopurge.php
inc/modules/admin/what-list_beg.php
inc/modules/admin/what-list_bonus.php
inc/modules/admin/what-list_notifications.php
inc/modules/admin/what-list_payouts.php
inc/modules/admin/what-list_rallyes.php
inc/modules/admin/what-list_user.php
inc/modules/admin/what-list_yoomedia_tm.php
inc/modules/admin/what-maintenance.php
inc/modules/admin/what-unlock_emails.php
inc/modules/admin/what-unlock_sponsor.php
inc/modules/admin/what-updates.php
inc/modules/admin/what-user_online.php
inc/modules/admin/what-usr_online.php
inc/modules/chk_login.php
inc/modules/frametester.php
inc/modules/guest/action-online.php
inc/modules/guest/what-active.php
inc/modules/guest/what-beg.php
inc/modules/guest/what-confirm.php
inc/modules/guest/what-doubler.php
inc/modules/guest/what-login.php
inc/modules/guest/what-mediadata.php
inc/modules/guest/what-rallyes.php
inc/modules/guest/what-register.php
inc/modules/guest/what-sponsor_login.php
inc/modules/guest/what-sponsor_reg.php
inc/modules/guest/what-stats.php
inc/modules/guest/what-top10.php
inc/modules/guest/what-welcome.php
inc/modules/guest/what-wernis_portal.php
inc/modules/index.php
inc/modules/login.php
inc/modules/member/what-beg.php
inc/modules/member/what-beg2.php
inc/modules/member/what-bonus.php
inc/modules/member/what-categories.php
inc/modules/member/what-doubler.php
inc/modules/member/what-holiday.php
inc/modules/member/what-mydata.php
inc/modules/member/what-newsletter.php
inc/modules/member/what-order.php
inc/modules/member/what-payout.php
inc/modules/member/what-points.php
inc/modules/member/what-primera.php
inc/modules/member/what-rallyes.php
inc/modules/member/what-refback.php
inc/modules/member/what-surfbar_book.php
inc/modules/member/what-surfbar_start.php
inc/modules/member/what-transfer.php
inc/modules/member/what-unconfirmed.php
inc/modules/member/what-wernis.php
inc/modules/order.php
inc/modules/sponsor/account.php
inc/monthly/monthly_beg.php
inc/monthly/monthly_bonus.php
inc/monthly/monthly_newsletter.php
inc/mysql-connect.php
inc/mysql-manager.php
inc/patch-system.php
inc/pool/pool-bonus.php
inc/pool/pool-user.php
inc/profile-updte.php
inc/reset/reset_beg.php
inc/reset/reset_holiday.php
inc/reset/reset_surfbar.php
inc/reset/reset_yoomedia.php
inc/session.php
inc/stats_bonus.php
inc/stylesheet.php
index.php
mailid.php
mailid_top.php
modules.php
ref.php
show_bonus.php
surfbar.php
templates/de/html/admin/admin_config_primera.tpl
templates/de/html/admin/admin_config_surfbar.tpl
templates/de/html/member/member_primera_mode_pay.tpl

diff --git a/beg.php b/beg.php
index 440e7328da880ef310b9f4ff119ae9237adf97bf..cd4b2f6363ed08de5c4b0a734c59d61fc4f76362 100644 (file)
--- 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;
                }
index 3af2baa62dbe5fec0274522de14ee202b001eb87..a29859a8d6a348a582cd728c180a6ef39d8e4e3c 100644 (file)
@@ -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",
index 5d39bf1771d7f119f52b524e672e657055acee1c..34c7c7380cba253ff4d136a053006bf235ab1e98 100644 (file)
@@ -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()));
index cdd1f262a6e8de35c7026986182fd18d2ba57302..6b5e36b990b1d46cb854c20f0d03b69b56f898d1 100644 (file)
@@ -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
index 189ed2eb2b2c5cd48976e89b4c4bfcd3736568be..33aaa9acd947c00e04142abe8295b0a8277d6a89 100644 (file)
@@ -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
index 99a02c48735f105351c486a719f3646b26515b29..89f4dd7d632175357da2a62c1368191fb12da49f 100644 (file)
@@ -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, "");
        }
index a2a9038b12fb63a5e33e46077ae09cedffa7389e..96124da6be91095b8d2ae3c10fa53c8818ec8459 100644 (file)
@@ -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
index 7e997f2a2c3a852a2a0595f81b5ce70a609c87ea..2471dfcf278ad3ff9e35f1b8a739eedd7e336083 100644 (file)
@@ -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
index 874c10985dca713855ee237b93f503531c4aa53e..bef0aef20cc7459f4af5d9227362fbd75f0a2fab 100644 (file)
@@ -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);
index c52f120ed061f7bdd3e73b425896b22b3554bbfd..183583472293a821670369fc19a363c211dcd07c 100644 (file)
@@ -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));
index c2d781c655672cef838422009c56b92c9803410e..3d7f11ca3e9f97e5194904cc4360ee904a6f5a59 100644 (file)
@@ -64,7 +64,7 @@ Query string:<br />
        $_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:<br />
        } // 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']."<br />\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')."<br />\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
index 223caa39786fbb79dfff32864dc66f072f95e68d..f5a671d9ae25f1207df68468482ecb6a918f7594 100644 (file)
@@ -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;
index b1c14b94dbf240e3f2737a7861353b975da4602b..76047df9841e2f6aea06482518a3ba9a962c9b77 100644 (file)
@@ -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 .= ("<div class=\"update_notes\"><strong>v".$ver.":</strong><br />".$UPDATE_NOTES."</div>");
@@ -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 .= ("<div class=\"update_notes\"><strong>v".$ver.":</strong><br />".$UPDATE_NOTES."</div>");
@@ -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  = "<div align=\"center\">
 <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"".$width."\" align=\"center\"".$dashed.">
 <tr>
@@ -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 .= "<tr>
   <td colspan=\"2\" align=\"center\" class=\"switch_sw2 bottom2\" height=\"24\">
@@ -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",
index eaae7a41779aaa2aa400dd6745db78fb5a8fb613..e84271257361ab7e7fd4a00b3d1a266f24d5251e 100644 (file)
@@ -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&ouml;schenden Aufgaben klappt wieder. Zeitlimit f&uuml;r genanntes kann eingestellt werden (Default = 7 Tage).<br /><br /><U>Bitte aktualisieren Sie auch die Admin-Templates!</U>";
index d096f171414c9b2fbe77a182f1e4c893e6ff1134..2a8013daf2b8089729defc1c43b41e65c82c9259 100644 (file)
@@ -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
index cf3da62bedbd78b91b5186bb3759f538c6e3241f..12a73934001dbe7e3570bcbabdd8b5064b3007fb 100644 (file)
@@ -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);
index 5fbad0782d95aa1f2679def255d81198ff9df96f..cd6a6d8b68f1b462cb889ad3aab48e19666a9f57 100644 (file)
@@ -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&#39;ten Klick auf die Mail verbucht werden sollen. Beispiele: Der 1. Klick sollte mehr {!POINTS!} zus&auml;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&uuml;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&uuml;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);
        }
index 4470efd1be150cfbf1dc02a7a89a6697176246f8..73ea712ff29b8b5c6963992780b74182669646e8 100644 (file)
@@ -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`";
index 2f42c603c601630f82f338896dd8017b5914305e..41e689a336159c22cb61d00e52f5ff4192e6fbbf 100644 (file)
@@ -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__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_INITIALIZE);
index 3bbc10dac53486602e5c9e97029bab6f1c17956a..08987c83d4f0db6f6c8bd1c17c8023c3ded4984e 100644 (file)
@@ -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
index 1696640d88cd365924b36bc25e3eb3970027b73f..75cc6c2d3fc0d1f01aa86305ba76cd2f293f99f8 100644 (file)
@@ -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);
        }
index a25a89521c2cd94b7256e90893fe699245107f57..e91e384008f6984c71054540824f75759d19693e 100644 (file)
@@ -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 <STRONG>Urlaub</STRONG> geschaltet. Lassen Sie sich nicht davon verwirren, dass sie &quot;freigegeben&quot; sind!";
index c7a1124755536f152f7691cc0d2082c43009c809..246335a98c8c56836a7b2c5b03f6d726312ad2d8 100644 (file)
@@ -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 ''";
index 936fc02a546f232cc82b6f32994c5bd43d18e76a..8bc5cf8fc959d791b3c48d852b838ff2ea974ce1 100644 (file)
@@ -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,
index a8518ffc07981a4f0db3f6f41b9ebfcae6223bed..92b8b05ed591d3391497f9017b5c923c263becb0 100644 (file)
@@ -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 <STRONG>"._MYSQL_PREFIX."_config</STRONG> musste die Spalte <STRONG>auto_purge</STRONG> (autom. L&ouml;schen von Best&auml;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&uuml;punkt (what-welcome ist Standart) als Einstiegspunkt in das Men&uuml;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&ouml;nnen nun <A href=\"".URL."/modules.php?module=admin&amp;`what`=config_home\">hier</A> die Verz&ouml;gerungszeit in der <A href=\"".URL."/index.php\">Eingangsseite</A> 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);
index fbb2cf5068a2385606e31ffa113ce7784665577b..7157b5e2aa93a69d7fb3bb6bbae77e7e6ce39cb4 100644 (file)
@@ -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'";
 
index a807ee29e3615220ec02dcb7d4bf3e49a011da4b..f2fef8784f8d7cb5a1478d894db7fe046526f574 100644 (file)
@@ -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;
 }
index 08c607e5446cc8edad3c7a9a21444ef69fd39ada..3ba1a8a8ce9d189ed6800f265574a6f709d5e5e8 100644 (file)
@@ -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&ouml;schungen auflisten','Listet die L&ouml;schungen von Usern auf.', 9)";
                $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_del`";
                $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_user_del` (
index 90f323b5c3c2fb2fb8c3b58ffe63df33f6b9d680..5e248a609b532bdbb83a79ea761e366808e12362 100644 (file)
@@ -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
index 99308e65a5ece761d27e3aab0d4dac78f7771aa1..992c4a7373af6cc475fd21b82865921d640073eb 100644 (file)
@@ -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__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - PRE<br />\n";
-               $content = array_merge($content, SQL_FETCHARRAY($result));
+               $content = merge_array($content, SQL_FETCHARRAY($result));
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - AFTER<br />\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}<br />\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}<br />\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}<br />\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}<br />\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}<br />\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}<br />\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."<br />\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:<pre>");
                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).")<br />";
 
                // Generate the password salt string
-               $salt = substr($sha1, 0, $_CONFIG['salt_length']);
+               $salt = substr($sha1, 0, getConfig('salt_length'));
                //* DEBUG: */ echo $salt." (".strlen($salt).")<br />";
        } else {
                // Use given salt
-               $salt = substr($salt, 0, $_CONFIG['salt_length']);
+               $salt = substr($salt, 0, getConfig('salt_length'));
                //* DEBUG: */ echo "GIVEN={$salt}<br />\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."<br />".$newHash." (".strlen($newHash).")");
-               $ret = generateHash($newHash, $_CONFIG['master_salt']);
+               $ret = generateHash($newHash, getConfig('master_salt'));
                //* DEBUG: */ print($ret."<br />\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 //
index 18faa6fd8cfdaa8645dfdcf85b71c78c8c6e4c25..98337f0f3c55565e050416eeffe2223629929e26 100644 (file)
@@ -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;
index a13fff6eb8f9203c2fe49c2f0782c3f943db0608..b510202cc6834f0c3e255cf16d49faedcbe31a9a 100644 (file)
@@ -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));
index b01597a871eff1f582a1dcf4251c94c1940b15e8..5768d4807b22dc8bc1490d9b2e3e492afa492102 100644 (file)
@@ -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
 
index 3de3caa6e470ce2d07406a6825d675fa691de0ec..2724fb93dc4950306113be1f47b4743450e95ce5 100644 (file)
@@ -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', "&Auml;ndern");
 define('CHANGE_MEMBER_MENU', "Verdecken, anzeigen, deaktivieren, aktivieren des Mitgliedsmen&uuml;s");
 define('CHANGE_MENU_1', "&Auml;ndern von <strong>");
@@ -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 (<strong>Nicht verwendet!</strong>)");
 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");
index e3f315019203705acf10c478e1448ea5311b39cc..9757b3aac4d7690cb073399789032c24616223cc 100644 (file)
@@ -45,6 +45,7 @@ define('PRIMERA_ADMIN_MIN_PAYOUT', "Minimumguthaben f&uuml;r Auszahlungen.");
 define('PRIMERA_ADMIN_MIN_WITHDRAW', "Minimumguthaben f&uuml;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', "<A href=\"http://www.primusportal.de/r/Quix0r\" target=\"_blank\">Hier</A> k&ouml;nnen Sie sich ein Primus-Portal-Account holen. <strong>Geben Sie immer Ihren Usernamen von Primus-Portal ein und &uuml;berpr&uuml;fen Sie diesen mehrmals! Er wird zum &Uuml;berweisen von Primera ben&ouml;tigt.");
 define('PRIMERA_ADMIN_NO_TRANSFERS', "Derzeit keine Primera transferiert!");
 define('PRIMERA_ADMIN_ACCOUNT', "Account bei Primus-Portal");
index a44d1df10f030f6a8317e172b7f113532113e342..2f865c0bd8da16f4f52cb45b5d0f1476d98baef0 100644 (file)
@@ -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.<br /><span class=\"admin_note\">(Bitte angeben)</span>");
 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 &quot;pausierend&quot; gesetzt sind?");
+define('ADMIN_CONFIG_SURFBAR_NOTIFY_LIMITS', "Soll das Mitglied per Mail benachrichtigt werden, wenn aufrufbegrenzte URLs abgelaufen und auf &quot;pausierend&quot; gesetzt sind? (<strong>Derzeit nicht verwendet!</strong>)");
+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&uuml;r Nachrichten wegen niedrigem {!POINTS!}-Guthaben:");
index b4ca1c90e7371243d61653c24204bb77f3210088..c4e0045a010e091994010a52b03386074bcbde20 100644 (file)
@@ -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;
                                        }
                                }
index 8ab5bf13a12fedfe3ab2c1cd6a6e571f63c1db7e..04db5702d15d147ac96b41750fd3a46766c18a23 100644 (file)
@@ -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
 }
 
index eefd9e30c74fffbb7e15df8c200efe853f4fec61..a4fdf06ce5903c6ba775d2f7df7c24758a7727c2 100644 (file)
@@ -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(), "");
index 3c44736a4c689bdb9a5b0a8f34b32ae87ce580ef..d2476e79274c27abc73ad63d27353c6221cd16fd 100644 (file)
@@ -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 = "<TR>
   <TD colspan=\"".$COLS."\" align=\"center\" class=\"doubler_big_row bottom2\">
@@ -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;
        }
 
index 1d19c960a73467df51e8830c879fd9120f4c96ec..3a1cff07a0562c9d9b7fa0e651d2777b94622fa5 100644 (file)
@@ -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']))."\";";
index f72721af377a74cdd65097a0b2e05273eb39d9ea..ec2af80dbdce40a199e2f225c02e97b252b98601 100644 (file)
@@ -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."+<br />";
index f90e1b8d3083313fe27b46d4878a18c6db1102bf..93623b45eab5876e9b559c2125fd7b0b2c54e3c5 100644 (file)
@@ -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\"";
index 8965fbdd71ed8121d5d3ce3a731b333262414072..e3b69e9e8b0a34cbffebf638a538d4ae684f0ef2 100644 (file)
@@ -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);
index 13f9a3b48691528698b81342cea670b074b08462..5a1929e6a2bd25f80e2b48a0441f192389980628 100644 (file)
@@ -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."(.*)&amp;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 "&amp;var=" to "/var/"
                        $test = preg_replace("/&amp;".$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 &amp;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 &amp;u_id= with /u/
                        $test = preg_replace("/&amp;".$v."=/i", "/".$REPLACE['replace'][$k]."/", $test);
-               }
-       }
+               } // END - if
+       } // END - foreach
 
        // Repair missed &amp;what=??? entries
-       while (preg_match("/&amp;what=(.*)\/(.*)\/(.*)/i", $test))
-       {
+       while (preg_match("/&amp;what=(.*)\/(.*)\/(.*)/i", $test)) {
                $test = preg_replace("/&amp;what=(.*)\/(.*)\/(.*)/i", "/wht/\$1/\$2/\$3", $test);
-       }
+       } // END - while
 
        // Return rewritten code
        return $test;
index 5c511f85a61e96b1f2ebc002d527657b07b1f2b0..b0deed1830631e2ac4f3ac56b45bfbde94b9004d 100644 (file)
@@ -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)) &&
index 9cc7e7e9959f2daaa632c53d133876b345daf735..434ce4f15c55cb459335868f7e3da2b6e63ce063 100644 (file)
@@ -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();
index 310e222f7213c5cc0b8cfc20306dc1634669c514..b496e1df1f7b4848307ee91792c0ce73fcec5db9 100644 (file)
@@ -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
index 6fbcd9890409a194c3cdb3d73a69e7a9decbfb84..5fff9d70642ae01cd8c18a3cb5fe9166eb120b14 100644 (file)
@@ -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",
index d00650cfbd63708fed76562aa83bd76f115d5d99..3a385ff3aef0b867354f90a655fab97cfbf7a485 100644 (file)
@@ -59,7 +59,7 @@ function alpha($sortby, $colspan, $return=false) {
                        $OUT .= "&amp;letter=".$ltr."&amp;sortby=".$sortby.$ADD."\">".$ltr."</A>";
                }
 
-               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 .= "&nbsp;]<br />[&nbsp;";
                } elseif ( $counter != $num ) {
                        $OUT .= "&nbsp;|&nbsp;";
@@ -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) {
index ee8a5d9958e5b862c6d23bd7c02efd03fd3bedca..d42c6c1ba20b26e74195087c18ff25c0f9f8f16b 100644 (file)
@@ -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}<br />\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'));
 }
 
 //
index 04deb26e9d62b6a78f81606d8ecfce8f269bc077..22a0fb9c6b63581017352520582112903acf56f4 100644 (file)
@@ -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
index b31dfe68d10ac1050a06044ce3dfe0982ec427bd..8a8c883826a223c309a3025244237003fb15229e 100644 (file)
@@ -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";
        }
index 336732ba9aabe3f213eadda4a5da50cb9f5d7efe..d55aa09f1bc2fabc4b6c6d36dfbb2982ff74d3f8 100644 (file)
@@ -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");
index 150b7a4e62f761d66d3a3a5e94ae3d6c77cad907..d7da6fd7d0b6478b1ab1b7c959d611f3cd4ec203 100644 (file)
@@ -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");
index 25f5652c21adac824290d6b61295870d98c03437..5d5196efddec8fd34c03c465e76123013f03657e 100644 (file)
@@ -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");
index 41097f3bc5e39ffea261a0eee92b69cbd87832a2..1cd352bc02c411c1ea2e47595cf16eaad13deeb5 100644 (file)
@@ -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");
index b841bd1de0b00ba5852b63821fe7db78b21397b4..c44c9d6d1325b08468df62e5400ec9b0b8a360f6 100644 (file)
@@ -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");
index 9f09a159f443921929949bb0ee916f53682dfa53..f8d70df07d622142dbc0b3f23478f1fcc8f591f0 100644 (file)
@@ -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");
index 2d37118b0d145ca0290ea6cb39e809e8fd7f9ee4..832bc5e7d851667b9dbf227eb8e492ccdbef8f9f 100644 (file)
@@ -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
 
index b51e154d79a89395e8136cad0dc3c358df2914f9..c23b1d7bfd9790564b9003c5e7772a33fa526e51 100644 (file)
@@ -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));
index 6b45f0dda6228df2a68debf144a52d9c19ed5581..860a33701c3c6f1cc7b95a9ae7da0c413861653a 100644 (file)
@@ -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
 
index 0a6951b998c4a3147572530a631349d905dc63cd..c144a4dc6adba17ccf7b12388c8f03f996c27b23 100644 (file)
@@ -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"))) {
index 586f1803f7e6aac8004a6ff6f471002993e63a73..9ac190ce3747de34f9ab11b231a5dc720f0ec1c2 100644 (file)
@@ -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");
index c99b12796be1f082c1d24d6aba8dbf55d8e0a0ae..e8a2b36674321af689b7c92c3c35c9ba2c9f2c08 100644 (file)
@@ -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%")."<br />\n";
                                        } // END - if
index 12fb85f1fad13cdbb80da8bf8b17f57a04f542ed..d0ffeb91690c2476e8e196412d003ce17dae4a39 100644 (file)
@@ -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"));
index 1f736068ee145ec0c44142d1f91e4af3bad44deb..3630a89c13918b2fafec7ee4cd9488f0abf466db 100644 (file)
@@ -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");
index da04ee23e4a28ce2a19d6584d248cb120d34e1d3..f87b68fd319130d505ca122256bd7490eb3d0a92 100644 (file)
@@ -1,80 +1,3 @@
 <?php
-/************************************************************************
- * MXChange v0.2.1                                    Start: 06/25/2004 *
- * ================                             Last change: 06/25/2004 *
- *                                                                      *
- * -------------------------------------------------------------------- *
- * File              : what-autopurge.php                               *
- * -------------------------------------------------------------------- *
- * Short description : AutoPurge configuration                          *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung  : AutoPurge-Konfiguration                          *
- * -------------------------------------------------------------------- *
- *                                                                      *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
- * For more information visit: http://www.mxchange.org                  *
- *                                                                      *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or    *
- * (at your option) any later version.                                  *
- *                                                                      *
- * This program is distributed in the hope that it will be useful,      *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
- * GNU General Public License for more details.                         *
- *                                                                      *
- * You should have received a copy of the GNU General Public License    *
- * along with this program; if not, write to the Free Software          *
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
- * MA  02110-1301  USA                                                  *
- ************************************************************************/
-
-// Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
-       require($INC);
-}
-
-// Add description as navigation point
-ADD_DESCR("admin", __FILE__);
-
-if (isset($_POST['ok'])) {
-       // Data was submitted so we store it
-       ADMIN_SAVE_SETTINGS($_POST);
-} else {
-       // Setup constants for the template
-       switch ($_CONFIG['autopurge_inactive']) {
-               case 'Y':
-                       define('__YES_IN', " checked=\"checked\"");
-                       define('__NO_IN' , "");
-                       break;
-
-               case 'N':
-                       define('__YES_IN', "");
-                       define('__NO_IN' , " checked=\"checked\"");
-                       break;
-       }
-
-       switch ($_CONFIG['autopurge_unconfirmed']) {
-               case 'Y':
-                       define('__YES_UN', " checked=\"checked\"");
-                       define('__NO_UN' , "");
-                       break;
-
-               case 'N':
-                       define('__YES_UN', "");
-                       define('__NO_UN' , " checked=\"checked\"");
-                       break;
-       }
-
-       define('__AP_IN_SINCE', $_CONFIG['ap_inactive_since']);
-       define('__AP_IN_TIME' , $_CONFIG['ap_in_time']);
-       define('__AP_UN_TIME' , $_CONFIG['ap_un_time']);
-
-       // Output template
-       LOAD_TEMPLATE("admin_config_autopurge");
-}
-//
+// DEPRECATED!
 ?>
index 13e22537de0e39cdab958c38ca6e5ad669d1de43..ccdbd3efea7655a04d7bf389cf5f2a5d8f14dbfe 100644 (file)
@@ -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");
index 2d244f804645ae79dcdd6dfdde5a0ed047d11d3d..efb00e6321ce57e4f685afd21560019763274750 100644 (file)
@@ -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");
index 83084f6f6bbe9dcd9fc3d5b0c33de90b6f6d81d8..8f42cfc5ec5dbad039460e8c48184124fe6ba496 100644 (file)
@@ -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\"");
index 56bf2c494e3301ed9c65dfb504a447b75fd6e45b..b55200c1a2d3daf261b8ff5fe6176679744a4f5a 100644 (file)
@@ -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 {
index b6033f28c46608362acb5b2834325a963bc08b34..c17cde08f60ad3e71a6f92a424dfb6b0d01c6fb7 100644 (file)
@@ -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");
index 6ecd32903fac404b4ff84217e2d7d7c91ff7cf4a..174bbf655621e1c9c8949b4bb67ebc654fa732e0 100644 (file)
@@ -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\"");
index 3e3308027ebd003bc1b62607ace2210a9edf408f..63e933d9f336e95c7776bfc251147d247e1ef8f0 100644 (file)
@@ -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 = "<OL start=\"2\">\n";
@@ -109,128 +109,128 @@ if (isset($_POST['ok'])) {
        $OUT .= "</OL>\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;
index eade1757395995467d21fdc90994fcb3b72d53f2..68e34ed80aea906a2e6e84329c19ce702ba66f6f 100644 (file)
@@ -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");
index 2b3b5f54f29fdcb4ac43d46e0aa07ad43f1b9111..185aae57c17c526635c7cf9574abac7b1d86c6ba 100644 (file)
@@ -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");
index d79ef2e740a5c4dc6f811a64625569069b3823a5..4bd20e5a6968cf08385caae5dbf09d5a471b13d7 100644 (file)
@@ -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;
index 58a557e14a52e2f5fd64600c74d4995de6091501..56f823b9280445123ce75ffbfeb8853bbe061437 100644 (file)
@@ -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', "");
index 7c57c8882ea214f9cd93f079d2ecf17c8add2e65..1cf4abc2e8846e7316f272c87703344b11afd585 100644 (file)
@@ -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("<A href=\"".URL."/modules.php?module=admin&amp;what=config_home&amp;sub=settings\">".ADMIN_CONTINUE_TO_CONFIG."</A>");
-       }
-        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 = "<A href=\"".URL."/modules.php?module=admin&amp;what=config_home&amp;sub=target&amp;home=".$wht."\">"._IS_NEW_HOME."</A>";
-               if ($wht == $_CONFIG['index_home'])
+               if ($wht == getConfig('index_home'))
                {
                        // Is current home
                        $LINK   = "<STRONG class=\"admin_note\">"._IS_CURRENT_HOME."</STRONG>";
index 428d0f1cb3435903936ab027039d64f45c544231..2ea9b1b18db6e848575a09a2c38a59fc837d928f 100644 (file)
@@ -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', "<STRONG>".MAKE_DATETIME($_CONFIG['mt_start'], "3")."</STRONG>");
+               define('__MT_START', "<STRONG>".MAKE_DATETIME(getConfig('mt_start'), "3")."</STRONG>");
        }
         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");
index d8564cec27bd2086de05267ef955ee75f838a42f..d1ae33fc8313cbcc439055cf496fd7f4d5b8bae2 100644 (file)
@@ -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);
index 68489f219d0e2fb3ae5e1a39d472c1d6746ccc46..04febbd6ea023df9c5453339d612db8c2de9c9d5 100644 (file)
@@ -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");
index ba171a2831a69db9dc4e41f75ff67211c19aa9c6..3b6d1266a0ff77a7c5c82c3d7ab54998d85e2755 100644 (file)
@@ -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', "<INPUT type=\"text\" name=\"online_timeout\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$_CONFIG['online_timeout']."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
-               define('_CFG_URL_TLOCK'     , "<INPUT type=\"text\" name=\"url_tlock\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$_CONFIG['url_tlock']     ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
-               define('_CFG_PROFILE_LOCK'  , "<INPUT type=\"text\" name=\"profile_lock\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$_CONFIG['profile_lock']  ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
-               define('_CFG_PROFILE_UPDATE', "<INPUT type=\"text\" name=\"profile_update\" class=\"admin_normal\" size=\"10\" maxlength=\"255\" value=\"".$_CONFIG['profile_update']."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
-               define('_CFG_PROF_REUPDATE' , "<INPUT type=\"text\" name=\"resend_profile_update\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$_CONFIG['resend_profile_update'] ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+               define('_CFG_ONLINE_TIMEOUT', "<INPUT type=\"text\" name=\"online_timeout\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".getConfig('online_timeout')."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+               define('_CFG_URL_TLOCK'     , "<INPUT type=\"text\" name=\"url_tlock\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".getConfig('url_tlock')     ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+               define('_CFG_PROFILE_LOCK'  , "<INPUT type=\"text\" name=\"profile_lock\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".getConfig('profile_lock')  ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+               define('_CFG_PROFILE_UPDATE', "<INPUT type=\"text\" name=\"profile_update\" class=\"admin_normal\" size=\"10\" maxlength=\"255\" value=\"".getConfig('profile_update')."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+               define('_CFG_PROF_REUPDATE' , "<INPUT type=\"text\" name=\"resend_profile_update\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".getConfig('resend_profile_update') ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
        }
 
-       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);
        }
 
index 112a00992ec138c23f3f4334ddf0f82e86ca9d3f..1e93a7ff5195ce1481ba60a29d56fcea203e4a2c 100644 (file)
@@ -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");
index 873eea58e2ead4e163ee0ffcb537137af8100110..69afcbf6cd6b2fd3a7fbe9166b81be11dfeeb8b9 100644 (file)
@@ -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
index 8eba046009305e3625f2ab7c159db694c7c8cba6..3a2f37ec3188c38e2d5239418bf8b3dfd62e6da5 100644 (file)
@@ -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
index 0b9c2cf3a65b53eed7d9924ce25a8d1f0efddb47..3939a8c38973c5da252ee26e02395ec6bcd6c642 100644 (file)
@@ -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'] = "";
index 7bc5d32eb0acab7c51f9ac0259197bfc680285e5..e73793413654742e2fc6015fd5c3182fbe780272 100644 (file)
@@ -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
index d64d2aa869db4b6ad0cab3904f08686728ab3965..f87b68fd319130d505ca122256bd7490eb3d0a92 100644 (file)
@@ -1,73 +1,3 @@
 <?php
-/************************************************************************
- * MXChange v0.2.1                                    Start: 10/12/2003 *
- * ===============                              Last change: 04/26/2004 *
- *                                                                      *
- * -------------------------------------------------------------------- *
- * File              : what-config_reg.php                              *
- * -------------------------------------------------------------------- *
- * Short description : Setup for the registration form                  *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung  : Einstellungen fuer das Anmeldeformular           *
- * -------------------------------------------------------------------- *
- *                                                                      *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
- * For more information visit: http://www.mxchange.org                  *
- *                                                                      *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or    *
- * (at your option) any later version.                                  *
- *                                                                      *
- * This program is distributed in the hope that it will be useful,      *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
- * GNU General Public License for more details.                         *
- *                                                                      *
- * You should have received a copy of the GNU General Public License    *
- * along with this program; if not, write to the Free Software          *
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
- * MA  02110-1301  USA                                                  *
- ************************************************************************/
-
-// Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
-       require($INC);
-}
-
-// Add description as navigation point
-ADD_DESCR("admin", __FILE__);
-
-if ((isset($_POST['ok'])) && (function_exists('CREATE_TIME_SELECTIONS')))
-{
-       // Calculate timestamp from selections...
-       $_POST['ip_timeout'] = CREATE_TIMESTAMP_FROM_SELECTIONS("ip_timeout", $_POST);
-}
-
-if ((empty($_POST['least_cats'])) || (empty($_POST['ip_timeout'])))
-{
-       unset($_POST['ok']);
-}
-if (isset($_POST['ok']))
-{
-       // Save settings
-       ADMIN_SAVE_SETTINGS($_POST);
-}
- else
-{
-       // Remember stuff in constants
-       define('LEAST_CATS_VALUE'   , $_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('__REF_PAYOUT'       , $_CONFIG['ref_payout']);
-
-       // Load normal template
-       LOAD_TEMPLATE("admin_config_reg");
-}
-
-//
+// DEPRECATED!
 ?>
index 78e3506a1d1f03c8ebc58322490457c1cace427f..0b66142186e1d586c940d3995d5041562214ca01 100644 (file)
@@ -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");
index bdd72a4888acc3bf6e5637de053dc83a6a9ef646..3340076b3298c18d2d429600968e9627fb237cb8 100644 (file)
@@ -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'  , "");
index f2f9ef81347db50c71c37401965629b467370900..0beb356e458a0b3afe60be70b9f1b3b3db4e7ea5 100644 (file)
@@ -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 = "";
index 2f9e327ce6157f5fbb84e21ff3c845b762fba180..e241ce7d65c420b7437019b8025e803f5dfc3e5f 100644 (file)
@@ -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");
index 1bd3b00661a2f127be8beb4351e15cff6392f98b..79f9dd96665bb5a958727e084a09641831699289 100644 (file)
@@ -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
index cdfaa8f280293e6b29471b21c296ada498812ab1..ba900de273cca9270756feea1b1693949de8dd25 100644 (file)
@@ -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");
index 50e87881bcc839e74372d1e12fa8606fbb297cc1..dd24fbee6e1e8b66f099665553c8750fb8dfe226 100644 (file)
@@ -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");
index 2d0d6d38ca26fe028fe87391753d2fad3dab3d0d..dcbea253335443bd671b2b1d4bcf93786e6278a7 100644 (file)
@@ -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'  , "");
index 176cc487931587684c67d48caeca08a40c560fa6..8ebb2a9335fff1e428db5b3a18fdb30f10e6c53e 100644 (file)
@@ -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");
index 018db8f184fc0dc66f5670cd84b0ee424ea161e9..4eeaf49ac6412c7f0671e81014c549f5ce32f7e5 100644 (file)
@@ -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");
index 2c6165ca32251a1ffd760c0524ff0725c7834f5a..5e6e755869ea5c2df21a6d03c89ea89beb4fba3d 100644 (file)
@@ -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");
index f2fcbbcbc2cae7a6c4905fe23e4d7c629331c2b9..62df2811ffea7e3f15dc633e831f8b972e3e6b7b 100644 (file)
@@ -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");
index 887d56bc17421fcc9616c2f11331a2d466b8bb62..3e79f811a4b9d1cbb080b55364e9abbc4a48b4b7 100644 (file)
@@ -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', "");
index e93cc9bb4abcee156e5b75b8c07b445518db7054..b50caf3a30613f846c9247dddb6f159b501e8c9a 100644 (file)
@@ -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', "");
index 13d4b6ef0f947647e3ff6b843e92feb8ee3f9366..10ddba988c63fc8a02a016d8a8bdb7dcec4279ed 100644 (file)
@@ -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."<br />\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)
index 2eb11fb039d2312dfd82a3ae1daf3d282481d86d..e67b4c3a4020dd5cd5c61f463a349defd453fe87 100644 (file)
@@ -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
        {
index ee06841fda1967d30946f77d8b384d03b107f9fd..1795e056ab26b951004b153f71310932e11cc191 100644 (file)
@@ -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;
index 204d1974b21dfad0f6507414b7e09b83eb11088d..d1d373d2ba2bd2f74dc6205f08d84890c602f717 100644 (file)
@@ -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
index 28eb8c2419554afd2ee6fcb78d9ab1aed2a2a9a1..855f4236c04310a69467c49af068261c84b15269 100644 (file)
@@ -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)
 {
index 5fb3f71b9f6e6a1a7e84493773b77fe4afb6da21..61ef7cfb557426d8e52a25afbe86a84d158098c5 100644 (file)
@@ -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("<br />");
-       }
+       } // 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 = "<STRONG>";
                                $WIN2 = "</STRONG>";
-                       }
+                       } // 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', "<FONT class=\"admin_failed\">".ADMIN_BEG_ALREADY_WITHDRAW."</FONT>");
                }
 
                // 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);
 }
index 88fe74fd797b93c05dd78db67282aa1566a716a6..6796a44b64404b4a4cb4325ee7dd6bde31eb3687 100644 (file)
@@ -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 = "<STRONG>";
                                $WIN2 = "</STRONG>";
@@ -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', "<FONT class=\"admin_failed\">".ADMIN_BONUS_ALREADY_WITHDRAW."</FONT>");
                }
 
                // 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);
 }
index c333c2d34625b1d7980ad4b56b9b39b9d36988b8..a7e3bbf1ba3b5da337f87dd7340ec0fd3ed9e334 100644 (file)
@@ -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;
index 5b90adfd9813e838b0b881829d22fa38742623bb..de61dd27e92ddbc904936e9ef5b6f30a0aaaeed4 100644 (file)
@@ -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', "<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".TRANSLATE_GENDER($gender)." ".$surname." ".$family."</A>");
 
-               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("<br />", $ret);
                                                LOAD_TEMPLATE("admin_payout_failed_transfer", false, $content);
                                        }
-                               }
-                                else
-                               {
+                               } else {
                                        // Cannot load payout id
                                        OUTPUT_HTML("<STRONG class=\"admin_failed\">".PAYOUT_FAILED_OBTAIN_PAYOUT_ID."</STRONG>");
                                }
-                       }
-                        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 = "<A href=\"".URL."/modules.php?module=admin&amp;what=list_payouts&amp;do=accept&amp;pid=".$pid."\">".PAYOUT_ACCEPT_PAYOUT."</A>&nbsp;|&nbsp;<A href=\"".URL."/modules.php?module=admin&amp;what=list_payouts&amp;do=reject&amp;pid=".$pid."\">".PAYOUT_REJECT_PAYOUT."</A>";
-                       }
-                        else
-                       {
+                       } else {
                                // Translate status
                                $status = constant('PAYOUT_STATUS_'.strtoupper($status).'');
                                $status = "<FONT class=\"admin_failed\">".$status."</FONT>";
@@ -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);
        }
index 552acec06f6866bc241511456538897b543e6632..dddae955bb540d1131704f1178011817f8305f6d 100644 (file)
@@ -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'] = "<STRONG class=\"big\">".$id."</STRONG>";
                                $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;
index 8618702c4d8e2d595d4f599bf55a9422a8a5c8bb..15990d4acc4275e76656fbf5e71a8e220dcf9f9f 100644 (file)
@@ -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', "");
index 252bd0d2f72451d36a0ca2e6cb67ad1cffb37b85..1e9e49e3171af20d05985c867d1a5032a5174db4 100644 (file)
@@ -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);
 
index 481b418cb11bd0a4fca3ce99f49199def4df7354..282e6c679ea9e1ff70ef15ff0e520c6f3f7c9878 100644 (file)
@@ -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;
        }
index 73d60306a77d3ef32e23c0bc057cf068ecae80ec..c26b9bcda13835111ae91f95fa675c518bd6dfcb 100644 (file)
@@ -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
index 81328dc904de2e6dbe57e5788d4055953c1f03d1..b970743b93a211b90671ad701f596d2f6940b866 100644 (file)
@@ -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
index cd689af7ad6981b0f5acddd2ca46ac878f1ca524..efff80d7fbd7eaa341e75277a295dd407ca90f4c 100644 (file)
@@ -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]);
index 07582a9fea9d804ebe9ff8972bb0f6c5cff3f2f7..ca6809212ea18a2f663cd32a38c6141153022066 100644 (file)
@@ -120,7 +120,7 @@ if (SQL_NUMROWS($result) > 0)
        }
        OUTPUT_HTML("<TR>
   <TD colspan=\"8\" align=\"center\" class=\"admin_footer\">
-    ".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."
   </TD>
 </TR>
 </TABLE>");
index 063fbb761238fe1771bec44e20253e9d04fa2849..5a50a372d67aa21f8879985703546a3a8e94f532 100644 (file)
@@ -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");
        }
 }
index b1bd8016e6b4c5808e50ba09f653b9f7ad556d2b..88f9d5281a1d808e79fc07786b712a236e439123 100644 (file)
@@ -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("<font class=\"tiny\">
   ".BONUS_LOGIN_BONUS_ADDED_1."
-  <strong>".TRANSLATE_COMMA($_CONFIG['login_bonus'])." ".POINTS."</strong>
+  <strong>".TRANSLATE_COMMA(getConfig('login_bonus'))." ".POINTS."</strong>
   ".BONUS_LOGIN_BONUS_ADDED_2."
 </font>");
        } elseif (EXT_IS_ACTIVE("bonus")) {
index 4e3f4f305400f05a757f135d01a4c2aba88dfeca..947753f18a38ef1599c053220a703587549e65e8 100644 (file)
@@ -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__);
index c7acfbbab8400a5506edb1b4487f48ca78acc6ca..37e623e572ec46988cd6cb95d176595f46612f09 100644 (file)
@@ -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' => "<A class=\"menu_blur\" href=\"".URL."/modules.php?module=index&amp;what=active\">".$_CONFIG['menu_blur_spacer'].GUEST_ACTIVE_LINK."</A>",
+               'menu' => "<A class=\"menu_blur\" href=\"".URL."/modules.php?module=index&amp;what=active\">".getConfig('menu_blur_spacer').GUEST_ACTIVE_LINK."</A>",
                'what' => "active"
        );
 
index 69a16d1de0f8fcc8473ed2dd6fe57afc7fecd248..e0d1a6e95ec1f76dc781caaf4edf95b769410370 100644 (file)
@@ -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) {
index 4d627db7758c4f4f8692cbb4b02b6673a08c27c1..88b8d4695eeb576ebc227b05e8ca4d295a8705cf 100644 (file)
@@ -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
index fa40e682f1625dd01ec614ff32f90beb799024b9..6f5a7cbe9dc9c9c3c86d5d4f80c76902c0a594aa 100644 (file)
@@ -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
 
index aea44a21329d9e60487c6cd9e650fdf7d762fa40..b50ddca2a7a8932bb007b39497c49b697a2059d3 100644 (file)
@@ -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());
index 6c7cb58b65e5b193cd291200ce1b77ced9d05ae0..6035504fb80e6f0470f99f945b1965d267384e95 100644 (file)
@@ -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
index fba0bdcb9ff4e1ce9db3adc7924dcc9403ec23e6..e2f2fabaf73061e60211e1199fe7d83d6f04b696 100644 (file)
@@ -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");
index 4c8acf31c06196cff08ccb9ecc676b065bc673ad..edf07850d46d9a64358e7b17f121ae1049b238ce 100644 (file)
@@ -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);
index e240aaaf07680cfa1f5019d7b0fdbdae148b3213..7fe0bf2b7c18a10f4b2007a30fae54f220649fe7 100644 (file)
@@ -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("<STRONG><SPAN class=\"register_failed\">".SHORT_PASS.": ".$_CONFIG['pass_len']."</SPAN></STRONG><br /><br />");
+               OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".SHORT_PASS.": ".getConfig('pass_len')."</SPAN></STRONG><br /><br />");
        } // END - if
 
        if ($IP_TIMEOUT) {
                OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".REMOTE_ADDR_TIMEOUT."</SPAN></STRONG><br /><br />");
        } // END - if
 
-       if ((!empty($cats)) && ($cats < $_CONFIG['least_cats'])) {
-               OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".CATS_LEAST.": ".$_CONFIG['least_cats']."</SPAN></STRONG><br /><br />");
+       if ((!empty($cats)) && ($cats < getConfig('least_cats'))) {
+               OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".CATS_LEAST.": ".getConfig('least_cats')."</SPAN></STRONG><br /><br />");
        } // 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']));
index 3586e33e88658a1e87de0f0b9cb69969777dec71..895e2280de8cac8ce12b0ae7abe9992b1e87c213 100644 (file)
@@ -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)) &&
index a101f17ae3425e8aea0b11c905d276f06e5141f2..7060952e9d3e3b83ec031c873712d41ee5ad4fac 100644 (file)
@@ -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,
index 3676670a058c583b2a7f6349ec9c53ceca777457..c7cfbdd3bcdc07663e46bd0263a96e70666fb56b 100644 (file)
@@ -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
index 705a45fa7a9ed06cfb355f5cefb2a0dd7fc088fb..5259cdf1e69109230425753caf4aa78e3326de73 100644 (file)
@@ -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");
index 72e0f5b55f2f8943309d3377ad8081d0b8ca673b..fe2a7e9b85f2bf51b40a4204235cdc3013cbb5a9 100644 (file)
@@ -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
index c891089b7ec2e128441152eed6298f4c50aed76d..b816ef637c0117201991a9c911fd1561695a8db8 100644 (file)
@@ -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
 
index fb602ae72231854e213e43617bc516529b1a321c..06fd11d42ff3b78b81f7f07f3d96b90db69258ae 100644 (file)
@@ -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");
 
index cdf0e72676539a3cdb7ef6e8299c01367b6a916b..b308473f7579acab6ae4ff056e11c125a5d282e3 100644 (file)
@@ -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");
 
index a48cd88338d5e74631fc0cf9bb37e7c4b3147162..3c52da348780ffd313ba80d635f568a5b28411f6 100644 (file)
@@ -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
index d3ce12bbc0794456bc5b08352f8fec96ef01e264..dad135342079edd14865683a9a54f731fe14ae5b 100644 (file)
@@ -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);
 }
index 324fbda0e5c7a63da140817949a2dd327fa708b4..15861a7bcf301b29b4a1c5ccb6ee98c653c7a10d 100644 (file)
@@ -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 = "";
index 3a7bbc9e04e4bdb43af54342170cbc0bc0b7ed27..796eb90adfe55d29cadcf5fec4c087120576d203 100644 (file)
@@ -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));
index cdb130df2075b6fa484fd119b2795434636fa007..631f8420f875d8a829b22e51a1bb5541a6b60379 100644 (file)
@@ -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());
index 0a840a1882396fc57e95b2d34ff949bca0cecab4..ecbbe17930ea4d6d8a06cff2f31667b4ddd321f0 100644 (file)
@@ -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");
index 37715eccb31bb0d313af22b3c99d4d672a036e64..185681b6b2965e400a71e7da314b5ed694d3e98d 100644 (file)
@@ -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', "<FONT class=\"member_failed\">".MEMBER_PROFILE_LOCKED_1.MAKE_DATETIME($DATA[13] + $_CONFIG['profile_lock'], "0").MEMBER_PROFILE_LOCKED_2."</FONT>");
+               define('CHANGE', "<FONT class=\"member_failed\">".MEMBER_PROFILE_LOCKED_1.MAKE_DATETIME($DATA[13] + getConfig('profile_lock'), "0").MEMBER_PROFILE_LOCKED_2."</FONT>");
        }
         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'])) {
index 7dd4140d33e51d9dfb9dd326132b53caaab10130..8868b04a40e7723d9ec1da4568407a89da8a0524 100644 (file)
@@ -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);
index 0ef9854cb32ba3fafa3440de3d04e2324e7497da..eace0213cbae9e80d58104fab8836a8cd6b47a9a 100644 (file)
@@ -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&amp;what=order&amp;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&amp;what=order&amp;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&amp;what=order&amp;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."<br />".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 = "<TR><TD colspan=\"2\" class=\"seperator bottom2\" height=\"5\">&nbsp;</TD></TR>\n";
+                                               if ((getConfig('order_multi_page') == "Y") || (IS_ADMIN())) $ADD = "<TR><TD colspan=\"2\" class=\"seperator bottom2\" height=\"5\">&nbsp;</TD></TR>\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)) {
index 2ad39b14f0cb4a40bbc1dd362689f9abee87f99c..8fbcba686af6ccf4d3c846405723f71d1857e2e0 100644 (file)
@@ -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
index dc1fa059bb4c32dc4b3f33327efbda55e7811b33..642ae6b9cca06e05a3c18dced8376486f394850b 100644 (file)
@@ -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"))) {
index 67e2215cb22d5af1e7d7926fcd01a164cc440de9..ae24e03d4940feee5f5ab4bddac5937aec504af8 100644 (file)
@@ -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("<br />");
@@ -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("<br />");
-                       } 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("<br />");
                        } elseif ($_POST['amount'] > $points) {
                                // Not enougth points left!
@@ -182,13 +182,13 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) {
                                OUTPUT_HTML("<br />");
                        } 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);
index 0f8fcc58fe80995247e15d45f35dc6cd999239a3..7d280f18259dc7e41999767f543b8e9e50f36feb 100644 (file)
@@ -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);
index eac8db386d6dea72b9ce2d9a4d200a5d82aad766..9563cf746ecef399bd91d81f9f14fff3b4e5ba1c 100644 (file)
@@ -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);
index c10c6cdd8fd4fce4c14afd03bd277889e7502357..d38757f1f0a207aa3bf84f07a486a8ddaaa9c221 100644 (file)
@@ -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);
 }
 
 //
index 9fb90957946bda22b786e03e6adb5076aeedf3e2..ccb4d2dd5c381f387976c13e6e29987009d8f577 100644 (file)
@@ -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");
index 5b7288dfc426e714b769e2287a0e7062e3dd0a85..5d1670bccf6bc7adcfb411e2ba05ed68684a1db7 100644 (file)
@@ -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', "<INPUT type=\"hidden\" name=\"code_chk\" value=\"".$rand."\"><INPUT type=\"text\" name=\"code\" class=\"member_normal\" size=\"5\" maxlength=\"7\"".__TRANSFER_TO_DISABLED.">&nbsp;".$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', "<A href=\"".URL."/modules.php?module=login&amp;what=transfer&amp;mode=new\">".TRANSFER_NOW_LINK."</A>");
                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));
index f381e4322480472c52f19a8610b752aeef49717f..0d010865aeb908cff548dc0fd419723c919a5187 100644 (file)
@@ -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");
index 3c7a323c9a9343b716626cd57323459138cfeb84..ae45f45c00107ffd57c66f389f8d2bad82f9b2d6 100644 (file)
@@ -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'] = "<em>".WERNIS_MEMBER_WITHDRAW_DISABLED."</em>";
 
                // Is the payout mode active?
-               if ($_CONFIG['wernis_payout_active'] == "Y") {
+               if (getConfig('wernis_payout_active') == "Y") {
                        // Add link
                        $content['payout_link'] = "<a class=\"menu_blur\" style=\"height: 40px\" href=\"".URL."/modules.php?module=login&amp;what=wernis&amp;mode=payout\"><div style=\"padding-top: 10px\">".MEMBER_WERNIS_MODE_PAYOUT."</div></a>";
                } // END - if
 
                // Is the withdraw mode active?
-               if ($_CONFIG['wernis_withdraw_active'] == "Y") {
+               if (getConfig('wernis_withdraw_active') == "Y") {
                        // Add link
                        $content['withdraw_link'] = "<a class=\"menu_blur\" style=\"height: 40px\" href=\"".URL."/modules.php?module=login&amp;what=wernis&amp;mode=withdraw\"><div style=\"padding-top: 10px\">".MEMBER_WERNIS_MODE_WITHDRAW."</div></a>";
                } // 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("<br />");
                                } 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("<br />");
                                } elseif ($_POST['amount'] > $points) {
                                        // Not enougth points left!
index 3b98a3e872579adcd05985e703c7e5ed2571db08..0b3a5a4f7df1c6d9eb930abb1b00857acc1146f5 100644 (file)
@@ -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]),
index 5ef7faa807b5b87fbc6e2a9de4628abf03e62cb2..c402de5dbd94d50ab0b6823a01634459cc643e91 100644 (file)
@@ -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 = "";
index ecc3c3ed927a22eb85bbba443bdc61f661ffe1eb..237c5917b6f979797ae962e3df1b2a9037f9500c 100644 (file)
@@ -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__)."<br />\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
 
index 1ac1f05ea0fc25136d7048d42bf51dee516daa34..c3440470b3012f9aac04df0c0304e131e3426247 100644 (file)
@@ -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)) {
index 1dcbdc51bafe27f4649dc34bbe1a20b11c922280..85107a4af8583d9d03709daff1e74fee750650ca 100644 (file)
@@ -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__);
index 6db6dd52f25ba66c9656ca0254a1e56485ed3c11..fe540b053b3cbbc1cd35d46c18e694587f13bbcb 100644 (file)
@@ -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 "<STRONG>".LANG_WARNING.":</STRONG> ".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
 
index 691aa63047e5e7c4a1d6cff98cb81b91895a1ef3..6abad5048fe15f1a1aa7984742be33837b174e95 100644 (file)
@@ -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."<STRONG><A class=\"you_are_here\" href=\"".URL."/modules.php?module=".$modCheck."&amp;".$type."=".$search.$LINK_ADD."\">".$ret."</A></STRONG>\n";
 
@@ -290,7 +290,7 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) {
                                $OUT .= "</div>\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__."(<font color=\"#0000aa\">".__LINE__."</font>):type={$type},action={$GLOBALS['action']},what={$GLOBALS['what']},lvl={$ACC_LVL}<br />\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 .= "</A>";
@@ -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']."=<br />";
        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("<meta name=\"description\" content=\"".$DESCR."\" />");
@@ -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
index 37de0712551f64179a8bd09864f89ab35121fb0c..e9be4551919aa110a7bdb968599dfeb78c941ebb 100644 (file)
@@ -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;
index 264b70857d246c8ba472541935121f778107621f..19e15b1531acd13e56e22f8a3a9bf1563e20c2ed 100644 (file)
@@ -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__."<br />";
                                                        break;
@@ -169,7 +169,7 @@ if ($cnt < $_CONFIG['max_send']) {
                                        //* DEBUG: */ echo "*MEDIA/L:".__LINE__."*<br />";
                                        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__);
index f3328a11603cd678a426be265ea07e6932f0e9ea..5b79d256dbe6d782eb0b0d5ebfc2763b22824eca 100644 (file)
@@ -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]."*<br />";
+                                       // 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]."*<br />";
                                        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;
index b2aa58ab288f733834b0a1bbf50b6c8f7e8eec0d..417ad61d3084f87314af7c00673aabc3f398ac1b 100644 (file)
@@ -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...
index 51b5b80d70240daa9ce56cc8e495868e6791a968..3fdf322e81a1793c8cacfec3f3bf021b510d7fdc 100644 (file)
@@ -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__)."<br />\n";
 
 // Reset accounts
index 6c82e94e9398140edaecce6fd55560598df1ccdd..3048ee52420f106722c01ad6538c627713ac992b 100644 (file)
@@ -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__)."<br />\n";
 
 // Check for holidays we need to enable and send email to user
index 2d216c6dac22fd35d33b626d31c2fdbbd0cc33ff..98d5c5600a2cf2578e343221ed1a541f1ea2cc08 100644 (file)
@@ -44,8 +44,8 @@ if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\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;
 
 //
index 0d6e41266ec229770a9857637c76b8e1224f97f5..62afb533184e2fb927b0dafff7d5ad1183906d1c 100644 (file)
@@ -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'));
 
 //
 ?>
index 46dd7e3913f8339919befcbe03e89bc6542f9e49..89f370509a5f096617172ac9b74247dd037bd69f 100644 (file)
@@ -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
index 90956ac9cdb52d7d5fd616db4ad31e425b120466..77ad76ae39ee123a48e632e5f5d70df224c18529 100644 (file)
@@ -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
index a8e5748a83fa29127d9805fc3daab90587863f85..7b83cda9532411964d94f4a7ac06f72fe8956d44 100644 (file)
@@ -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("<link rel=\"stylesheet\" type=\"text/css\" href=\"".URL."/theme/".GET_CURR_THEME()."/".$value."\" />");
                                        break;
index e0d16d72666fa569bbd400afacd600a94139bb13..9b98c0f1d381013fdffdb01abe0869d1131cd38a 100644 (file)
--- 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");
                }
index b1baa9f2f07978bfcef61f48de1f0107f02b2ed6..523d319c1969087c59416f97595aa4eb39b04a2b 100644 (file)
@@ -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&amp;msg=".$msg."&amp;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&amp;msg=".CODE_UNKNOWN_STATUS."&amp;ext=mailid");
                                break;
                }
index 8316455d88449f5a73e435be382b50db5b0629b9..344bed250c87cda81517f7b8dfea14e021c29cae 100644 (file)
@@ -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));
index 1788cf63b374c0c9f77ca146c116dd1c4f2a46d0..f8c1a88e383c282ba09f5e0b85ddaccd413db36b 100644 (file)
@@ -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 68003f01f8b5cfb76fec7112b21f04a6ed9a609c..ba76c41b6d5e4b589f08cbbcbdc32bd9ca00bfe6 100644 (file)
--- 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=";
index 8b81926921f028a66b44063ced92110740038de9..61e8ce264adacd49e9992bea202fd7b667fbc612 100644 (file)
@@ -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");
index 9cc8187bb4bda5eb9d2ef3c446fb1219b3103402..68b6d387077b37f7b493fc662cce3bd9027f64aa 100644 (file)
@@ -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
index 0a712c01bcd244ef639f319250f14122e5b83dc8..573896ee370f5a732682a454e04dd2a80c57b8d8 100644 (file)
                        &raquo;<em>$content[api_md5]</em>&laquo;
                </TD>
        </TR>
+       <TR>
+               <TD width="300" align="right">{--PRIMERA_ADMIN_REFID--}:</TD>
+               <TD class="seperator" width="10">&nbsp;</TD>
+               <TD width="270"><INPUT type="text" name="primera_refid"
+                       class="admin_normal" value="$content[refid]" size="10"
+                       maxlength="255" /></TD>
+       </TR>
+       <TR>
+               <TD colspan="3" class="seperator" height="5">&nbsp;</TD>
+       </TR>
        <TR>
                <TD colspan="3" class="seperator" height="5">&nbsp;</TD>
        </TR>
index a193384adbc88929b5c65e6d76b30ed9aa7495dd..b88c61ea505c0c3497eaddd2f38d0bb115e44140 100644 (file)
        </tr>
        <tr><td height="3" colspan="2" class="seperator bottom2">&nbsp;</td></tr>
        <tr><td height="3" colspan="2" class="seperator">&nbsp;</td></tr>
+       <tr>
+               <td height="30" align="right" style="padding-right:5px">
+                       {--ADMIN_CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK--}
+               </td>
+               <td align="center">
+                       <input type="radio" name="surfbar_notify_admin_unlock" value="Y"{!__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y!} />&nbsp;{--YES--}
+                       <input type="radio" name="surfbar_notify_admin_unlock" value="N"{!__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N!} />&nbsp;{--NO--}
+               </td>
+       </tr>
+       <tr><td height="3" colspan="2" class="seperator bottom2">&nbsp;</td></tr>
+       <tr><td height="3" colspan="2" class="seperator">&nbsp;</td></tr>
        <tr>
                <td height="30" align="right" style="padding-right:5px">
                        {--ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE--}
index 620638030f3c526d26bd047887eff2a9fb4a9024..816d978807894dcbcd1fe7261b838a6808a41674 100644 (file)
@@ -20,7 +20,7 @@
        <TR>
                <TD width="315" height="35" align="right">{--PRIMERA_MEMBER_NICKNAME--}</TD>
                <TD width="10" class="seperator">&nbsp;</TD>
-               <TD width="115"><INPUT type="text" name="primus_nickname" size="10" maxlength="255" value="$content[primus_nickname]" /></TD>
+               <TD width="115"><INPUT type="text" name="primera_nickname" size="10" maxlength="255" value="$content[primera_nickname]" /></TD>
        </TR>
        <TR>
                <TD width="315" height="35" align="right">{--PRIMERA_MEMBER_PASSWORD--}</TD>