Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / purge / purge-unconfirmed.php
index 0371f26ca3aacd18904e9751b5f42597f80f2718..bb61a6e37da6e2822d89d4369c532bb261c0c937 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -43,14 +43,16 @@ if (!defined('__SECURITY')) {
 // Abort if autopurge is not active or disabled by admin
 if ((!isExtensionActive('autopurge')) || (!isAutoPurgingActive())) {
        // Abort here
-       return false;
+       return FALSE;
 } // END - if
 
 // Shall I auto-purge unconfirmed accounts?
 if (getConfig('autopurge_unconfirmed') == 'Y') {
        // Init variables and find unconfirmed accounts which I shall auto-purge;
-       $result_uncon = SQL_QUERY("SELECT
-       `userid`,`email`,`joined`
+       $result_uncon = sqlQuery("SELECT
+       `userid`,
+       `email`,
+       `joined`
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
@@ -58,13 +60,13 @@ WHERE
        (UNIX_TIMESTAMP() - `joined`) >= {?ap_unconfirmed_time?}
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
-       if (!SQL_HASZERONUMS($result_uncon)) {
+       if (!ifSqlHasZeroNumRows($result_uncon)) {
                // Prepare variable...
                $userids = '';
                $content['time'] = (getApUnconfirmedTime()  / 60 / 60);
 
                // Delete inactive accounts
-               while ($row = SQL_FETCHARRAY($result_uncon)) {
+               while ($row = sqlFetchArray($result_uncon)) {
                        // Merge both arrays
                        $content = merge_array($content, $row);
 
@@ -79,16 +81,16 @@ ORDER BY
                } // END - while
 
                // Remove last comma
-               $userids = str_replace(', ', chr(10), substr($userids, 0, -2));
+               $userids = str_replace(', ', PHP_EOL, substr($userids, 0, -2));
 
                // Send mail notification to admin
                if (getConfig('ap_un_notify') == 'Y') {
-                       sendAdminNotification('{--ADMIN_AUTOPURGE_UNCONFIRMED_SUBJECT--}', 'admin_autopurge_unconfirmed', $userids);
+                       sendAdminNotification('{--ADMIN_AUTOPURGE_UNCONFIRMED_SUBJECT--}', 'admin_purge_unconfirmed', $userids);
                } // END - if
        } // END - if
 
        // Free memory
-       SQL_FREERESULT($result_uncon);
+       sqlFreeResult($result_uncon);
 } // END - if
 
 // [EOF]