]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/bonus_functions.php
Opps ...
[mailer.git] / inc / libs / bonus_functions.php
index 7236987cad24dd561544159c2843e86fade70b03..57d2dc975e1f4e4fa25b72b06fd3d4b9240101ac 100644 (file)
@@ -17,7 +17,7 @@
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * For more information visit: http://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 *
@@ -82,7 +82,7 @@ function addTurboBonus ($mid, $userid, $type) {
                $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];
@@ -123,7 +123,7 @@ function addBonusRanks ($data, $type, $userid) {
        $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",
@@ -194,7 +194,7 @@ LIMIT 1",
                // @TODO Move this HTML to a template
                $OUT = '<tr>
   <td colspan="3" align="center" height="30" class="bottom">
-    <div class="notice">{%message,MEMBER_BONUS_NO_RANKS=' . $data . '%}</div>
+    <div class="bad">{%message,MEMBER_BONUS_NO_RANKS=' . $data . '%}</div>
   </td>
 </tr>';
        }
@@ -339,5 +339,17 @@ function getBonusRanks () {
        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]
 ?>