-<?php\r
-/************************************************************************\r
- * MXChange v0.2.1 Start: 09/28/2003 *\r
- * =============== Last change: 03/04/2005 *\r
- * *\r
- * -------------------------------------------------------------------- *\r
- * File : what-send_newsletter.php *\r
- * -------------------------------------------------------------------- *\r
- * Short description : Handle HTML or text newsletter *\r
- * -------------------------------------------------------------------- *\r
- * Kurzbeschreibung : Verwalten von HTML- oder Text-Newslettern *\r
- * -------------------------------------------------------------------- *\r
- * *\r
- * -------------------------------------------------------------------- *\r
- * Copyright (c) 2003 - 2008 by Roland Haeder *\r
- * For more information visit: http://www.mxchange.org *\r
- * *\r
- * This program is free software; you can redistribute it and/or modify *\r
- * it under the terms of the GNU General Public License as published by *\r
- * the Free Software Foundation; either version 2 of the License, or *\r
- * (at your option) any later version. *\r
- * *\r
- * This program is distributed in the hope that it will be useful, *\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\r
- * GNU General Public License for more details. *\r
- * *\r
- * You should have received a copy of the GNU General Public License *\r
- * along with this program; if not, write to the Free Software *\r
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *\r
- * MA 02110-1301 USA *\r
- ************************************************************************/\r
-\r
-// Some security stuff...\r
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))\r
-{\r
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";\r
- require($INC);\r
-}\r
-// Add description as navigation point\r
-ADD_DESCR("admin", basename(__FILE__));\r
-\r
-OPEN_TABLE("100%", "admin_content admin_content_align", "");\r
-if (isset($_POST['ok']))\r
-{\r
- $result = SQL_QUERY("SELECT userid, email FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' AND nl_receive='Y' ORDER BY userid", __FILE__, __LINE__);\r
- if (SQL_NUMROWS($result) > 0)\r
- {\r
- // Members are available so we can send out the newsletter!\r
- while (list($id, $email) = SQL_FETCHROW($result))\r
- {\r
- // Construct mail...\r
- $template = "newsletter";\r
-\r
- // Check for extension and sending-mode\r
- if (!EXT_IS_ACTIVE("html_mail", true) && ($_POST['mode'] == "html"))\r
- {\r
- // Set mode to text mode\r
- $_POST['mode'] == "text";\r
- }\r
- elseif ($_POST['mode'] == "html")\r
- {\r
- // Set HTML templates\r
- $template = "newsletter_html";\r
- }\r
-\r
- // Compile message\r
- $_POST['text'] = stripslashes(COMPILE_CODE($_POST['text']));\r
-\r
- // Load template\r
- $msg = LOAD_EMAIL_TEMPLATE($template, $_POST['text'], $id);\r
-\r
- // ... and send it away!\r
- SEND_NEWSLETTER($email, $_POST['subject'], $msg, $_POST['mode']);\r
- }\r
-\r
- // Free memory\r
- SQL_FREERESULT($result);\r
-\r
- // Output message\r
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NL_SEND_DONE);\r
- }\r
-}\r
- else\r
-{\r
- // Copy data into constants for the template and load it\r
- define('_DATESTAMP', MAKE_DATETIME(time(), "3"));\r
- if (EXT_IS_ACTIVE("html_mail"))\r
- {\r
- // Load template with HTML mode\r
- LOAD_TEMPLATE("admin_newsletter");\r
- }\r
- else\r
- {\r
- // Load template with only text mode\r
- LOAD_TEMPLATE("admin_newsletter_nohtml");\r
- }\r
-}\r
-CLOSE_TABLE();\r
-//\r
-?>\r
+<?php
+/************************************************************************
+ * MXChange v0.2.1 Start: 09/28/2003 *
+ * =============== Last change: 03/04/2005 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : what-send_newsletter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Handle HTML or text newsletter *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Verwalten von HTML- oder Text-Newslettern *
+ * -------------------------------------------------------------------- *
+ * *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
+{
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+ require($INC);
+}
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+OPEN_TABLE("100%", "admin_content admin_content_align", "");
+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)
+ {
+ // Members are available so we can send out the newsletter!
+ 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"))
+ {
+ // Set mode to text mode
+ $_POST['mode'] == "text";
+ }
+ elseif ($_POST['mode'] == "html")
+ {
+ // Set HTML templates
+ $template = "newsletter_html";
+ }
+
+ // Compile message
+ $_POST['text'] = stripslashes(COMPILE_CODE($_POST['text']));
+
+ // Load template
+ $msg = LOAD_EMAIL_TEMPLATE($template, $_POST['text'], $id);
+
+ // ... and send it away!
+ SEND_NEWSLETTER($email, $_POST['subject'], $msg, $_POST['mode']);
+ }
+
+ // Free memory
+ SQL_FREERESULT($result);
+
+ // Output message
+ LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NL_SEND_DONE);
+ }
+}
+ else
+{
+ // Copy data into constants for the template and load it
+ define('_DATESTAMP', MAKE_DATETIME(time(), "3"));
+ if (EXT_IS_ACTIVE("html_mail"))
+ {
+ // Load template with HTML mode
+ LOAD_TEMPLATE("admin_newsletter");
+ }
+ else
+ {
+ // Load template with only text mode
+ LOAD_TEMPLATE("admin_newsletter_nohtml");
+ }
+}
+CLOSE_TABLE();
+//
+?>