- Daily/weekly/monthly reset completely rewritten
[mailer.git] / inc / monthly / monthly_bonus.php
index b555dd32384da2a020b43479b55878d2da0d639c..f4e465fb585342d050283271a33d2349fc0e9a9c 100644 (file)
@@ -49,7 +49,7 @@ if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET'))) return;
 // Get current month (2 digits)
 $curr = date("m", time());
 
-if (($curr != $_CONFIG['bonus_month']) && ($_CONFIG['bonus_ranks'] > 0) && ($CSS != 1))
+if (($curr != $_CONFIG['last_month']) && ($_CONFIG['bonus_ranks'] > 0) && ($CSS != 1))
 {
        // Extension "autopurge" is inactive or purging of inactive accounts is deactivated
        $whereStatement1 = "WHERE status='CONFIRMED'";
@@ -126,13 +126,7 @@ SET turbo_bonus=0, login_bonus=0, bonus_order=0, bonus_stats=0, bonus_ref=0", __
 
        // Free memory
        SQL_FREERESULT($result_main);
-
-       // Finally update database and config array
-       $_CONFIG['bonus_month'] = $curr;
-       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET last_bonus_month='%s' WHERE config=0 LIMIT 1",
-        array($curr), __FILE__, __LINE__);
-
-       // Destroy cache
 }
+
 //
 ?>