]> git.mxchange.org Git - mailer.git/commitdiff
Added more missing wrappers
authorRoland Häder <roland@mxchange.org>
Sat, 1 Dec 2012 12:28:05 +0000 (12:28 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 1 Dec 2012 12:28:05 +0000 (12:28 +0000)
inc/filter/bonus_filter.php
inc/libs/bonus_functions.php
inc/libs/mediadata_functions.php
inc/libs/task_functions.php
inc/libs/user_functions.php
inc/modules/admin/what-config_bonus.php
inc/modules/guest/what-mediadata.php
inc/mysql-manager.php
inc/wrapper-functions.php

index 0403890eaec5f6756231430ca346a3a97efd3d33..d3ef5f112d0f00225b1f6370a0c0037dc7f537f2 100644 (file)
@@ -51,7 +51,7 @@ function FILTER_ADD_LOGIN_BONUS ($filterData) {
 
        // Bonus is not given by default ;-)
        $bonus = FALSE;
 
        // Bonus is not given by default ;-)
        $bonus = FALSE;
-       if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (isBonusRallyeActive()) && (getConfig('include_bonus_login') == 'Y')) {
+       if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (isBonusRallyeActive()) && (getIncludeBonusLogin() == 'Y')) {
                // Update last login if far enougth away
                // @TODO This query isn't right, it will only update if the user was for a longer time away!
                SQL_QUERY_ESC('UPDATE
                // Update last login if far enougth away
                // @TODO This query isn't right, it will only update if the user was for a longer time away!
                SQL_QUERY_ESC('UPDATE
@@ -110,11 +110,11 @@ function FILTER_ADD_BONUS_POINTS_USER_COLUMNS ($add = '') {
        } // END - if
 
        // Add more columns only when the corresponding configuration is enabled, too
        } // END - if
 
        // Add more columns only when the corresponding configuration is enabled, too
-       if (getConfig('include_bonus_click') == 'Y') $add .= ' + `turbo_bonus`';
-       if (getConfig('include_bonus_login') == 'Y') $add .= ' + `login_bonus`';
-       if (getConfig('include_bonus_order') == 'Y') $add .= ' + `bonus_order`';
-       if (getConfig('include_bonus_stats') == 'Y') $add .= ' + `bonus_stats`';
-       if (getConfig('include_bonus_ref')   == 'Y') $add .= ' + `bonus_ref`';
+       if (getIncludeBonusClick() == 'Y') $add .= ' + `turbo_bonus`';
+       if (getIncludeBonusLogin() == 'Y') $add .= ' + `login_bonus`';
+       if (getIncludeBonusOrder() == 'Y') $add .= ' + `bonus_order`';
+       if (getIncludeBonusRef()   == 'Y') $add .= ' + `bonus_ref`';
+       if (getIncludeBonusStats() == 'Y') $add .= ' + `bonus_stats`';
 
        // Return $add
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
 
        // Return $add
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
index 3bed18ebe680f18f27a4c88b04a90d1a76062adc..7b3e26ddd3fd93455c816111713f6ae67959116d 100644 (file)
@@ -79,7 +79,7 @@ function addTurboBonus ($mid, $userid, $type) {
        // Which rank?
        if ($rank == 1) {
                // First rank!
        // Which rank?
        if ($rank == 1) {
                // First rank!
-               $points = getConfig('turbo_bonus');
+               $points = getTurboBonus();
        } else {
                // Anything else so let's explode all entered rank points
                $test = explode(';', getTurboRates());
        } else {
                // Anything else so let's explode all entered rank points
                $test = explode(';', getTurboRates());
@@ -222,7 +222,7 @@ function handleBonusPoints ($mode, $userid) {
 
        if ($mode == 'login_bonus') {
                // Login bonus detected
 
        if ($mode == 'login_bonus') {
                // Login bonus detected
-               $points = getConfig('login_bonus');
+               $points = getLoginBonus();
        } else {
                // Direct points supplied
                $points = $mode;
        } else {
                // Direct points supplied
                $points = $mode;
@@ -376,6 +376,18 @@ function getLoginBonus () {
        return $GLOBALS[__FUNCTION__];
 }
 
        return $GLOBALS[__FUNCTION__];
 }
 
+// Getter for turbo_bonus
+function getTurboBonus () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('turbo_bonus');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // Getter for bonus_ref
 function getBonusRef () {
        // Is there cache?
 // Getter for bonus_ref
 function getBonusRef () {
        // Is there cache?
@@ -508,5 +520,65 @@ function getBonusEnableNotify () {
        return $GLOBALS[__FUNCTION__];
 }
 
        return $GLOBALS[__FUNCTION__];
 }
 
+// Getter for include_bonus_click
+function getIncludeBonusClick () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('include_bonus_click');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for include_bonus_login
+function getIncludeBonusLogin () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('include_bonus_login');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for include_bonus_order
+function getIncludeBonusOrder () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('include_bonus_order');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for include_bonus_Ref
+function getIncludeBonusRef () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('include_bonus_ref');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for include_bonus_stats
+function getIncludeBonusStats () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('include_bonus_stats');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>
 // [EOF]
 ?>
index c1240a8171327744f2d2ed2adc9626b16d0e605e..55ff7d7fbb309e538a29116c072501129a6c0fd4 100644 (file)
@@ -117,5 +117,33 @@ function getMediadataEntry ($key) {
        return $value;
 }
 
        return $value;
 }
 
+// ----------------------------------------------------------------------------
+//                 Wrapper functions for configuration entries
+// ----------------------------------------------------------------------------
+
+// Getter for 'mt_start'
+function getMtStart () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = getConfig('mt_start');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'mt_stage'
+function getMtStage () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = getConfig('mt_stage');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>
 // [EOF]
 ?>
index b1243ce216ca3653d9701a2ff569eb9b8cb68832..b905d249c32f76e35eb717ee922247c5d9a16a8b 100644 (file)
@@ -333,7 +333,7 @@ ORDER BY
                $add = runFilterChain('add_bonus_points_user_columns', '');
 
                // Active rallye, so add more point columns, if not empty
                $add = runFilterChain('add_bonus_points_user_columns', '');
 
                // Active rallye, so add more point columns, if not empty
-               $pointsColumns = '`turbo_bonus`';
+               $pointsColumns = '';
                if (!empty($add)) {
                        $pointsColumns = '(0' . $add . ')';
                } // END - if
                if (!empty($add)) {
                        $pointsColumns = '(0' . $add . ')';
                } // END - if
index 255ad5ce4c0b24c5ff9f2c690ce4563c10a1896b..41c52078e24b3e0dab20157c338c81b2bd6b0a9c 100644 (file)
@@ -1205,5 +1205,17 @@ function getApSubidsSince () {
        return $GLOBALS[__FUNCTION__];
 }
 
        return $GLOBALS[__FUNCTION__];
 }
 
+// Getter for 'select_user_zero_refid' config entry
+function getSelectUserZeroRefid () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('select_user_zero_refid');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>
 // [EOF]
 ?>
index 048e7b61966d78af33d14a22d259ca8d5b5cffd0..fdbcd3cc1213c1ee84d08caf03bc6fe8f3f8a189 100644 (file)
@@ -63,7 +63,7 @@ if (isFormSent('save_config')) {
 
        // Automatically calculate bonus points for ranks 2 and 3 when not set
        if (!isPostRequestElementSet('turbo_rates')) {
 
        // Automatically calculate bonus points for ranks 2 and 3 when not set
        if (!isPostRequestElementSet('turbo_rates')) {
-               setPostRequestElement('turbo_rates', ''.round(getConfig('turbo_bonus') / 2).';'.round(getConfig('turbo_bonus') / 4).'');
+               setPostRequestElement('turbo_rates', ''.round(getTurboBonus() / 2).';'.round(getTurboBonus() / 4).'');
        } // END - if
 
        // Save data
        } // END - if
 
        // Save data
@@ -81,7 +81,7 @@ if (isFormSent('save_config')) {
        $RANKS = explode(';', getTurboRates());
 
        // Automatically calculate bonus points for ranks 2 and 3 when not set
        $RANKS = explode(';', getTurboRates());
 
        // Automatically calculate bonus points for ranks 2 and 3 when not set
-       if (getTurboRates() == '') $RANKS = array(round(getConfig('turbo_bonus') / 2), round(getConfig('turbo_bonus') / 4));
+       if (getTurboRates() == '') $RANKS = array(round(getTurboBonus() / 2), round(getTurboBonus() / 4));
 
        // Generate list
        $OUT = '<ol start="2">';
 
        // Generate list
        $OUT = '<ol start="2">';
index 3262dfe6c74faadfd284a76765cb1f2b3f3e3426..df1d0e8d7505c14f5458ed77caf489fb987471a1 100644 (file)
@@ -65,7 +65,7 @@ $content['mt_start'] = generateDateTime(getMtStart(), '3');
 $PROJECTED = '0';
 if ($content['user_count'] > 0) {
        // @TODO Find a better formular than this one
 $PROJECTED = '0';
 if ($content['user_count'] > 0) {
        // @TODO Find a better formular than this one
-       $PROJECTED = round((time() - getMtStart()) / $content['user_count'] * getConfig('mt_stage') + getMtStart());
+       $PROJECTED = round((time() - getMtStart()) / $content['user_count'] * getMtStage() + getMtStart());
 } // END - if
 
 // Generate timestamp
 } // END - if
 
 // Generate timestamp
index b22cde7b393c6d0727c967cd6c3c4ad5bf3535a0..737d06a99db3c64a1bdf0d67ab9c28a01c99d5e7 100644 (file)
@@ -1055,7 +1055,7 @@ function countSumTotalData ($search, $tableName, $lookFor = 'id', $whereStatemen
        if ((empty($data['res'])) && ($lookFor != 'counter') && ($lookFor != 'id') && ($lookFor != 'userid') && ($lookFor != 'rallye_id')) {
                // Float number
                $data['res'] = '0.00000';
        if ((empty($data['res'])) && ($lookFor != 'counter') && ($lookFor != 'id') && ($lookFor != 'userid') && ($lookFor != 'rallye_id')) {
                // Float number
                $data['res'] = '0.00000';
-       } elseif (''.$data['res'].'' == '') {
+       } elseif ('' . $data['res'] . '' == '') {
                // Fix empty result
                $data['res'] = '0';
        }
                // Fix empty result
                $data['res'] = '0';
        }
index 3d3e6ebc9b75a32ca44ad96b1942437da8018146..f2fc6b72bea4ed087042d4857497f3c041ad7e18 100644 (file)
@@ -1351,7 +1351,7 @@ function getDateTimeFromRepository () {
 function getYear ($timestamp = NULL) {
        // Is it cached?
        if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
 function getYear ($timestamp = NULL) {
        // Is it cached?
        if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
-               // null is time()
+               // If NULL is set, use time()
                if (is_null($timestamp)) {
                        $timestamp = time();
                } // END - if
                if (is_null($timestamp)) {
                        $timestamp = time();
                } // END - if
@@ -1368,7 +1368,7 @@ function getYear ($timestamp = NULL) {
 function getMonth ($timestamp = NULL) {
        // Is it cached?
        if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
 function getMonth ($timestamp = NULL) {
        // Is it cached?
        if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
-               // If null is set, use time()
+               // If NULL is set, use time()
                if (is_null($timestamp)) {
                        // Use time() which is current timestamp
                        $timestamp = time();
                if (is_null($timestamp)) {
                        // Use time() which is current timestamp
                        $timestamp = time();
@@ -1604,7 +1604,7 @@ function isRandomReferralIdEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('user', '0.3.4')) && (getConfig('select_user_zero_refid') == 'Y'));
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('user', '0.3.4')) && (getSelectUserZeroRefid() == 'Y'));
        } // END - if
 
        // Return cache
        } // END - if
 
        // Return cache
@@ -2663,18 +2663,6 @@ function isExtensionTask ($content) {
        return $GLOBALS[__FUNCTION__][$content['task_type'] . '_' . $content['infos']];
 }
 
        return $GLOBALS[__FUNCTION__][$content['task_type'] . '_' . $content['infos']];
 }
 
-// Getter for 'mt_start'
-function getMtStart () {
-       // Is the cache entry set?
-       if (!isset($GLOBALS[__FUNCTION__])) {
-               // No, so determine it
-               $GLOBALS[__FUNCTION__] = getConfig('mt_start');
-       } // END - if
-
-       // Return cached entry
-       return $GLOBALS[__FUNCTION__];
-}
-
 // Checks whether ALLOW_TESTER_ACCOUNTS is set
 function ifTesterAccountsAllowed () {
        // Is the cache entry set?
 // Checks whether ALLOW_TESTER_ACCOUNTS is set
 function ifTesterAccountsAllowed () {
        // Is the cache entry set?