<?php
/************************************************************************
- * MXChange v0.2.1 Start: 09/28/2003 *
- * =============== Last change: 03/04/2005 *
+ * Mailer v0.2.1-FINAL Start: 09/28/2003 *
+ * =================== Last change: 03/04/2005 *
* *
* -------------------------------------------------------------------- *
* File : what-send_newsletter.php *
* svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
`status`='CONFIRMED' AND `nl_receive`='Y'
ORDER BY
`userid` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Members are available so we can send out the newsletter!
while ($content = SQL_FETCHARRAY($result)) {
// Construct mail...
$template = 'newsletter';
// Check for extension and sending-mode
- if (!isExtensionActive('html_mail', true) && (postRequestElement('mode') == 'html')) {
+ if (!isExtensionActive('html_mail', true) && (postRequestParameter('mode') == 'html')) {
// Set mode to text mode
- postRequestElement('mode') == 'text';
- } elseif (postRequestElement('mode') == 'html') {
+ postRequestParameter('mode') == 'text';
+ } elseif (postRequestParameter('mode') == 'html') {
// Set HTML templates
$template = 'newsletter_html';
}
// Compile message
- setRequestPostElement('text', compileCode(postRequestElement('text')));
+ setPostRequestParameter('text', preCompileCode(postRequestParameter('text')));
// Load template
- $message = loadEmailTemplate($template, array('text' => postRequestElement('text')), $content['userid']);
+ $message = loadEmailTemplate($template, array('text' => postRequestParameter('text')), $content['userid']);
// ... and send it away!
- sendNewsletter($content['email'], postRequestElement('subject'), $message, postRequestElement('mode'));
- }
-
- // Free memory
- SQL_FREERESULT($result);
+ sendNewsletter($content['email'], postRequestParameter('subject'), $message, postRequestParameter('mode'));
+ } // END - while
// Output message
- loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NL_SEND_DONE'));
- }
+ loadTemplate('admin_settings_saved', false, '{--ADMIN_NL_SEND_DONE--}');
+ } // END - if
+
+ // Free memory
+ SQL_FREERESULT($result);
} else {
// Copy data into constants for the template and load it
$content['datestamp'] = generateDateTime(time(), 3);
+
+ // Extension html_mail installed?
if (isExtensionActive('html_mail')) {
// Load template with HTML mode
loadTemplate('admin_newsletter', false, $content);