Fixes for auto-purge scripts (missing array elements)
authorRoland Häder <roland@mxchange.org>
Tue, 1 Dec 2009 04:41:31 +0000 (04:41 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 1 Dec 2009 04:41:31 +0000 (04:41 +0000)
inc/autopurge/purge-inact.php
inc/autopurge/purge-mails.php
inc/autopurge/purge-tsks.php
inc/autopurge/purge-unconfirmed.php

index 652a561e2eeb25704279fcc201844dd6b4618c5c..eb5bc27229a5b91f105c5cf6b11bf25723d01f6f 100644 (file)
@@ -94,7 +94,7 @@ ORDER BY
                $content['time']  = (getConfig('ap_inactive_time')  / 60 / 60);
 
                // Mark found accounts as inactive and send an email
                $content['time']  = (getConfig('ap_inactive_time')  / 60 / 60);
 
                // Mark found accounts as inactive and send an email
-               while ($content = SQL_FETCHARRAY($result_inactive)) {
+               while ($content = merge_array($content, SQL_FETCHARRAY($result_inactive))) {
                        // Remember userids for the admin
                        $useridsContent .= $content['userid'].", ";
 
                        // Remember userids for the admin
                        $useridsContent .= $content['userid'].", ";
 
index 2a2df0f17af43314fa6eb8c9a58e4196d2161f31..29f13497330df8c5cbcbb6cb2cbd7cd3d466d2e0 100644 (file)
@@ -69,6 +69,8 @@ if (SQL_NUMROWS($result_mails) > 0) {
                        // Okay we found some mails!
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_pool` WHERE `sender`=%s",
                                array(bigintval($content['sender'])), __FILE__, __LINE__);
                        // Okay we found some mails!
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_pool` WHERE `sender`=%s",
                                array(bigintval($content['sender'])), __FILE__, __LINE__);
+
+                       // Get all affected (deleted) rows
                        $deletedStats += SQL_AFFECTEDROWS();
 
                        // Reset query (to prevent possible errors) ...;
                        $deletedStats += SQL_AFFECTEDROWS();
 
                        // Reset query (to prevent possible errors) ...;
@@ -106,6 +108,8 @@ if (SQL_NUMROWS($result_mails) > 0) {
                        // Okay we found some mails!
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `sender`=%s",
                                array(bigintval($content['sender'])), __FILE__, __LINE__);
                        // Okay we found some mails!
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `sender`=%s",
                                array(bigintval($content['sender'])), __FILE__, __LINE__);
+
+                       // Get all affected (deleted) rows
                        $deletedStats += SQL_AFFECTEDROWS();
 
                        // Reset query (to prevent possible errors) ...
                        $deletedStats += SQL_AFFECTEDROWS();
 
                        // Reset query (to prevent possible errors) ...
index d39f7f198125cd15ef7539c2ff303694b3106414..708c880344573c26930a3c0a3d934d2205b59f6c 100644 (file)
@@ -54,7 +54,8 @@ if ((isExtensionInstalledAndNewer('task') > '0.0') && (getConfig('autopurge_task
 FROM
        `{?_MYSQL_PREFIX?}_task_system`
 WHERE
 FROM
        `{?_MYSQL_PREFIX?}_task_system`
 WHERE
-       `status`='DELETED' AND `task_created` <= (UNIX_TIMESTAMP() - {?ap_tasks_time?})", __FILE__, __LINE__);
+       `status`='DELETED' AND
+       `task_created` <= (UNIX_TIMESTAMP() - {?ap_tasks_time?})", __FILE__, __LINE__);
 
        // Get deleted rows
        $deletedTasks = SQL_AFFECTEDROWS();
 
        // Get deleted rows
        $deletedTasks = SQL_AFFECTEDROWS();
index 31d825d5d0cccaa60604abe28d8544f4b19969fa..faa5b76dfca62e2940d68ac3fa64a2fc0bc42262 100644 (file)
@@ -64,7 +64,7 @@ ORDER BY
                $content['time'] = (getConfig('ap_unconfirmed_time')  / 60 / 60);
 
                // Delete inactive accounts
                $content['time'] = (getConfig('ap_unconfirmed_time')  / 60 / 60);
 
                // Delete inactive accounts
-               while ($content = SQL_FETCHARRAY($result_uncon)) {
+               while ($content = merge_array($content, SQL_FETCHARRAY($result_uncon))) {
                        // Remember userids for the admin
                        $userids .= $content['userid'] . ', ';
 
                        // Remember userids for the admin
                        $userids .= $content['userid'] . ', ';