X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmonthly%2Fmonthly_newsletter.php;h=235bbdf8a0f1196c811953795a1455279682e7bc;hb=a47a9c49a7813304ac78deb3741bdd85e6d50912;hp=776c99bd7f316d66181e95ffdcc1c3a813306864;hpb=44aadef1eae9767d1d54da2821119aa60a5ee4f6;p=mailer.git diff --git a/inc/monthly/monthly_newsletter.php b/inc/monthly/monthly_newsletter.php index 776c99bd7f..235bbdf8a0 100644 --- a/inc/monthly/monthly_newsletter.php +++ b/inc/monthly/monthly_newsletter.php @@ -40,23 +40,21 @@ if (!defined('__SECURITY')) { } // Do not execute when script is in CSS mode or no daily reset -if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; +if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return; +//* DEBUG: */ echo basename(__FILE__)."
\n"; // Get current month (2 digits) $curr = date("m", time()); -if ($_CONFIG['last_month'] != $curr) -{ +if (getConfig('last_month') != $curr) { // Check for unsubscribed members - $result = SQL_QUERY("SELECT userid, nl_until FROM "._MYSQL_PREFIX."_user_data WHERE nl_receive='N' ORDER BY userid", __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) - { + $result = SQL_QUERY("SELECT userid, nl_until FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nl_receive='N' ORDER BY userid", __FILE__, __LINE__); + if (SQL_NUMROWS($result) > 0) { // Some unsubscriptions are found so we reset them to receive newsletters - while(list($uid, $until) = SQL_FETCHROW($result)) - { + 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=%s LIMIT 1", - array(bigintval($uid)), __FILE__, __LINE__); + 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 $msg = LOAD_EMAIL_TEMPLATE("member_newsletter_reset", true, bigintval($uid));