config.php partly solved, see #117
[mailer.git] / inc / libs / bonus_functions.php
index 109e740f1dfaed1f7a84b420c44fcf3d0677537a..d5a360e57cb9699117cca66dcc8d5c248e35f1af 100644 (file)
@@ -133,7 +133,7 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) {
                // Transfer data to template
                define('__YR_LEVEL' , $rank);
                define('__YR_POINTS', $points);
-               define('__YR_TMARK' , generateDateTime($mark, "1"));
+               define('__YR_TMARK' , generateDateTime($mark, '1'));
 
                // Load template
                define('__YOUR_RANKING_LINE', LOAD_TEMPLATE("show_bonus_yr", true));
@@ -194,12 +194,12 @@ function BONUS_POINTS_HANDLER ($mode) {
        if (getConfig('bonus_active') != 'Y') return;
 
        // Switch to jackpot-mode when no UID is supplied but userid-mode is selected
-       if ((getConfig('bonus_mode') == "UID") && (getConfig('bonus_uid') == '0')) {
+       if ((getConfig('bonus_mode') == 'UID') && (getConfig('bonus_uid') == '0')) {
                // Update database & config
                updateConfiguration('bonus_mode', 'JACKPOT');
        } // END - if
 
-       if ($mode == "login_bonus") {
+       if ($mode == 'login_bonus') {
                // Login bonus detected
                $points = getConfig('login_bonus');
        } else {
@@ -213,20 +213,20 @@ function BONUS_POINTS_HANDLER ($mode) {
        case 'JACKPOT': // ... jackpot
                if ((SUB_JACKPOT($points) == -1) && (getConfig('bonus_uid') > 0)) {
                        // Check points amount first...
-                       $total = GET_TOTAL_DATA(getConfig('bonus_uid'), "user_points", "points") - GET_TOTAL_DATA(getConfig('bonus_uid'), "user_data", "used_points");
+                       $total = GET_TOTAL_DATA(getConfig('bonus_uid'), 'user_points', 'points') - GET_TOTAL_DATA(getConfig('bonus_uid'), 'user_data', 'used_points');
                        if ($total >= $points) {
                                // Subtract points from userid's account
-                               SUB_POINTS("bonus_payout_jackpot", getConfig('bonus_uid'), $points);
+                               SUB_POINTS('bonus_payout_jackpot', getConfig('bonus_uid'), $points);
                        } // END - if
                } // END - if
                break;
 
-       case "UID": // ... userid's account
+       case 'UID': // ... userid's account
                // Check his amount first
-               $total = GET_TOTAL_DATA(getConfig('bonus_uid'), "user_points", "points") - GET_TOTAL_DATA(getConfig('bonus_uid'), "user_data", "used_points");
+               $total = GET_TOTAL_DATA(getConfig('bonus_uid'), 'user_points', 'points') - GET_TOTAL_DATA(getConfig('bonus_uid'), 'user_data', 'used_points');
                if ($total >= $points) {
                        // Subtract points from userid's account
-                       SUB_POINTS("bonus_payout_uid", getConfig('bonus_uid'), $points);
+                       SUB_POINTS('bonus_payout_uid', getConfig('bonus_uid'), $points);
                } else {
                        // Try to subtract from jackpot
                        $dummy = SUB_JACKPOT($points);
@@ -241,8 +241,9 @@ function BONUS_PURGE_EXPIRED_TURBO_BONUS() {
        $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE timemark < (UNIX_TIMESTAMP() - ".getConfig('bonus_timeout').")", __FUNCTION__, __LINE__);
        if (SQL_AFFECTEDROWS() > 0) {
                // Send out email to admin
-               sendAdminNotification(AUTOPURGE_ADMIN_TURBO_SUBJECT, "admin_autopurge_turbo", SQL_AFFECTEDROWS(), '');
-       }
+               sendAdminNotification(AUTOPURGE_ADMIN_TURBO_SUBJECT, 'admin_autopurge_turbo', SQL_AFFECTEDROWS(), '');
+       } // END - if
 }
+
 //
 ?>