// @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;
$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
}
// Get total points left in doubler pot
+// @TODO This could be rewritten to a filter
function getDoublerTotalPointsLeft() {
// Initialize variables
$points = '0';
} // 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
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]
?>