X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fdoubler_functions.php;h=4d8b7cf5c81cc842d7e99d216ef575b70c7354a2;hp=979f3fe800424f7a1f374383d05d300b47fc108c;hb=596c8ab32594401ca84abfbfe35513ddfff31bec;hpb=682edce003a1a91f66fb8e2212d7fdb591379843 diff --git a/inc/libs/doubler_functions.php b/inc/libs/doubler_functions.php index 979f3fe800..4d8b7cf5c8 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,11 +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') { +function generateDoublerTable ($userid = NULL, $done = 'N', $ref = 'N', $sort = 'ASC') { $add = ''; $DT_MODE = '0'; if (isValidUserId($userid)) { // Load entries only from a single user @@ -68,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", @@ -103,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 @@ -112,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 @@ -148,6 +153,10 @@ function getDoublerTotalPointsLeft() { return $points; } +//----------------------------------------------------------------------------- +// Wrapper functions for ext-doubler +//----------------------------------------------------------------------------- + // "Getter" for doubler_userid function getDoublerUserid () { // Is it cached? @@ -160,5 +169,101 @@ 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__]; +} + // [EOF] ?>