X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fautopurge%2Fpurge-general.php;h=a24b4c7cdc120b4dfd47def0d447b4c162b5d12f;hb=f36ab6ae1503ee54a7c9d0083a8089286d8b37ef;hp=3ee13256e9d971c5a6198a51a18fc898e10cd2d4;hpb=7f104f6fe558bb56b4205241435a2357c2feece1;p=mailer.git diff --git a/inc/autopurge/purge-general.php b/inc/autopurge/purge-general.php index 3ee13256e9..a24b4c7cdc 100644 --- a/inc/autopurge/purge-general.php +++ b/inc/autopurge/purge-general.php @@ -39,17 +39,17 @@ if (!defined('__SECURITY')) { } // Abort if autopurge is not active or disabled by admin -if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) { +if ((!EXT_IS_ACTIVE("autopurge")) || (getConfig('auto_purge_active') == "N")) { // Abort here return false; } -if (($_CONFIG['auto_purge_active'] == "Y") && ($_CONFIG['auto_purge'] > 0)) { +if ((getConfig('auto_purge_active') == "Y") && (getConfig('auto_purge') > 0)) { // First calculate the timestamp if (function_exists('CREATE_TIME_SELECTIONS')) { - $PURGE = $_CONFIG['auto_purge']; + $PURGE = getConfig('auto_purge'); } else { - $PURGE = $_CONFIG['auto_purge'] * 24 * 60 * 60; + $PURGE = getConfig('auto_purge') * getConfig('one_day'); } // Init variables @@ -84,12 +84,12 @@ WHERE s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s) ORDER BY s.userid", $uid = $sender; $points += $price; $admin_points += $price; // Remove confirmation links from queue - $result_del = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_links WHERE stats_id=%s", - array(bigintval($mid)), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_links WHERE stats_id=%s", + array(bigintval($mid)), __FILE__, __LINE__); // Update status of order - $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='DELETED' WHERE id=%s LIMIT 1", - array(bigintval($pool)), __FILE__, __LINE__); + SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='DELETED' WHERE id=%s LIMIT 1", + array(bigintval($pool)), __FILE__, __LINE__); } // END - if } // END - while @@ -104,14 +104,14 @@ WHERE s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s) ORDER BY s.userid", if (EXT_IS_ACTIVE("bonus", true)) { // Check for bonus campaigns $result = SQL_QUERY_ESC("SELECT id, points FROM "._MYSQL_PREFIX."_bonus WHERE data_type='SEND' AND timestamp <= %s ORDER BY id", - array(bigintval($PURGE)), __FILE__, __LINE__); + array(bigintval($PURGE)), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Start deleting procedure $points = 0; while (list($bid, $price) = SQL_FETCHROW($result)) { // Check if confirmation links are purged or not $result_links = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_links WHERE bonus_id=%s", - array(bigintval($bid)), __FILE__, __LINE__); + array(bigintval($bid)), __FILE__, __LINE__); if (SQL_NUMROWS($result_links) > 0) { // At least one link was found, enougth to pay back the points $points += $price * SQL_NUMROWS($result_links); @@ -120,12 +120,12 @@ WHERE s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s) ORDER BY s.userid", SQL_FREERESULT($result_links); // Remove confirmation links from queue - $result_del = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_links WHERE bonus_id=%s", - array(bigintval($bid)), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_links WHERE bonus_id=%s", + array(bigintval($bid)), __FILE__, __LINE__); // Update status of order - $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_bonus SET data_type='DELETED' WHERE id=%s LIMIT 1", - array(bigintval($bid)), __FILE__, __LINE__); + SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_bonus SET data_type='DELETED' WHERE id=%s LIMIT 1", + array(bigintval($bid)), __FILE__, __LINE__); } // END - if } // END - while