Moved all FILTER_FOO() filter functions to an own include directory:
[mailer.git] / inc / libs / bonus_functions.php
index 68269946d8e2dc80356978972bcddfbae7e07716..0ef95848f653e01244321f0f89915468935ea42a 100644 (file)
@@ -274,49 +274,6 @@ function purgeExpiredTurboBonus() {
        } // END - if
 }
 
-//-----------------------------------------------------------------------------
-//                                Filter Functions
-//-----------------------------------------------------------------------------
-
-// Filter for adding login bonus to the user's account
-function FILTER_ADD_LOGIN_BONUS () {
-       // Is the user data valid?
-       if (!isMember()) {
-               // Do only run for logged in members
-               debug_report_bug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.');
-       } // END - if
-
-       // Bonus is not given by default ;-)
-       $bonus = false;
-       if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (isBonusRallyeActive()) && (getConfig('bonus_login_yn') == 'Y')) {
-               // Update last login if far enougth away
-               // @TODO This query isn't right, it will only update if the user was for a longer time away!
-               SQL_QUERY_ESC('UPDATE
-       `{?_MYSQL_PREFIX?}_user_data`
-SET
-       `last_login`=UNIX_TIMESTAMP()
-WHERE
-       `userid`=%s AND
-       `last_login` < (UNIX_TIMESTAMP() - {?login_timeout?})
-LIMIT 1',
-                       array(
-                               getMemberId()
-                       ), __FUNCTION__, __LINE__
-               );
-
-               // Updated entry?
-               $bonus = (!SQL_HASZEROAFFECTED());
-       } // END - if
-
-       if (($bonus === true) && (getRequestParameter('mode') == 'bonus')) {
-               // Output message with added points
-               $GLOBALS['message'] .= '<div class="tiny">{--MEMBER_BONUS_LOGIN_BONUS_ADDED--}</div>';
-       } elseif (isExtensionActive('bonus')) {
-               // No login bonus added!
-               $GLOBALS['message'] .= '<div class="notice">{--MEMBER_BONUS_LOGIN_BONUS_NOT_ADDED--}</div>';
-       }
-}
-
 //-----------------------------------------------------------------------------
 //                             Wrapper Functions
 //-----------------------------------------------------------------------------