]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/surfbar_functions.php
Fixed handling of float values, ext-surfbar continued:
[mailer.git] / inc / libs / surfbar_functions.php
index 7a0760d4054ddd3356f56e9062b429571151fbf5..bb28ecf980da534d94b3002a4df43f14cc13660f 100644 (file)
@@ -859,7 +859,7 @@ function translateMemberSurfbarActionToSubmit ($action) {
 // Determine reward
 function determineSurfbarReward ($onlyMin = FALSE) {
        // Static values are default
-       $reward = getConfig('surfbar_static_reward');
+       $reward = getSurfbarStaticReward();
 
        // Is there static or dynamic?
        if (getSurfbarPaymentModel() == 'DYNAMIC') {
@@ -1933,6 +1933,102 @@ function getSurfbarStatsReload () {
        return $GLOBALS[__FUNCTION__];
 }
 
+// "Getter" for surfbar_restart_time
+function getSurfbarRestartTime () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('surfbar_restart_time');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for surfbar_auto_start
+function getSurfbarAutoStart () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('surfbar_auto_start');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks whether auto-start is enabled
+function isSurfbarAutoStartEnabled () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = (getSurfbarAutoStart() == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for surfbar_daily_counter
+function getSurfbarDailyCounter () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('surfbar_daily_counter');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for surfbar_yester_counter
+function getSurfbarYesterCounter () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('surfbar_yester_counter');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for surfbar_weekly_counter
+function getSurfbarWeeklyCounter () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('surfbar_weekly_counter');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for surfbar_monthly_counter
+function getSurfbarMonthlyCounter () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('surfbar_monthly_counter');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for surfbar_total_counter
+function getSurfbarTotalCounter () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('surfbar_total_counter');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 //------------------------------------------------------------------------------
 //                             Template helper functions
 //------------------------------------------------------------------------------
@@ -2013,22 +2109,18 @@ function initSurfbar () {
 
 // Private getter for data elements
 function getSurfbarData ($element) {
+       // Debug message
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ' - ENTERED!');
 
        // Default is null
        $data = NULL;
 
        // Is the entry there?
-       if (!isset($GLOBALS['surfbar_cache'][$element])) {
-               print('surfbar_cache=<pre>');
-               print_r($GLOBALS['surfbar_cache']);
-               print('</pre>');
-               reportBug(__FUNCTION__, __LINE__, 'Element ' . $element . ' not found.');
+       if (isset($GLOBALS['surfbar_cache'][$element])) {
+               // Then take it
+               $data = $GLOBALS['surfbar_cache'][$element];
        } // END - if
 
-       // Then take it
-       $data = $GLOBALS['surfbar_cache'][$element];
-
        // Return result
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element[' . $element . ']=[' . gettype($data) . ']' . $data . ' - EXIT!');
        return $data;