]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/bonus_functions.php
Extension ext-coupon continued, a lot improvements applied:
[mailer.git] / inc / libs / bonus_functions.php
index 0ef95848f653e01244321f0f89915468935ea42a..bd3948445860d43f39270df080dfdb1f82804aee 100644 (file)
@@ -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 = '';
@@ -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