X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fdoubler_functions.php;h=4b550e706d5e7c924225dca0d0399c69edc4c978;hb=41792f2d1a2478a284c663c02b2f64ca74b2e3df;hp=5e331bd71e3873c224bf336c71f0eb6a12d973c1;hpb=30ae22f62ae87c53a56baf0d134569ba91011111;p=mailer.git diff --git a/inc/libs/doubler_functions.php b/inc/libs/doubler_functions.php index 5e331bd71e..4b550e706d 100644 --- a/inc/libs/doubler_functions.php +++ b/inc/libs/doubler_functions.php @@ -47,15 +47,15 @@ if (!defined('__SECURITY')) { function generateDoublerTable ($userid = '0', $done = 'N', $ref = 'N', $sort = 'ASC') { if (empty($cnt)) $cnt = '0'; $add = ''; $DT_MODE = '0'; - if ($userid > 0) { + if (isValidUserId($userid)) { // Load entries only from a single user $add = sprintf(" AND `userid`=%s", bigintval($userid)); $mode = 'member'; $COLS = 4; $DT_MODE = 2; - $message = '{--DOUBLER_MEMBER_NO_ENTRIES_FOUND--}'; + $message = '{--MEMBER_DOUBLER_NO_ENTRIES_FOUND--}'; } else { // Guest mode! $mode = 'guest'; $COLS = 3; $DT_MODE = 3; - $message = '{--DOUBLER_GUEST_NO_ENTRIES_FOUND--}'; + $message = '{--GUEST_DOUBLER_NO_ENTRIES_FOUND--}'; } if (($done == 'Y') && ($sort == 'ASC')) { @@ -103,12 +103,7 @@ LIMIT %s", } // END - if // Prepare data for the row template - $content = array( - 'userid' => $content['userid'], - 'rid' => $content['refid'], - 'points' => $content['points'], - 'timemark' => generateDateTime($content['timemark'], $DT_MODE), - ); + $content['timemark'] = generateDateTime($content['timemark'], $DT_MODE); // Load template and switch color $OUT .= loadTemplate($mode . '_doubler_list_rows', true, $content); @@ -148,7 +143,7 @@ function getDoublerTotalPointsLeft() { if (isValidUserId(getConfig('doubler_userid'))) { // Get user's points - $user = countSumTotalData(getConfig('doubler_userid'), 'user_points', 'points'); + $user = getTotalPoints(getConfig('doubler_userid')); $points += $user; } // END - if @@ -156,5 +151,17 @@ function getDoublerTotalPointsLeft() { return $points; } +// "Getter" for doubler_userid +function getDoublerUserid () { + // Is it cached? + if (!isset($GLOBALS['doubler_userid'])) { + // Get it + $GLOBALS['doubler_userid'] = getConfig('doubler_userid'); + } // END - if + + // Return cache + return $GLOBALS['doubler_userid']; +} + // [EOF] ?>