]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/doubler_functions.php
Added more config wrappers
[mailer.git] / inc / libs / doubler_functions.php
index 154c2afe982be6a58ac397b33b931e1935339f11..6ca451b69a3fe7d4e567e502d5edf9ba693bb061 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -68,7 +68,10 @@ function generateDoublerTable ($userid = NULL, $done = 'N', $ref = 'N', $sort =
 
        // List entries
        $result = SQL_QUERY_ESC("SELECT
-       `userid`,`refid`,`points`,`timemark`
+       `userid`,
+       `refid`,
+       `points`,
+       `timemark`
 FROM
        `{?_MYSQL_PREFIX?}_doubler`
 WHERE
@@ -105,7 +108,7 @@ LIMIT %s",
                        $content['timemark'] = generateDateTime($content['timemark'], $DT_MODE);
 
                        // Load template and switch color
-                       $OUT .= loadTemplate($mode . '_doubler_list_rows', true, $content);
+                       $OUT .= loadTemplate($mode . '_doubler_list_rows', TRUE, $content);
                } // END - while
 
                // Free memory
@@ -114,13 +117,13 @@ LIMIT %s",
                // List no entries
                $OUT = '<tr>
   <td colspan="' . $COLS . '" align="center" class="bottom">
-    ' . displayMessage($message, true) . '
+    ' . displayMessage($message, TRUE) . '
   </td>
 </tr>';
        }
 
        // Return template
-       return loadTemplate($mode . '_doubler_list', true, $OUT);
+       return loadTemplate($mode . '_doubler_list', TRUE, $OUT);
 }
 
 // Get total points left in doubler pot
@@ -130,7 +133,7 @@ function getDoublerTotalPointsLeft() {
 
        if (getConfig('doubler_own') == 'Y') {
                // Take points from doubler's own account
-               $points += getConfig('doubler_points') - getConfig('doubler_used');
+               $points += getDoublerPoints() - getConfig('doubler_used');
        } // END - if
 
        if ((getConfig('doubler_jackpot') == 'Y') && (isExtensionActive('jackpot'))) {
@@ -140,9 +143,9 @@ function getDoublerTotalPointsLeft() {
                if (!empty($jackpot)) $points += $jackpot;
        } // END - if
 
-       if (isValidUserId(getConfig('doubler_userid'))) {
+       if (isValidUserId(getDoublerUserid())) {
                // Get user's points
-               $user = getTotalPoints(getConfig('doubler_userid'));
+               $user = getTotalPoints(getDoublerUserid());
                $points += $user;
        } // END - if
 
@@ -168,7 +171,7 @@ function getDoublerUserid () {
 
 // "Getter" for doubler_timeout
 function getDoublerTimeout () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('doubler_timeout');
@@ -180,7 +183,7 @@ function getDoublerTimeout () {
 
 // "Getter" for doubler_send_mode
 function getDoublerSendMode () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('doubler_send_mode');
@@ -192,7 +195,7 @@ function getDoublerSendMode () {
 
 // "Getter" for doubler_ref
 function getDoublerRef () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('doubler_ref');
@@ -204,7 +207,7 @@ function getDoublerRef () {
 
 // "Getter" for doubler_points
 function getDoublerPoints () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('doubler_points');
@@ -216,7 +219,7 @@ function getDoublerPoints () {
 
 // "Getter" for doubler_min
 function getDoublerMin () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('doubler_min');
@@ -228,7 +231,7 @@ function getDoublerMin () {
 
 // "Getter" for doubler_max
 function getDoublerMax () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('doubler_max');
@@ -240,7 +243,7 @@ function getDoublerMax () {
 
 // "Getter" for doubler_counter
 function getDoublerCounter () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('doubler_counter');
@@ -252,7 +255,7 @@ function getDoublerCounter () {
 
 // "Getter" for doubler_charge
 function getDoublerCharge () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('doubler_charge');
@@ -262,5 +265,17 @@ function getDoublerCharge () {
        return $GLOBALS[__FUNCTION__];
 }
 
+// "Getter" for doubler_max_sent
+function getDoublerMaxSent () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('doubler_max_sent');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>