X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmonthly%2Fmonthly_newsletter.php;h=ed7eb9205b911b0e470b34fa8bfe3b564b851d34;hb=3e64a94e122e30dd66db07fd8c8cfae05871c460;hp=1afaf04c616755620faf3d42db60b6d859db5980;hpb=19cd0d37b2bcbf9dd4f3c38a9cecd7f5011d6b66;p=mailer.git diff --git a/inc/monthly/monthly_newsletter.php b/inc/monthly/monthly_newsletter.php index 1afaf04c61..ed7eb9205b 100644 --- a/inc/monthly/monthly_newsletter.php +++ b/inc/monthly/monthly_newsletter.php @@ -44,12 +44,12 @@ 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()); -if ($_CONFIG['nl_month'] != $curr) +if ($_CONFIG['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__); @@ -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 @@ -72,12 +72,6 @@ if ($_CONFIG['nl_month'] != $curr) // Free memory SQL_FREERESULT($result); - - // Update last month - $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET nl_month='%s' WHERE config=0 LIMIT 1", - array($curr), __FILE__, __LINE__); - - // Destroy cache } }