X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fpurge%2Fpurge-coupon.php;h=3af67078a73b3087cd923e7eb4b07122c9319757;hb=150ed402878985508f10f4e06d25831e0fb3a1f8;hp=8502b3dd10617d8d86a64b765ae427ec152d2f5f;hpb=63f159414369b5ea19a8ca75d8cd8033c45d8341;p=mailer.git diff --git a/inc/purge/purge-coupon.php b/inc/purge/purge-coupon.php index 8502b3dd10..3af67078a7 100644 --- a/inc/purge/purge-coupon.php +++ b/inc/purge/purge-coupon.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 * @@ -39,12 +39,12 @@ if (!defined('__SECURITY')) { die(); } elseif (!isExtensionActive('coupon')) { - logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension disabled.'); + logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-coupon disabled.'); return; } // Search for all expired coupons that we can purge -$result = SQL_QUERY('SELECT +$result = sqlQuery('SELECT `id`, UNIX_TIMESTAMP(`coupon_created`) AS `coupon_created`, UNIX_TIMESTAMP(`coupon_expired`) AS `coupon_expired`, @@ -59,14 +59,14 @@ WHERE ORDER BY `id` ASC', __FILE__, __LINE__); -// Do we have entries? -if (SQL_NUMROWS($result) > 0) { +// Are there entries? +if (sqlNumRows($result) > 0) { // Init variables $out = ''; $ids = array(); // Start purging all - while ($content = SQL_FETCHARRAY($result)) { + while ($content = sqlFetchArray($result)) { // Add id array_push($ids, $content['id']); @@ -79,10 +79,10 @@ if (SQL_NUMROWS($result) > 0) { } // END - while // Purge all entries - SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_coupon_data` WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`coupon_expired`)) >= {?coupon_autopurge_time?}', __FILE__, __LINE__); + sqlQuery('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_coupon_data` WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`coupon_expired`)) >= {?coupon_autopurge_time?}', __FILE__, __LINE__); // Purge also user entries - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_coupons` WHERE `coupon_id` IN (%s) LIMIT %s", + sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_coupons` WHERE `coupon_id` IN (%s) LIMIT %s", array( implode(',', $ids), count($ids) @@ -93,7 +93,7 @@ if (SQL_NUMROWS($result) > 0) { } // END - if // Free result -SQL_FREERESULT($result); +sqlFreeResult($result); // [EOF] ?>