Reset rewritten, SQL fixed, zeros are now numeric
[mailer.git] / inc / autopurge.php
index 6873a1542ad1cb5345402087602c28d2bfbf5d44..a0896be2c32a52c8911a8af81318a8ada6c813bd 100644 (file)
@@ -51,7 +51,7 @@ if (($_CONFIG['auto_purge_active'] == "Y") && ($_CONFIG['auto_purge'] > 0))
        }
 
        // Init variables
-       $admin_points = "0";
+       $admin_points = 0;
 
        // Then check for outdated mail order. We don't delete them just the confirmation links will be deleted.
        $result = SQL_QUERY_ESC("SELECT s.id, s.userid, s.pool_id, t.price
@@ -63,7 +63,7 @@ WHERE s.timestamp_ordered <= %s ORDER BY s.userid",
        if (SQL_NUMROWS($result) > 0)
        {
                // Start deleting procedure
-               $uid = "0"; $points = "0";
+               $uid = 0; $points = 0;
                while(list($mid, $sender, $pool, $price) = SQL_FETCHROW($result))
                {
                        // Check if confirmation links are purged or not
@@ -79,7 +79,7 @@ WHERE s.timestamp_ordered <= %s ORDER BY s.userid",
                                {
                                        // Directly add points back to senders account
                                        AUTOPURGE_ADD_POINTS($uid, $points);
-                                       $points = "0";
+                                       $points = 0;
                                }
                                // Add points
                                $uid = $sender; $points += $price; $admin_points += $price;
@@ -110,7 +110,7 @@ WHERE s.timestamp_ordered <= %s ORDER BY s.userid",
                if (SQL_NUMROWS($result) > 0)
                {
                        // Start deleting procedure
-                       $points = "0";
+                       $points = 0;
                        while (list($bid, $price) = SQL_FETCHROW($result))
                        {
                                // Check if confirmation links are purged or not