X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fdoubler_functions.php;h=31998dbe2db753951b2330432f6d6aa957883f3b;hb=e19231f39d9d6583cc5753dbd2638c597957fdd1;hp=6ca451b69a3fe7d4e567e502d5edf9ba693bb061;hpb=171923dfbd09758b7cbf58aff40c5a358407061a;p=mailer.git diff --git a/inc/libs/doubler_functions.php b/inc/libs/doubler_functions.php index 6ca451b69a..31998dbe2d 100644 --- a/inc/libs/doubler_functions.php +++ b/inc/libs/doubler_functions.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2016 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -44,7 +44,7 @@ if (!defined('__SECURITY')) { // @TODO Lame description function generateDoublerTable ($userid = NULL, $done = 'N', $ref = 'N', $sort = 'ASC') { $add = ''; $DT_MODE = '0'; - if (isValidUserId($userid)) { + if (isValidId($userid)) { // Load entries only from a single user $add = sprintf(" AND `userid`=%s", bigintval($userid)); $mode = 'member'; $COLS = 4; $DT_MODE = 2; @@ -67,7 +67,7 @@ function generateDoublerTable ($userid = NULL, $done = 'N', $ref = 'N', $sort = } // List entries - $result = SQL_QUERY_ESC("SELECT + $result = sqlQueryEscaped("SELECT `userid`, `refid`, `points`, @@ -88,10 +88,10 @@ LIMIT %s", $limit ), __FUNCTION__, __LINE__); - if (!SQL_HASZERONUMS($result)) { + if (!ifSqlHasZeroNumRows($result)) { // List entries $OUT = ''; - while ($content = SQL_FETCHARRAY($result)) { + while ($content = sqlFetchArray($result)) { // Rewrite userid/refid only if admin is in // @TODO Can't this be moved into EL? if (isAdmin()) { @@ -100,8 +100,8 @@ LIMIT %s", $content['refid'] = '---'; // Set links to admin area - if (isValidUserId($content['userid'])) $content['userid'] = generateUserProfileLink($content['userid']); - if (isValidUserId($content['refid'])) $content['refid'] = generateUserProfileLink($content['refid']); + if (isValidId($content['userid'])) $content['userid'] = generateUserProfileLink($content['userid']); + if (isValidId($content['refid'])) $content['refid'] = generateUserProfileLink($content['refid']); } // END - if // Prepare data for the row template @@ -112,7 +112,7 @@ LIMIT %s", } // END - while // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); } else { // List no entries $OUT = ' @@ -127,6 +127,7 @@ LIMIT %s", } // Get total points left in doubler pot +// @TODO This could be rewritten to a filter function getDoublerTotalPointsLeft() { // Initialize variables $points = '0'; @@ -137,16 +138,13 @@ function getDoublerTotalPointsLeft() { } // END - if if ((getConfig('doubler_jackpot') == 'Y') && (isExtensionActive('jackpot'))) { - // Load jackpot - $jackpot = getJackpotPoints(); - - if (!empty($jackpot)) $points += $jackpot; + // Get+add jackpot points + $points += getJackpotPoints(); } // END - if - if (isValidUserId(getDoublerUserid())) { + if (isValidId(getDoublerUserid())) { // Get user's points - $user = getTotalPoints(getDoublerUserid()); - $points += $user; + $points += getTotalPoints(getDoublerUserid()); } // END - if // Return value