]> git.mxchange.org Git - mailer.git/blobdiff - inc/monthly/monthly_newsletter.php
Counter for pending surfbar added
[mailer.git] / inc / monthly / monthly_newsletter.php
index fdbfd590545ccf3b992c60a92b098ef183271301..a23eea936ab759c8b48ffd3da83e8924ad586a18 100644 (file)
@@ -44,7 +44,7 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET'))) return;
 
 // Get current month (2 digits)
 $curr = date("m", time());
@@ -59,7 +59,7 @@ if ($_CONFIG['nl_month'] != $curr)
                while(list($uid, $until) = SQL_FETCHROW($result))
                {
                        // Update account
-                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET nl_receive='Y', nl_until='0' WHERE userid=%d LIMIT 1",
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET nl_receive='Y', nl_until='0' WHERE userid=%s LIMIT 1",
                         array(bigintval($uid)), __FILE__, __LINE__);
 
                        // Send email to him
@@ -67,12 +67,7 @@ if ($_CONFIG['nl_month'] != $curr)
                        SEND_EMAIL($uid, NL_MEMBER_RESET_SUBJECT, $msg);
 
                        // Send email to admin
-                       if (GET_EXT_VERSION("admins") >= "0.4.1") {
-                               SEND_ADMIN_EMAILS_PRO(NL_ADMIN_SUBJECT, "admin_newsletter_reset", "", $GLOBALS['userid']);
-                       } else {
-                               $msg = LOAD_EMAIL_TEMPLATE("admin_newsletter_reset", true, bigintval($uid));
-                               SEND_ADMIN_EMAILS(NL_ADMIN_SUBJECT, $msg);
-                       }
+                       SEND_ADMIN_NOTIFICATION(NL_ADMIN_SUBJECT, "admin_newsletter_reset", "", $GLOBALS['userid']);
                }
 
                // Free memory