X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-send_newsletter.php;h=cbafde7b701b6df41167397b46757c19498e8ef5;hb=1c3cf7c8bd60ea09a2b268e37a2cb2d0ee0cdeef;hp=cf3f96306623e929835a2c1d4507b65810decb8e;hpb=b8aa17b98b99c27eafbdca0fa090bae63527da9a;p=mailer.git diff --git a/inc/modules/admin/what-send_newsletter.php b/inc/modules/admin/what-send_newsletter.php index cf3f963066..cbafde7b70 100644 --- a/inc/modules/admin/what-send_newsletter.php +++ b/inc/modules/admin/what-send_newsletter.php @@ -17,7 +17,7 @@ * Needs to be in all Files and every File needs "svn propset * * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * - * Copyright (c) 2003 - 2008 by Roland Haeder * + * Copyright (c) 2003 - 2009 by Roland Haeder * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -37,19 +37,18 @@ ************************************************************************/ // Some security stuff... -if ((!defined('__SECURITY')) || (!IS_ADMIN())) { - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php'; - require($INC); -} +if ((!defined('__SECURITY')) || (!isAdmin())) { + die(); +} // END - if // Add description as navigation point -ADD_DESCR('admin', __FILE__); +addMenuDescription('admin', __FILE__); if (isFormSent()) { $result = SQL_QUERY("SELECT `userid`, `email` FROM - `{!_MYSQL_PREFIX!}_user_data` + `{?_MYSQL_PREFIX?}_user_data` WHERE `status`='CONFIRMED' AND `nl_receive`='Y' ORDER BY @@ -61,42 +60,41 @@ ORDER BY $template = 'newsletter'; // Check for extension and sending-mode - if (!EXT_IS_ACTIVE('html_mail', true) && (REQUEST_POST('mode') == 'html')) { + if (!isExtensionActive('html_mail', true) && (postRequestElement('mode') == 'html')) { // Set mode to text mode - REQUEST_POST('mode') == 'text'; - } elseif (REQUEST_POST('mode') == 'html') { + postRequestElement('mode') == 'text'; + } elseif (postRequestElement('mode') == 'html') { // Set HTML templates $template = 'newsletter_html'; } // Compile message - REQUEST_SET_POST('text', COMPILE_CODE(REQUEST_POST('text'))); + setRequestPostElement('text', compileCode(postRequestElement('text'))); // Load template - $message = LOAD_EMAIL_TEMPLATE($template, array('text' => REQUEST_POST('text')), $content['userid']); + $message = loadEmailTemplate($template, array('text' => postRequestElement('text')), $content['userid']); // ... and send it away! - SEND_NEWSLETTER($content['email'], REQUEST_POST('subject'), $message, REQUEST_POST('mode')); + sendNewsletter($content['email'], postRequestElement('subject'), $message, postRequestElement('mode')); } // Free memory SQL_FREERESULT($result); // Output message - LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_NL_SEND_DONE')); + loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NL_SEND_DONE')); } } else { // Copy data into constants for the template and load it - // @TODO Rewrite this constant - define('_DATESTAMP', generateDateTime(time(), '3')); - if (EXT_IS_ACTIVE('html_mail')) { + $content['datestamp'] = generateDateTime(time(), 3); + if (isExtensionActive('html_mail')) { // Load template with HTML mode - LOAD_TEMPLATE('admin_newsletter'); + loadTemplate('admin_newsletter', false, $content); } else { // Load template with only text mode - LOAD_TEMPLATE('admin_newsletter_nohtml'); + loadTemplate('admin_newsletter_nohtml', false, $content); } } -// +// [EOF] ?>