$points = getConfig('turbo_bonus');
} else {
// Anything else so let's explode all entered rank points
- $test = explode(';', getConfig('turbo_rates'));
+ $test = explode(';', getTurboRates());
if (!empty($test[$rank - 2])) {
// Level found
$points = $test[$rank - 2];
$GLOBALS['ranking_content']['rankings'] = '';
// How many ranks do we have?
- $ranks = count(explode(';', getConfig('turbo_rates'))) + 1;
+ $ranks = count(explode(';', getTurboRates())) + 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",
return $GLOBALS[__FUNCTION__];
}
+// Getter for turbo_rates
+function getTurboRates () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('turbo_rates');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// [EOF]
?>
$content['bonus_userid'] = addMemberSelectionBox(getBonusUserid(), false, true, true, 'bonus_userid');
// Initialize array for the points list
- $RANKS = explode(';', getConfig('turbo_rates'));
+ $RANKS = explode(';', getTurboRates());
// Automatically calculate bonus points for ranks 2 and 3 when not set
- if (getConfig('turbo_rates') == '') $RANKS = array(round(getConfig('turbo_bonus') / 2), round(getConfig('turbo_bonus') / 4));
+ if (getTurboRates() == '') $RANKS = array(round(getConfig('turbo_bonus') / 2), round(getConfig('turbo_bonus') / 4));
// Generate list
$OUT = '<ol start="2">';