X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-send_newsletter.php;h=f18caeab52bc8b1655e30476b0564937543ee700;hp=8e12bd96a15a3711247f6ce8b2e5e0923fb6828a;hb=7989ec603971c0dc8dc35d8be4e72f8098b83baa;hpb=357b2ca133fc1f89db74097955c366cb4bee6996 diff --git a/inc/modules/admin/what-send_newsletter.php b/inc/modules/admin/what-send_newsletter.php index 8e12bd96a1..f18caeab52 100644 --- a/inc/modules/admin/what-send_newsletter.php +++ b/inc/modules/admin/what-send_newsletter.php @@ -40,25 +40,22 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { // Add description as navigation point ADD_DESCR("admin", __FILE__); -if (isset($_POST['ok'])) -{ - $result = SQL_QUERY("SELECT userid, email FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' AND nl_receive='Y' ORDER BY userid", __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) - { +if (isset($_POST['ok'])) { + $result = SQL_QUERY("SELECT userid, email +FROM `{!_MYSQL_PREFIX!}_user_data` +WHERE `status`='CONFIRMED' AND nl_receive='Y' +ORDER BY userid ASC", __FILE__, __LINE__); + if (SQL_NUMROWS($result) > 0) { // Members are available so we can send out the newsletter! - while (list($id, $email) = SQL_FETCHROW($result)) - { + while (list($id, $email) = SQL_FETCHROW($result)) { // Construct mail... $template = "newsletter"; // Check for extension and sending-mode - if (!EXT_IS_ACTIVE("html_mail", true) && ($_POST['mode'] == "html")) - { + if (!EXT_IS_ACTIVE("html_mail", true) && ($_POST['mode'] == "html")) { // Set mode to text mode $_POST['mode'] == "text"; - } - elseif ($_POST['mode'] == "html") - { + } elseif ($_POST['mode'] == "html") { // Set HTML templates $template = "newsletter_html"; } @@ -77,20 +74,15 @@ if (isset($_POST['ok'])) SQL_FREERESULT($result); // Output message - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NL_SEND_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NL_SEND_DONE')); } -} - else -{ +} else { // Copy data into constants for the template and load it define('_DATESTAMP', MAKE_DATETIME(time(), "3")); - if (EXT_IS_ACTIVE("html_mail")) - { + if (EXT_IS_ACTIVE("html_mail")) { // Load template with HTML mode LOAD_TEMPLATE("admin_newsletter"); - } - else - { + } else { // Load template with only text mode LOAD_TEMPLATE("admin_newsletter_nohtml"); }