Updated copyright year.
[mailer.git] / inc / modules / member / what-html_mail.php
index af20a603e796b4ee9eb19713e7a4d72dce328499..388104a2e90b883545adbee45da9ae5a690110cf 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 04/25/2004 *
- * ================                             Last change: 04/29/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 04/25/2004 *
+ * ===================                          Last change: 04/29/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-html_mail.php                               *
  * $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                  *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
+ * For more information visit: http://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 *
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
-       require($INC);
-} elseif (!IS_MEMBER()) {
-       LOAD_URL("modules.php?module=index");
-} elseif ((!EXT_IS_ACTIVE("html_mail")) && (!IS_ADMIN())) {
-       addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "html_mail");
-       return;
+       exit();
+} elseif (!isMember()) {
+       redirectToIndexMemberOnlyModule();
 }
 
 // Add description as navigation point
-ADD_DESCR("member", __FILE__);
+addYouAreHereLink('member', __FILE__);
+
+if ((!isExtensionActive('html_mail')) && (!isAdmin())) {
+       displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=html_mail%}');
+       return;
+} // END - if
 
 // Class was found and loaded
-if (IS_FORM_SENT()) {
+if (isFormSent()) {
        // Save settings
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET html='%s' WHERE userid=%s LIMIT 1",
-               array(REQUEST_POST('html'), getUserId()), __FILE__, __LINE__);
-       LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_SETTINGS_SAVED'));
+       sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `html`='%s' WHERE `userid`=%s LIMIT 1",
+               array(
+                       postRequestElement('html'),
+                       getMemberId()
+               ), __FILE__, __LINE__
+       );
+       displayMessage('{--MEMBER_SETTINGS_SAVED--}');
 } else {
-       // Load template for changing settings
-       $result = SQL_QUERY_ESC("SELECT html FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-               array(getUserId()), __FILE__, __LINE__);
-       list($mode) = SQL_FETCHROW($result);
-       SQL_FREERESULT($result);
+       // Prepare it
+       $content['html_y'] = '';
+       $content['html_n'] = '';
+       $content['html_' . strtolower(getUserData('html'))] = ' checked="checked"';
 
-       if ($mode == "Y") {
-               define('HTML_Y', " checked=\"checked\"");
-               define('HTML_N', "");
-       } else {
-               define('HTML_N', " checked=\"checked\"");
-               define('HTML_Y', "");
-       }
-       LOAD_TEMPLATE("member_html_mail_settings");
+       // Load main template
+       loadTemplate('member_html_mail_settings', FALSE, $content);
 }
 
-//
+// [EOF]
 ?>