$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `%s`=%s ORDER BY `level` ASC LIMIT {?bonus_lines?}",
array($type, $data), __FUNCTION__, __LINE__);
if (!SQL_HASZERONUMS($result)) {
- // Start generating the ranking list
- $max = SQL_NUMROWS($result);
-
// Output all ranks (levels)
- for ($rank = 1; $rank <= $max; $rank++) {
+ for ($rank = 1; $rank <= SQL_NUMROWS($result); $rank++) {
// Load data
$result_users = SQL_QUERY_ESC("SELECT
`userid`, `points`
if ($self === false) {
// If current user was not found set constant
- $GLOBALS['ranking_content']['rankings'] = '{--BONUS_RANK_YOU_ARE_404--}';
+ $GLOBALS['ranking_content']['rankings'] = '{--MEMBER_BONUS_RANK_YOU_ARE_404--}';
} // END - if
} else {
// No entries found!
// @TODO Move this HTML to a template
$OUT = '<tr>
<td colspan="3" align="center" height="30" class="bottom">
- <div class="guest_failed">' . getMaskedMessage('BONUS_NO_RANKS', $data) . '</div>
+ <div class="guest_failed">' . getMaskedMessage('MEMBER_BONUS_NO_RANKS', $data) . '</div>
</td>
</tr>';
}
// Purges expired fast-click bonus entries
function purgeExpiredTurboBonus() {
// Remove entries
- $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `timemark` < (UNIX_TIMESTAMP() - {?bonus_timeout?})", __FUNCTION__, __LINE__);
+ $result = SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `timemark` < (UNIX_TIMESTAMP() - {?bonus_timeout?})', __FUNCTION__, __LINE__);
if (SQL_AFFECTEDROWS() > 0) {
// Send out email to admin
} // END - if
}
-///////////////////////////////////////////////////////////////////////////////
-// Only filter functions
-///////////////////////////////////////////////////////////////////////////////
+//-----------------------------------------------------------------------------
+// Filter Functions
+//-----------------------------------------------------------------------------
// Filter for adding login bonus to the user's account
function FILTER_ADD_LOGIN_BONUS () {
if (($bonus === true) && (getRequestParameter('mode') == 'bonus')) {
// Output message with added points
- $GLOBALS['message'] .= '<div class="tiny">{--BONUS_LOGIN_BONUS_ADDED--}</div>';
+ $GLOBALS['message'] .= '<div class="tiny">{--MEMBER_BONUS_LOGIN_BONUS_ADDED--}</div>';
} elseif (isExtensionActive('bonus')) {
// No login bonus added!
- $GLOBALS['message'] .= '<div class="member_failed">{--BONUS_LOGIN_BONUS_NOT_ADDED--}</div>';
+ $GLOBALS['message'] .= '<div class="member_failed">{--MEMBER_BONUS_LOGIN_BONUS_NOT_ADDED--}</div>';
}
}
-///////////////////////////////////////////////////////////////////////////////
-// Wrapper functions //
-///////////////////////////////////////////////////////////////////////////////
+//-----------------------------------------------------------------------------
+// Wrapper Functions
+//-----------------------------------------------------------------------------
// Determines wether the "bonus rallye" is active
function isBonusRallyeActive () {
return $GLOBALS['bonus_new_member_notify_active'];
}
+// Getter for bonus_timeout
+function getBonusTimeout () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('bonus_timeout');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// [EOF]
?>