]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-newsletter.php
Rewritten to use isExtensionInstalledAndNewer() to save some calls/bugfix
[mailer.git] / inc / modules / member / what-newsletter.php
index cfb079145b69bd84f5587688e9a43a6ec099db7e..c6b4cb8744fd83df93b355817d4a4bfafdd4e359 100644 (file)
@@ -1,110 +1,4 @@
 <?php
-/************************************************************************
- * MXChange v0.2.1                                    Start: 02/12/2004 *
- * ================                             Last change: 01/07/2004 *
- *                                                                      *
- * -------------------------------------------------------------------- *
- * File              : what-                                            *
- * -------------------------------------------------------------------- *
- * Short description :                                                  *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung  :                                                  *
- * -------------------------------------------------------------------- *
- * $Revision::                                                        $ *
- * $Date::                                                            $ *
- * $Tag:: 0.2.1-FINAL                                                 $ *
- * $Author::                                                          $ *
- * 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                           *
- * 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 (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
-       require($INC);
-} elseif (!IS_MEMBER()) {
-       redirectToUrl('modules.php?module=index');
-} elseif ((!EXT_IS_ACTIVE('newsletter')) && (!IS_ADMIN())) {
-       addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveNotInstalledMessage('newsletter'));
-       return;
-}
-
-// Add description as navigation point
-ADD_DESCR('member', __FILE__);
-
-// Load status
-$result = SQL_QUERY_ESC("SELECT `nl_receive`, `nl_until`, `nl_timespan` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
-       array(getUserId()), __FILE__, __LINE__);
-list($status, $until, $span) = SQL_FETCHROW($result);
-SQL_FREERESULT($result);
-
-// Remember charge value
-define('__CHARGE_VALUE', translateComma(getConfig('nl_charge')));
-
-if ((isFormSent()) && ($status == 'Y') && ($span == '0')) {
-       // Save request
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET nl_timespan='".(getConfig('one_day') * 30)."' WHERE userid=%s LIMIT 1",
-               array(getUserId()), __FILE__, __LINE__);
-
-       // Load admin message
-       $admin_msg = LOAD_EMAIL_TEMPLATE('admin_newsletter_request', array(), getUserId());
-
-       // Add task
-       createNewTask('{--ADMIN_NL_SUBJECT--}', $admin_msg, 'NL_UNSUBSCRIBE', getUserId());
-
-       // Send mail to member
-       $message = LOAD_EMAIL_TEMPLATE('member_newsletter_request', array(), getUserId());
-       sendEmail(getUserId(), getMessage('NL_MEMBER_SUBJECT'), $message);
-
-       // Send mail to all admins
-       sendAdminNotification(getMessage('NL_ADMIN_SUBJECT'), 'admin_newsletter_request', array(), getUserId());
-
-       // Display message
-       LOAD_TEMPLATE('admin_settings_saved', false, getMessage('NL_MEMBER_REQUEST_DONE'));
-} elseif ($span > 0) {
-       // Already ordered
-       LOAD_TEMPLATE('admin_settings_saved', false, getMessage('NL_MEMBER_REQUEST_ALREADY'));
-} else {
-       // Load template for the note
-       define('NL_MEMBER_NOTE', LOAD_TEMPLATE('member_newsletter_note', true));
-
-       // Set status message and submit button
-       switch ($status) {
-               case 'Y': // Receives the newsletter
-                       define('__STATUS_VALUE', getMessage('NL_MEMBER_ON'));
-                       define('__UNTIL_VALUE' , '');
-                       define('NL_SUBMIT'     , getMessage('NL_MEMBER_SUBMIT_OFF'));
-                       break;
-
-               case 'N': // Does not receive the newsletter
-                       define('__STATUS_VALUE', getMessage('NL_MEMBER_OFF'));
-                       define('__UNTIL_VALUE' , generateDateTime($until, '2'));
-                       define('NL_SUBMIT'     , getMessage('NL_MEMBER_SUBMIT_ON'));
-                       break;
-       } // END - switch
-
-       // Load template and member settings
-       LOAD_TEMPLATE('member_newsletter');
-}
-
-// [EOF]
+// @DEPRECATED
 ?>