X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fbonus_functions.php;h=0cba632fea12a6f5a6fea5a721e110d65e91f18c;hb=f298f71846512b05d8eed6c03771253e2c39655f;hp=17736e92928eaf3137403c87d37d14d1cb70a440;hpb=241acfbd7e38ff9916100dac9d88892713f85c7f;p=mailer.git diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index 17736e9292..0cba632fea 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -150,11 +150,8 @@ function addBonusRanks ($data, $type, $userid) { $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` @@ -197,14 +194,14 @@ LIMIT 1", 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 = ' -
' . getMaskedMessage('BONUS_NO_RANKS', $data) . '
+
' . getMaskedMessage('MEMBER_BONUS_NO_RANKS', $data) . '
'; } @@ -261,7 +258,7 @@ function handleBonusPoints ($mode) { // 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 @@ -269,9 +266,9 @@ function purgeExpiredTurboBonus() { } // END - if } -/////////////////////////////////////////////////////////////////////////////// -// Only filter functions -/////////////////////////////////////////////////////////////////////////////// +//----------------------------------------------------------------------------- +// Filter Functions +//----------------------------------------------------------------------------- // Filter for adding login bonus to the user's account function FILTER_ADD_LOGIN_BONUS () { @@ -305,16 +302,16 @@ LIMIT 1', if (($bonus === true) && (getRequestParameter('mode') == 'bonus')) { // Output message with added points - $GLOBALS['message'] .= '
{--BONUS_LOGIN_BONUS_ADDED--}
'; + $GLOBALS['message'] .= '
{--MEMBER_BONUS_LOGIN_BONUS_ADDED--}
'; } elseif (isExtensionActive('bonus')) { // No login bonus added! - $GLOBALS['message'] .= '
{--BONUS_LOGIN_BONUS_NOT_ADDED--}
'; + $GLOBALS['message'] .= '
{--MEMBER_BONUS_LOGIN_BONUS_NOT_ADDED--}
'; } } -/////////////////////////////////////////////////////////////////////////////// -// Wrapper functions // -/////////////////////////////////////////////////////////////////////////////// +//----------------------------------------------------------------------------- +// Wrapper Functions +//----------------------------------------------------------------------------- // Determines wether the "bonus rallye" is active function isBonusRallyeActive () { @@ -340,5 +337,17 @@ function isBonusNewMemberNotifyEnabled () { 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] ?>