X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Ftransfer_functions.php;h=f96d058488eb49747661f4891dd8dd8bc472967a;hb=5942a52ee1b26fdf495dc9c0946d616afc649607;hp=14888c79008056d3fae4d64b01909f5086fe2720;hpb=63f159414369b5ea19a8ca75d8cd8033c45d8341;p=mailer.git diff --git a/inc/libs/transfer_functions.php b/inc/libs/transfer_functions.php index 14888c7900..f96d058488 100644 --- a/inc/libs/transfer_functions.php +++ b/inc/libs/transfer_functions.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -43,36 +43,36 @@ if (!defined('__SECURITY')) { // Purge expired transfer entries function autoPurgeTransfers ($max, $age) { // First get total in-going lines - $result = SQL_QUERY('SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` ORDER BY `id` ASC', __FUNCTION__, __LINE__); - if (SQL_NUMROWS($result) > $max) { + $result = sqlQuery('SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` ORDER BY `id` ASC', __FUNCTION__, __LINE__); + if (sqlNumRows($result) > $max) { // Update overdue transfers - $remove = SQL_NUMROWS($result) - $max; + $remove = sqlNumRows($result) - $max; // This will make it really old, so the final removal query will find it - $result = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_transfers_in` SET `time_trans`=0 ORDER BY `id` ASC LIMIT %s", + $result = sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_user_transfers_in` SET `time_trans`=0 ORDER BY `id` ASC LIMIT %s", array($remove), __FUNCTION__, __LINE__); } // END - if // Second get total out-going lines - $result = SQL_QUERY('SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_transfers_out` ORDER BY `id` ASC', __FUNCTION__, __LINE__); - if (SQL_NUMROWS($result) > $max) { + $result = sqlQuery('SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_transfers_out` ORDER BY `id` ASC', __FUNCTION__, __LINE__); + if (sqlNumRows($result) > $max) { // Update overdue transfers - $remove = SQL_NUMROWS($result) - $max; + $remove = sqlNumRows($result) - $max; // This will make it really old, so the final removal query will find it - $result = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_transfers_out` SET `time_trans`=0 ORDER BY `id` ASC LIMIT %s", + $result = sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_user_transfers_out` SET `time_trans`=0 ORDER BY `id` ASC LIMIT %s", array($remove), __FUNCTION__, __LINE__); } // END - if // Remove old in-going transfers - $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `time_trans` < (UNIX_TIMESTAMP() - %s)", + $result = sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `time_trans` < (UNIX_TIMESTAMP() - %s)", array($age), __FUNCTION__, __LINE__); - $removed = SQL_AFFECTEDROWS(); + $removed = sqlAffectedRows(); // Remove old out-going transfers - $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `time_trans` < (UNIX_TIMESTAMP() - %s)", + $result = sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `time_trans` < (UNIX_TIMESTAMP() - %s)", array($age), __FUNCTION__, __LINE__); - $removed += SQL_AFFECTEDROWS(); + $removed += sqlAffectedRows(); // Only send email to admin(s) when we have removed entries if ($removed > 0) {