]> git.mxchange.org Git - mailer.git/blobdiff - inc/purge/purge-general.php
Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / purge / purge-general.php
index 3def007242ec6ff979174b56184c69057a75473b..33cc39f1df2247432edc41fdaf08bc0c34016cf0 100644 (file)
@@ -63,7 +63,7 @@ WHERE
        (UNIX_TIMESTAMP() - `timestamp_ordered`) >= {?auto_purge?}
 ORDER BY
        `userid` ASC', __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Start deleting procedure
                $userid = NULL;
                $points = '0';
@@ -112,14 +112,14 @@ ORDER BY
        if (isExtensionActive('bonus', TRUE)) {
                // Check for bonus campaigns
                $result = sqlQuery("SELECT `id`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `data_type`='SEND' AND `timestamp` <= {?auto_purge?} ORDER BY `id` ASC", __FILE__, __LINE__);
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // Start deleting procedure
                        $points = '0';
                        while ($content = sqlFetchArray($result)) {
                                // Check if confirmation links are purged or not
                                $result_links = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
                                        array(bigintval($content['id'])), __FILE__, __LINE__);
-                               if (!ifSqlHasZeroNums($result_links)) {
+                               if (!ifSqlHasZeroNumRows($result_links)) {
                                        // At least one link was found, enougth to pay back the points
                                        $points += $content['points'] * sqlNumRows($result_links);