X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fautopurge%2Fpurge-mails.php;h=61f911bdfaeebb8b3a89ce03ac01d6c55f60ed8b;hb=2e394cb5b8a6225a39a6942b1fcc17c37a17a175;hp=83584677776085fa5f208aafb22e5160666e9d7b;hpb=ff9e8f739bd4b6e184b2a6bf427334196e501da8;p=mailer.git diff --git a/inc/autopurge/purge-mails.php b/inc/autopurge/purge-mails.php index 8358467777..61f911bdfa 100644 --- a/inc/autopurge/purge-mails.php +++ b/inc/autopurge/purge-mails.php @@ -14,11 +14,9 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -55,7 +53,7 @@ FROM `{?_MYSQL_PREFIX?}_pool` WHERE `data_type`='DELETED' AND - `timestamp` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?}) + (UNIX_TIMESTAMP() - `timestamp`) >= {?ap_dm_timeout?} ORDER BY `sender` ASC", __FILE__, __LINE__); @@ -82,7 +80,7 @@ FROM `{?_MYSQL_PREFIX?}_pool` WHERE `data_type`='DELETED' AND - `timestamp` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?}) + (UNIX_TIMESTAMP() - `timestamp`) >= {?ap_dm_timeout?} ORDER BY `sender` ASC", __FILE__, __LINE__); } // END - if @@ -94,11 +92,11 @@ SQL_FREERESULT($result_mails); // Now let's check for stats entries as well; $result_mails = SQL_QUERY("SELECT - `userid` AS sender + `userid` AS `sender` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE - `timestamp_send` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?}) + (UNIX_TIMESTAMP() - `timestamp_send`) >= {?ap_dm_timeout?} ORDER BY `userid` ASC", __FILE__, __LINE__); @@ -110,18 +108,18 @@ if (!SQL_HASZERONUMS($result_mails)) { if (!fetchUserData($content['sender'])) { // Okay we found some mails! SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `userid`=%s", - array(bigintval($content['userid'])), __FILE__, __LINE__); + array(bigintval($content['sender'])), __FILE__, __LINE__); // Get all affected (deleted) rows $deletedStats += SQL_AFFECTEDROWS(); // Reset query (to prevent possible errors) ... $result_mails = SQL_QUERY("SELECT - `userid` + `userid` AS `sender` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE - `timestamp_send` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?}) + (UNIX_TIMESTAMP() - `timestamp_send`) >= {?ap_dm_timeout?} ORDER BY `userid` ASC", __FILE__, __LINE__); } // END - if @@ -137,5 +135,5 @@ if (($deletedStats > 0) && (getConfig('ap_dm_notify') == 'Y')) { sendAdminNotification('{--ADMIN_AUTOPURGE_DELETE_MAILS_SUBJECT--}', 'admin_autopurge_del_mails', $deletedStats); } // END - if -// +// [EOF] ?>