A lot more wrapper functions introduced, TODOs.txt updated
authorRoland Häder <roland@mxchange.org>
Sun, 21 Nov 2010 15:25:55 +0000 (15:25 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 21 Nov 2010 15:25:55 +0000 (15:25 +0000)
13 files changed:
DOCS/TODOs.txt
beg.php
inc/extensions/ext-beg.php
inc/libs/beg_functions.php
inc/libs/bonus_functions.php
inc/libs/doubler_functions.php
inc/mails/beg_mails.php
inc/modules/admin/what-config_beg.php
inc/modules/admin/what-list_beg.php
inc/modules/guest/what-beg.php
inc/modules/member/what-beg.php
inc/monthly/monthly_beg.php
inc/wrapper-functions.php

index f513476b8ab77816d2a3166815944ebdeaeb87c6..fac1dfb62758c8333eb0306540e5a8fc767bcbea 100644 (file)
@@ -4,7 +4,7 @@
 ./beg.php:171:                 // @TODO Opps, what is missing here???
 ./birthday_confirm.php:93:             // @TODO Try to rewrite the following unset()
 ./inc/autopurge/purge-inact.php:55:    // @TODO Rewrite these if() blocks to a filter
 ./beg.php:171:                 // @TODO Opps, what is missing here???
 ./birthday_confirm.php:93:             // @TODO Try to rewrite the following unset()
 ./inc/autopurge/purge-inact.php:55:    // @TODO Rewrite these if() blocks to a filter
-./inc/cache/config-local.php:126:// @TODO Rewrite the following three constants, somehow...
+./inc/cache/config-local.php:124:// @TODO Rewrite the following three constants, somehow...
 ./inc/classes/cachesystem.class.php:499:       // @TODO Add support for more types which break in last else-block
 ./inc/config-functions.php:139:        // @TODO Make this all better... :-/
 ./inc/expression-functions.php:164:// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
 ./inc/classes/cachesystem.class.php:499:       // @TODO Add support for more types which break in last else-block
 ./inc/config-functions.php:139:        // @TODO Make this all better... :-/
 ./inc/expression-functions.php:164:// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
 ./inc/modules/admin/what-unlock_emails.php:84:                                 // @TODO Rewrite these if-blocks to a filter
 ./inc/modules/admin/what-usage.php:87: // @TODO This code is double, see loadTemplate() and loadEmailTemplate() in functions.php
 ./inc/modules/admin/what-usr_online.php:49:    // @TODO Add a filter for sponsor
 ./inc/modules/admin/what-unlock_emails.php:84:                                 // @TODO Rewrite these if-blocks to a filter
 ./inc/modules/admin/what-usage.php:87: // @TODO This code is double, see loadTemplate() and loadEmailTemplate() in functions.php
 ./inc/modules/admin/what-usr_online.php:49:    // @TODO Add a filter for sponsor
-./inc/modules/guest/what-beg.php:51:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
+./inc/modules/guest/what-beg.php:51:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getBegUseridTimeout()));
 ./inc/modules/guest/what-login.php:121:        // @TODO Move this HTML code into a template
 ./inc/modules/guest/what-mediadata.php:181:// @TODO Rewrite all these if-blocks to filters
 ./inc/modules/guest/what-mediadata.php:68:     // @TODO Find a better formular than this one
 ./inc/modules/guest/what-login.php:121:        // @TODO Move this HTML code into a template
 ./inc/modules/guest/what-mediadata.php:181:// @TODO Rewrite all these if-blocks to filters
 ./inc/modules/guest/what-mediadata.php:68:     // @TODO Find a better formular than this one
 ./inc/modules/guest/what-stats.php:100:                // @TODO This can be somehow rewritten
 ./inc/modules/guest/what-stats.php:74:// @TODO This can be rewritten in a dynamic include
 ./inc/modules/member/what-beg.php:54:// @TODO Can't this be moved into EL?
 ./inc/modules/guest/what-stats.php:100:                // @TODO This can be somehow rewritten
 ./inc/modules/guest/what-stats.php:74:// @TODO This can be rewritten in a dynamic include
 ./inc/modules/member/what-beg.php:54:// @TODO Can't this be moved into EL?
-./inc/modules/member/what-beg.php:63:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
+./inc/modules/member/what-beg.php:63:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getBegUseridTimeout()));
 ./inc/modules/member/what-bonus.php:55:        // @TODO Rewrite this to a filter
 ./inc/modules/member/what-categories.php:131:          // @TODO Rewrite this to use $OUT .= ...
 ./inc/modules/member/what-order.php:426:                       // @TODO Rewrite this to a filter
 ./inc/modules/member/what-bonus.php:55:        // @TODO Rewrite this to a filter
 ./inc/modules/member/what-categories.php:131:          // @TODO Rewrite this to use $OUT .= ...
 ./inc/modules/member/what-order.php:426:                       // @TODO Rewrite this to a filter
diff --git a/beg.php b/beg.php
index 387c9e6accc6915b216beaceaa66e9835433c3ea..5a290e3baaa0ebcc1c1e1e721fe2cacb3ec11354 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -88,7 +88,7 @@ if (isGetRequestParameterSet('userid')) {
                 * 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! ;-)
                 */
                 * 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((getConfig('beg_points') * 100000), (getConfig('beg_points_max') * 100000)) / 100000;
+               $points = mt_rand((getBegPoints() * 100000), (getBegPointsMax() * 100000)) / 100000;
 
                // Set nickname / userid for template
                $content['userid'] = getRequestParameter('userid');
 
                // Set nickname / userid for template
                $content['userid'] = getRequestParameter('userid');
@@ -98,7 +98,7 @@ if (isGetRequestParameterSet('userid')) {
        } // END - if
 
        // User id valid and not webmaster's id?
        } // END - if
 
        // User id valid and not webmaster's id?
-       if ((isValidUserId(getUserData('userid'))) && (getConfig('beg_userid') != getUserData('userid'))) {
+       if ((isValidUserId(getUserData('userid'))) && (getBegUserid() != getUserData('userid'))) {
                // Update counter
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_clicks`=`beg_clicks`+1 WHERE `userid`=%s LIMIT 1",
                        array(getUserData('userid')), __FILE__, __LINE__);
                // Update counter
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_clicks`=`beg_clicks`+1 WHERE `userid`=%s LIMIT 1",
                        array(getUserData('userid')), __FILE__, __LINE__);
@@ -108,7 +108,7 @@ if (isGetRequestParameterSet('userid')) {
                        array(getUserData('userid'), detectRemoteAddr(), session_id()), __FILE__, __LINE__);
 
                // Entry not found, points set and not logged in?
                        array(getUserData('userid'), detectRemoteAddr(), session_id()), __FILE__, __LINE__);
 
                // Entry not found, points set and not logged in?
-               if (((SQL_HASZERONUMS($result)) || (isAdmin())) && ($points > 0) && (!isMember()) && (getConfig('beg_pay_mode') == 'NONE')) {
+               if (((SQL_HASZERONUMS($result)) || (isAdmin())) && ($points > 0) && (!isMember()) && (getBegPayMode() == 'NONE')) {
                        // Admin is testing?
                        if (!isAdmin()) {
                                /*
                        // Admin is testing?
                        if (!isAdmin()) {
                                /*
@@ -147,9 +147,9 @@ if (isGetRequestParameterSet('userid')) {
                } elseif (isMember()) {
                        // Logged in user found!
                        $content['message'] = loadTemplate('beg_login', true, $content);
                } elseif (isMember()) {
                        // Logged in user found!
                        $content['message'] = loadTemplate('beg_login', true, $content);
-               } elseif (getConfig('beg_pay_mode') != 'NONE') { // Other pay-mode active!
+               } elseif (getBegPayMode() != 'NONE') { // Other pay-mode active!
                        // Load message template depending on pay-mode
                        // Load message template depending on pay-mode
-                       $content['message'] = loadTemplate('beg_pay_mode_'.strtolower(getConfig('beg_pay_mode')), true, $content);
+                       $content['message'] = loadTemplate('beg_pay_mode_'.strtolower(getBegPayMode()), true, $content);
                        $pay = true;
                } else {
                        // Clicked received while reload lock is active
                        $pay = true;
                } else {
                        // Clicked received while reload lock is active
@@ -166,14 +166,14 @@ if (isGetRequestParameterSet('userid')) {
                loadTemplate('beg_link', false, $content);
 
                // Tracker code enabled? (We don't track users here!
                loadTemplate('beg_link', false, $content);
 
                // Tracker code enabled? (We don't track users here!
-               if ((getConfig('beg_pay_mode') != 'NONE') && ($pay === true)) {
+               if ((getBegPayMode() != 'NONE') && ($pay === true)) {
                        // Prepare content for template
                        // @TODO Opps, what is missing here???
                        $content = array(
                        );
 
                        // Include config-depending template
                        // Prepare content for template
                        // @TODO Opps, what is missing here???
                        $content = array(
                        );
 
                        // Include config-depending template
-                       loadTemplate('beg_pay_code_'.strtolower(getConfig('beg_pay_mode')), false, $content);
+                       loadTemplate('beg_pay_code_'.strtolower(getBegPayMode()), false, $content);
                } elseif (($pay === false) && (!isset($content['message']))) {
                        // Cannot pay! :-(
                        $content['message'] = loadTemplate('beg_failed', true);
                } elseif (($pay === false) && (!isset($content['message']))) {
                        // Cannot pay! :-(
                        $content['message'] = loadTemplate('beg_failed', true);
@@ -193,7 +193,7 @@ if (isGetRequestParameterSet('userid')) {
                        // Invalid nickname! (404)
                        $errorCode = getCode('USER_404');
                }
                        // Invalid nickname! (404)
                        $errorCode = getCode('USER_404');
                }
-       } elseif (getUserData('userid') == getConfig('beg_userid')) {
+       } elseif (getUserData('userid') == getBegUserid()) {
                // Webmaster's id cannot beg for points!
                $errorCode = getCode('BEG_SAME_AS_OWN');
        }
                // Webmaster's id cannot beg for points!
                $errorCode = getCode('BEG_SAME_AS_OWN');
        }
index 73010788cb8afd59afdb7f8070412269ee385429..0cdad229a648960244c5c705881ee687742fbc21 100644 (file)
@@ -308,8 +308,8 @@ INDEX ( `userid` )
 
        case 'init': // When extension is initialized
                // Remove old entries
 
        case 'init': // When extension is initialized
                // Remove old entries
-               $OLD = getConfig('beg_timeout');
-               if (getConfig('beg_userid_timeout') > $OLD) $OLD = getConfig('beg_userid_timeout');
+               $OLD = getBegTimeout();
+               if (getBegUseridTimeout() > $OLD) $OLD = getBegUseridTimeout();
                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
                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
index 90e61bdc45bf6a84aee9ea7fe8e0dc912f055618..53acc3a45d3af5a1fe8e9a31db8eeb0d8194570b 100644 (file)
@@ -54,37 +54,41 @@ function addPointsBeg ($userid, $points) {
                // Add points to account
                // @TODO Try to rewrite the following unset()
                unset($GLOBALS['ref_level']);
                // Add points to account
                // @TODO Try to rewrite the following unset()
                unset($GLOBALS['ref_level']);
-               $added = addPointsThroughReferalSystem('beg', $userid, $points, false, 0, strtolower(getConfig('beg_mode')));
+               $added = addPointsThroughReferalSystem('beg', $userid, $points, false, 0, strtolower(getBegMode()));
        }
 
        // Subtract begged points from member account if the admin has selected one
        }
 
        // Subtract begged points from member account if the admin has selected one
-       if (getConfig('beg_userid') > 0) {
+       if (getBegUserid() > 0) {
                // Subtract from this account
                // Subtract from this account
-               subtractPoints('beg_payout', getConfig('beg_userid'), $points);
+               subtractPoints('beg_payout', getBegUserid(), $points);
        } // END - if
 
        // Return result
        return $added;
 }
 
        } // END - if
 
        // Return result
        return $added;
 }
 
-// Checks wether beg_rallye is enabled
-function isBegRallyeEnabled () {
+// ----------------------------------------------------------------------------
+//                       Wrapper functions for ext-beg
+// ----------------------------------------------------------------------------
+
+// "Getter" for beg_new_member_notify
+function getBegNewMemberNotify () {
        // Do we have cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
        // Do we have cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
-               // Determine it
-               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('beg', '0.2.8')) && (getConfig('beg_rallye') == 'Y'));
+               // Get it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_new_member_notify');
        } // END - if
 
        // Return cache
        return $GLOBALS[__FUNCTION__];
 }
 
        } // END - if
 
        // Return cache
        return $GLOBALS[__FUNCTION__];
 }
 
-// Checks wether beg_rallye is enabled
+// Checks wether beg_new_member_notify is enabled
 function isBegNewMemberNotifyEnabled () {
        // Do we have cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
 function isBegNewMemberNotifyEnabled () {
        // Do we have cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('beg', '0.2.7')) && (getConfig('beg_new_member_notify') == 'Y'));
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('beg', '0.2.7')) && (getBegNewMemberNotify() == 'Y'));
        } // END - if
 
        // Return cache
        } // END - if
 
        // Return cache
@@ -103,5 +107,245 @@ function getBegUserid () {
        return $GLOBALS[__FUNCTION__];
 }
 
        return $GLOBALS[__FUNCTION__];
 }
 
+// "Getter" for beg_timeout
+function getBegTimeout () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_timeout');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_userid_timeout
+function getBegUseridTimeout () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_userid_timeout');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_ip_timeout
+function getBegIpTimeout () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_ip_timeout');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_ranks
+function getBegRanks () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_ranks');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_points_max
+function getBegPointsMax () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_points_max');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_points
+function getBegPoints () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_points');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_notify_bonus
+function getBegNotifyBonus () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_notify_bonus');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_notify_wait
+function getBegNotifyWait () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_notify_wait');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_pay_mode
+function getBegPayMode () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_pay_mode');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_mode
+function getBegMode () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_mode');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_include_own
+function getBegIncludeOwn () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_include_own');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether beg_include_own is "Y"
+function isBegIncludeOwnEnabled () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = (getBegIncludeOwn() == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_active
+function getBegActive () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_active');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether beg_active is "Y"
+function isBegActiveEnabled () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = (getBegActive() == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_rallye
+function getBegRallye () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_rallye');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether beg_rallye is "Y"
+function isBegRallyeEnabled () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = (getBegRallye() == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_rallye_enable_notify
+function getBegRallyeEnableNotify () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_rallye_enable_notify');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether beg_rallye_enable_notify is "Y"
+function isBegRallyeEnableNotifyEnabled () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = (getBegRallyeEnableNotify() == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_rallye_disable_notify
+function getBegRallyeDisableNotify () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('beg_rallye_disable_notify');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether beg_rallye_disable_notify is "Y"
+function isBegRallyeDisableNotifyEnabled () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = (getBegRallyeDisableNotify() == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>
 // [EOF]
 ?>
index 2b75d7b96af98ebc4b87f4cb787eff85f68db5c9..968002a3cdbad4dec09dadc437adae0b0858c5dc 100644 (file)
@@ -363,5 +363,17 @@ function getBonusMode () {
        return $GLOBALS[__FUNCTION__];
 }
 
        return $GLOBALS[__FUNCTION__];
 }
 
+// Getter for bonus_ranks
+function getBonusRanks () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('bonus_ranks');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>
 // [EOF]
 ?>
index 979f3fe800424f7a1f374383d05d300b47fc108c..e9df787f818f461fc47613529df111da2976fa53 100644 (file)
@@ -38,7 +38,7 @@
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-}
+} // END - if
 
 // Generates a HTML table based on given data
 // @TODO Lame description
 
 // Generates a HTML table based on given data
 // @TODO Lame description
@@ -148,6 +148,10 @@ function getDoublerTotalPointsLeft() {
        return $points;
 }
 
        return $points;
 }
 
+// ----------------------------------------------------------------------------
+//                      Wrapper functions for ext-doubler
+// ----------------------------------------------------------------------------
+
 // "Getter" for doubler_userid
 function getDoublerUserid () {
        // Is it cached?
 // "Getter" for doubler_userid
 function getDoublerUserid () {
        // Is it cached?
@@ -160,5 +164,101 @@ function getDoublerUserid () {
        return $GLOBALS['doubler_userid'];
 }
 
        return $GLOBALS['doubler_userid'];
 }
 
+// "Getter" for doubler_timeout
+function getDoublerTimeout () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('doubler_timeout');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for doubler_send_mode
+function getDoublerSendMode () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('doubler_send_mode');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for doubler_ref
+function getDoublerRef () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('doubler_ref');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for doubler_points
+function getDoublerPoints () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('doubler_points');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for doubler_min
+function getDoublerMin () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('doubler_min');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for doubler_max
+function getDoublerMax () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('doubler_max');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for doubler_counter
+function getDoublerCounter () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('doubler_counter');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for doubler_charge
+function getDoublerCharge () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('doubler_charge');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>
 // [EOF]
 ?>
index 5a26daa3791490793cd142b1faeaefb0ee87b21c..4fcb702cbd5a40119eb0128ac0543524abb04f66 100644 (file)
@@ -51,9 +51,9 @@ $sql = ''; $mode = '';
 
 // Shall I sent activation or deactivation mail?
 $sql = "SELECT `userid`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE (`beg_rallye_enable_notify` ";
 
 // Shall I sent activation or deactivation mail?
 $sql = "SELECT `userid`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE (`beg_rallye_enable_notify` ";
-switch (getConfig('beg_rallye')) {
+switch (getBegRallye()) {
        case 'Y': // Begging rallye is activated
        case 'Y': // Begging rallye is activated
-               if (getConfig('beg_rallye_enable_notify') == 'Y') {
+               if (isBegRallyeEnableNotifyEnabled()) {
                        // Okay, let's check for member accounts
                        $sql .= '= 0 OR (`beg_rallye_enable_notify` > 0 AND `beg_rallye_enable_notify` < `beg_rallye_disable_notify`)';
                        $mode = 'enable';
                        // Okay, let's check for member accounts
                        $sql .= '= 0 OR (`beg_rallye_enable_notify` > 0 AND `beg_rallye_enable_notify` < `beg_rallye_disable_notify`)';
                        $mode = 'enable';
@@ -64,7 +64,7 @@ switch (getConfig('beg_rallye')) {
                break;
 
        case 'N': // Begging rallye is deactivated
                break;
 
        case 'N': // Begging rallye is deactivated
-               if (getConfig('beg_rallye_disable_notify') == 'Y') {
+               if (isBegRallyeDisableNotifyEnabled()) {
                        // Okay, let's check for member accounts
                        $sql .= ' > 0 AND `beg_rallye_disable_notify` < `beg_rallye_enable_notify`';
                        $mode = 'disable';
                        // Okay, let's check for member accounts
                        $sql .= ' > 0 AND `beg_rallye_disable_notify` < `beg_rallye_enable_notify`';
                        $mode = 'disable';
@@ -82,7 +82,7 @@ if (!empty($sql)) {
        // No IP locking setuped by default
        $content['ip_locker'] = '{--BEG_NO_LIMITATION--}';
 
        // No IP locking setuped by default
        $content['ip_locker'] = '{--BEG_NO_LIMITATION--}';
 
-       if (getConfig('beg_ip_timeout') > 0) {
+       if (getBegIpTimeout() > 0) {
                // Create timemark
                $content['ip_locker'] = '{%config,createFancyTime=beg_ip_timeout%}';
        } // END - if
                // Create timemark
                $content['ip_locker'] = '{%config,createFancyTime=beg_ip_timeout%}';
        } // END - if
@@ -91,7 +91,7 @@ if (!empty($sql)) {
        $result_main = SQL_QUERY($sql, __FILE__, __LINE__);
        if (!SQL_HASZERONUMS($result_main)) {
                // Normal notification mails or bonus mails?
        $result_main = SQL_QUERY($sql, __FILE__, __LINE__);
        if (!SQL_HASZERONUMS($result_main)) {
                // Normal notification mails or bonus mails?
-               $sentBonusMails = ((getConfig('beg_notify_bonus') > 0) && ($mode == 'enable') && (isExtensionActive('bonus')));
+               $sentBonusMails = ((getBegNotifyBonus() > 0) && ($mode == 'enable') && (isExtensionActive('bonus')));
 
                // Load message body for bonus mails
                $message = loadEmailTemplate('beg_enable_notify_body', '', '{PER}userid{PER}');
 
                // Load message body for bonus mails
                $message = loadEmailTemplate('beg_enable_notify_body', '', '{PER}userid{PER}');
@@ -135,7 +135,7 @@ LIMIT 1",
                        $url = 'modules.php?module=index&amp;what=login';
 
                        // Insert mail
                        $url = 'modules.php?module=index&amp;what=login';
 
                        // Insert mail
-                       addBonusMailToQueue('{--BEG_RALLYE_' . strtoupper($mode) . '_SUBJECT--}', $message, $receiver, getConfig('beg_notify_bonus'), getConfig('beg_notify_wait'), $url, 0, 'normal', SQL_NUMROWS($result_main));
+                       addBonusMailToQueue('{--BEG_RALLYE_' . strtoupper($mode) . '_SUBJECT--}', $message, $receiver, getBegNotifyBonus(), getBegNotifyWait(), $url, 0, 'normal', SQL_NUMROWS($result_main));
                } // END - if
        } // END - if
 
                } // END - if
        } // END - if
 
index b84dffe05c69c9b75640232590c725d0fe5c1b8f..f5e6f9373aa4372b0313c260c7eb6dc4ff236e6a 100644 (file)
@@ -58,13 +58,13 @@ if (isFormSent()) {
        setConfigEntry('beg_rallye_disable_notify', postRequestParameter('beg_rallye_disable_notify'));
 } else {
        // Prepare constants for the template
        setConfigEntry('beg_rallye_disable_notify', postRequestParameter('beg_rallye_disable_notify'));
 } else {
        // Prepare constants for the template
-       $content['points']           = translateComma(getConfig('beg_points')      , false);
-       $content['points_max']       = translateComma(getConfig('beg_points_max')  , false);
-       $content['notify_bonus']     = translateComma(getConfig('beg_notify_bonus'), false);
-       $content['timeout']          = createTimeSelections(getConfig('beg_timeout')       , 'beg_timeout'       , 'Dhm');
-       $content['userid_timeout']   = createTimeSelections(getConfig('beg_userid_timeout'), 'beg_userid_timeout', 'Dhm');
-       $content['ip_timeout']       = createTimeSelections(getConfig('beg_ip_timeout')    , 'beg_ip_timeout'    , 'Dhm');
-       $content['wait_selection']   = createTimeSelections(getConfig('beg_notify_wait')   , 'beg_notify_wait'   , 'ms' );
+       $content['points']           = translateComma(getBegPoints()             , false);
+       $content['points_max']       = translateComma(getBegPointsMax()          , false);
+       $content['notify_bonus']     = translateComma(getBegNotifyBonus()        , false);
+       $content['timeout']          = createTimeSelections(getBegTimeout()      , 'beg_timeout'       , 'Dhm');
+       $content['userid_timeout']   = createTimeSelections(getBegUseridTimeout(), 'beg_userid_timeout', 'Dhm');
+       $content['ip_timeout']       = createTimeSelections(getBegIpTimeout()    , 'beg_ip_timeout'    , 'Dhm');
+       $content['wait_selection']   = createTimeSelections(getBegNotifyWait()   , 'beg_notify_wait'   , 'ms' );
 
        // Init all Y/N selections
        foreach (array('rallye', 'active', 'mode', 'rallye_enable_notify', 'rallye_disable_notify', 'new_member_notify', 'include_own') as $entry) {
 
        // Init all Y/N selections
        foreach (array('rallye', 'active', 'mode', 'rallye_enable_notify', 'rallye_disable_notify', 'new_member_notify', 'include_own') as $entry) {
@@ -79,7 +79,7 @@ if (isFormSent()) {
        } // END - foreach
 
        // Set default faker-mode
        } // END - foreach
 
        // Set default faker-mode
-       $content['pay_mode_' . strtolower(getConfig('beg_pay_mode'))] = ' selected="selected"';
+       $content['pay_mode_' . strtolower(getBegPayMode())] = ' selected="selected"';
 
        // Init beg_mode elements
        foreach (array('direct', 'ref') as $entry) {
 
        // Init beg_mode elements
        foreach (array('direct', 'ref') as $entry) {
@@ -87,10 +87,10 @@ if (isFormSent()) {
        } // END - foreach
 
        // Set default mode
        } // END - foreach
 
        // Set default mode
-       $content['beg_mode_' . strtolower(getConfig('beg_mode'))] = ' checked="checked"';
+       $content['beg_mode_' . strtolower(getBegMode())] = ' checked="checked"';
 
        // Member selection box
 
        // Member selection box
-       $content['form_selection'] = addMemberSelectionBox(getConfig('beg_userid'), false, true, true, 'beg_userid');
+       $content['form_selection'] = addMemberSelectionBox(getBegUserid(), false, true, true, 'beg_userid');
 
        // Load form template
        loadTemplate('admin_config_beg', false, $content);
 
        // Load form template
        loadTemplate('admin_config_beg', false, $content);
index ddc8e7f2ddf7f928a6fcc87e171b2852017ed748..deed93b238e0e17827c79d661468345fd71df32f 100644 (file)
@@ -81,7 +81,7 @@ ORDER BY
                        $WIN1 = ''; $WIN2 = '';
 
                        // Maybe he can win his active beg?
                        $WIN1 = ''; $WIN2 = '';
 
                        // Maybe he can win his active beg?
-                       if ($count <= getConfig('beg_ranks')) {
+                       if ($count <= getBegRanks()) {
                                // Mark him
                                $WIN1 = '<strong>';
                                $WIN2 = '</strong>';
                                // Mark him
                                $WIN1 = '<strong>';
                                $WIN2 = '</strong>';
index 049c2ee0c1a3784fd45a723448928ab3ca528a3f..f5754cac36389b0bf4a218087827548ced77e05d 100644 (file)
@@ -48,7 +48,7 @@ if ((!isExtensionActive('beg')) && (!isAdmin())) {
        return;
 } // END - if
 
        return;
 } // END - if
 
-// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
+// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getBegUseridTimeout()));
 
 // Load final template
 loadTemplate('guest_beg');
 
 // Load final template
 loadTemplate('guest_beg');
index e1ea17ffb805b7bdbbee8710bbdc5d98ed06ecc7..b8ea918348dce3c8d27b7ebd9b3ec91bbbfe858a 100644 (file)
@@ -60,7 +60,7 @@ if ((isExtensionActive('nickname')) && (getUserData('nickname') != '')) {
        $content['userid'] = getMemberId();
 }
 
        $content['userid'] = getMemberId();
 }
 
-// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
+// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getBegUseridTimeout()));
 
 // Load template
 loadTemplate('member_beg', false, $content);
 
 // Load template
 loadTemplate('member_beg', false, $content);
index 34fa872965644e9aa84473d3e078cc6a74b28ff6..7a9c3ad3cb558678b9142dd99efa0c7290cdb5d6 100644 (file)
@@ -50,12 +50,12 @@ if (!defined('__SECURITY')) {
 //* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Monthly reset started.');
 
 // Check if month is done
 //* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Monthly reset started.');
 
 // Check if month is done
-if ((getConfig('beg_ranks') > 0) && (!isCssOutputMode())) {
+if ((getBegRanks() > 0) && (!isCssOutputMode())) {
        // Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
        $whereStatement1 = '';
 
        // Shall we exclude webmaster's own userid?
        // Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
        $whereStatement1 = '';
 
        // Shall we exclude webmaster's own userid?
-       if ((getConfig('beg_include_own') != 'Y') && (isValidUserId(getConfig('beg_userid')))) {
+       if ((!isBegIncludeOwnEnabled()) && (isValidUserId(getBegUserid()))) {
                // Exclude it
                $whereStatement1 = " AND `userid` != {?beg_userid?}";
        } // END - if
                // Exclude it
                $whereStatement1 = " AND `userid` != {?beg_userid?}";
        } // END - if
@@ -63,7 +63,7 @@ if ((getConfig('beg_ranks') > 0) && (!isCssOutputMode())) {
        // Let's check if there are some points left we can pay...
        if (isExtensionActive('autopurge')) {
                // Use last online stamp only when autopurge for inactive members is activated
        // Let's check if there are some points left we can pay...
        if (isExtensionActive('autopurge')) {
                // Use last online stamp only when autopurge for inactive members is activated
-               if ((getApInactiveSince() > 0) && (getConfig('beg_active') == 'Y')) {
+               if ((getApInactiveSince() > 0) && (isBegActiveEnabled()) {
                        // Okay, include last online timestamp
                        $whereStatement1 .= " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
                } // END - if
                        // Okay, include last online timestamp
                        $whereStatement1 .= " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
                } // END - if
index 4c3e4a8c0e835c630b338c1dc3677e731c6ae04a..6a9fd6a6522a71b21ec1618dc79a9fe3a701b663 100644 (file)
@@ -1946,6 +1946,18 @@ function getLastMonth () {
        return $GLOBALS[__FUNCTION__];
 }
 
        return $GLOBALS[__FUNCTION__];
 }
 
+// "Getter" for __DB_NAME
+function getDbName () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('__DB_NAME');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // Checks wether proxy configuration is used
 function isProxyUsed () {
        // Do we have cache?
 // Checks wether proxy configuration is used
 function isProxyUsed () {
        // Do we have cache?