X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fbonus_functions.php;h=7bbf24eee983e811db0bffb3a7823024e3065260;hp=0ef95848f653e01244321f0f89915468935ea42a;hb=330dbb3e2b34450cd1665497506455e195a0a166;hpb=24dfd21baed6a9a112992bdabf7da96576012bc4
diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php
index 0ef95848f6..7bbf24eee9 100644
--- a/inc/libs/bonus_functions.php
+++ b/inc/libs/bonus_functions.php
@@ -40,10 +40,12 @@ if (!defined('__SECURITY')) {
die();
} // END - if
-// This function must be run *BEFORE* a link is removed from table 'mxchange_user_links' !
+// This function must be run *BEFORE* a link is removed from table 'mailer_user_links' !
function addTurboBonus ($mid, $userid, $type) {
// Shall we add bonus points?
- if (!isBonusRallyeActive()) return false;
+ if (!isBonusRallyeActive()) {
+ return false;
+ } // END - if
// Init variables
$sql = ''; $bonus = '0'; $mail = '0'; $column = '';
@@ -201,7 +203,7 @@ LIMIT 1",
// @TODO Move this HTML to a template
$OUT = '
- ' . getMaskedMessage('MEMBER_BONUS_NO_RANKS', $data) . '
+ {%message,MEMBER_BONUS_NO_RANKS=' . $data . '%}
|
';
}
@@ -216,7 +218,7 @@ function handleBonusPoints ($mode) {
if (!isBonusRallyeActive()) return;
// Switch to jackpot-mode when no UID is supplied but userid-mode is selected
- if ((getBonusMode() == 'UID') && (getBonusUserId() == '0') && (isExtensionActive('jackpot'))) {
+ if ((getBonusMode() == 'UID') && (getBonusUserid() == '0') && (isExtensionActive('jackpot'))) {
// Update database & config
updateConfiguration('bonus_mode', 'JACKPOT');
} // END - if
@@ -230,7 +232,7 @@ function handleBonusPoints ($mode) {
}
// Check his amount first
- $total = getTotalPoints(getBonusUserId());
+ $total = getTotalPoints(getBonusUserid());
// Subtract points from...
switch (getBonusMode()) {
@@ -239,10 +241,10 @@ function handleBonusPoints ($mode) {
break;
case 'JACKPOT': // ... jackpot
- if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) == -1) && (isValidUserId(getBonusUserId()))) {
+ if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) == -1) && (isValidUserId(getBonusUserid()))) {
if ($total >= $points) {
// Subtract points from userid's account
- subtractPointsFromJackpot('bonus_payout_jackpot', getBonusUserId(), $points);
+ subtractPointsFromJackpot('bonus_payout_jackpot', getBonusUserid(), $points);
} // END - if
} // END - if
break;
@@ -250,7 +252,7 @@ function handleBonusPoints ($mode) {
case 'UID': // ... userid's account
if ($total >= $points) {
// Subtract points from userid's account
- subtractPoints('bonus_payout_userid', getBonusUserId(), $points);
+ subtractPoints('bonus_payout_userid', getBonusUserid(), $points);
} elseif (isExtensionActive('jackpot')) {
// Try to subtract from jackpot
$dummy = subtractPointsFromJackpot($points);
@@ -266,7 +268,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 (UNIX_TIMESTAMP() - `timemark`) >= {?bonus_timeout?}', __FUNCTION__, __LINE__);
if (!SQL_HASZEROAFFECTED()) {
// Send out email to admin