X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fdoubler_functions.php;h=6ca451b69a3fe7d4e567e502d5edf9ba693bb061;hb=0b4c98232a5c9c5b934a5049dc3c84ad32ab1125;hp=48b7668775fa0f89aa77b4fc0f4d3f47331b5164;hpb=c8d76610eb94093d4eed4fcd8a6cb72e74c8f6d8;p=mailer.git diff --git a/inc/libs/doubler_functions.php b/inc/libs/doubler_functions.php index 48b7668775..6ca451b69a 100644 --- a/inc/libs/doubler_functions.php +++ b/inc/libs/doubler_functions.php @@ -16,8 +16,8 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * 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 * * it under the terms of the GNU General Public License as published by * @@ -38,12 +38,11 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} +} // END - if // Generates a HTML table based on given data // @TODO Lame description -function generateDoublerTable ($userid = '0', $done = 'N', $ref = 'N', $sort = 'ASC') { - if (empty($cnt)) $cnt = '0'; +function generateDoublerTable ($userid = NULL, $done = 'N', $ref = 'N', $sort = 'ASC') { $add = ''; $DT_MODE = '0'; if (isValidUserId($userid)) { // Load entries only from a single user @@ -69,11 +68,16 @@ function generateDoublerTable ($userid = '0', $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 - `completed`='%s' AND `is_ref`='%s'" . $add . " + `completed`='%s' AND + `is_ref`='%s' + " . $add . " ORDER BY `timemark` %s LIMIT %s", @@ -104,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 @@ -113,13 +117,13 @@ LIMIT %s", // List no entries $OUT = ' - ' . loadTemplate('admin_settings_saved', true, $message) . ' + ' . displayMessage($message, TRUE) . ' '; } // Return template - return loadTemplate($mode . '_doubler_list', true, $OUT); + return loadTemplate($mode . '_doubler_list', TRUE, $OUT); } // Get total points left in doubler pot @@ -129,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'))) { @@ -139,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 @@ -149,6 +153,10 @@ function getDoublerTotalPointsLeft() { return $points; } +//----------------------------------------------------------------------------- +// Wrapper functions for ext-doubler +//----------------------------------------------------------------------------- + // "Getter" for doubler_userid function getDoublerUserid () { // Is it cached? @@ -161,5 +169,113 @@ function getDoublerUserid () { return $GLOBALS['doubler_userid']; } +// "Getter" for doubler_timeout +function getDoublerTimeout () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('doubler_timeout'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// "Getter" for doubler_send_mode +function getDoublerSendMode () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('doubler_send_mode'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// "Getter" for doubler_ref +function getDoublerRef () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('doubler_ref'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// "Getter" for doubler_points +function getDoublerPoints () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('doubler_points'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// "Getter" for doubler_min +function getDoublerMin () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('doubler_min'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// "Getter" for doubler_max +function getDoublerMax () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('doubler_max'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// "Getter" for doubler_counter +function getDoublerCounter () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('doubler_counter'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// "Getter" for doubler_charge +function getDoublerCharge () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('doubler_charge'); + } // END - if + + // Return cache + 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] ?>