]> git.mxchange.org Git - mailer.git/blobdiff - mailid_top.php
More globals rewritten, see #100
[mailer.git] / mailid_top.php
index b52f9740fda920872fbae5ebea62f413db87765a..240588bcfa67143921ed85664b790469f948c9e9 100644 (file)
 require("inc/libs/security_functions.php");
 
 // Init "action" and "what"
-global $what, $action;
-$GLOBALS['what'] = ""; $GLOBALS['action'] = "";
+$GLOBALS['what'] = "";
+$GLOBALS['action'] = "";
 
 // Tell everyone we are in this module
-$GLOBALS['module'] = "mailid";  $CSS = 0;
+$GLOBALS['module'] = "mailid"; 
+$GLOBALS['output_mode'] = 0;
 
 // Load the required file(s)
 require("inc/config.php");
@@ -48,7 +49,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
        // Is the extension active
        if (!EXT_IS_ACTIVE("mailid", true)) {
                // Is not activated/installed yet!
-               addFatalMessage(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"));
+               addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "mailid");
        } // END - if
 
        // Secure all data
@@ -202,6 +203,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                                                        define('_TEMPLATE_BANNER', LOAD_TEMPLATE("mailid_banner", true));
 
                                                                        // Only when user extension = v0.1.2: Update mails-confirmed counter
+                                                                       // @TODO Rewrite these blocks to filter
                                                                        if (GET_EXT_VERSION("user") >= "0.1.2") {
                                                                                // Update counter
                                                                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET mails_confirmed=mails_confirmed + 1 WHERE userid=%s LIMIT 1",
@@ -285,22 +287,18 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                                                        break;
 
                                                                case "confirm":
-                                                                       if ($code > 0)
-                                                                       {
+                                                                       if ($code > 0) {
                                                                                // Export data into constants for the template
                                                                                define('_CODE_VALUE', $code);
                                                                                define('_UID_VALUE' , $url_uid );
                                                                                define('_TYPE_VALUE', $type);
                                                                                define('_DATA_VALUE', $DATA);
                                                                                define('_TEMPLATE_BANNER', LOAD_TEMPLATE("mailid_banner", true));
-                                                                               if (getConfig('code_length') > 0)
-                                                                               {
+                                                                               if (getConfig('code_length') > 0) {
                                                                                        // Generate Code
                                                                                        define('_IMAGE_CODE', IMG_CODE($code, $type, $DATA, $url_uid));
                                                                                        $templ = "mailid_enter_code";
-                                                                               }
-                                                                                else
-                                                                               {
+                                                                               } else {
                                                                                        // Disabled code
                                                                                        define('__GFX_CODE', $img_code);
                                                                                        $templ = "mailid_confirm_buttom";
@@ -325,24 +323,27 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                                                        // Load template
                                                                        LOAD_TEMPLATE("mailid_timer");
                                                                        break;
-                                                               }
+                                                               } // END - switch
+                                                       } else {
+                                                               LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"member_failed\">{--MAIL_ALREADY_CONFIRMED--} (6)</div>");
                                                        }
-                                                        else LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"member_failed\">".MAIL_ALREADY_CONFIRMED." (6)</div>");
+                                               } else {
+                                                       LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"member_failed\">{--MAIL_ALREADY_CONFIRMED--} (5)</div>");
                                                }
-                                                else LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"member_failed\">".MAIL_ALREADY_CONFIRMED." (5)</div>");
+                                       } else {
+                                               LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"member_failed\">{--MAIL_ALREADY_CONFIRMED--} (4)</div>");
                                        }
-                                        else LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"member_failed\">".MAIL_ALREADY_CONFIRMED." (4)</div>");
                                } else {
                                        SQL_FREERESULT($result);
-                                       LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"member_failed\">".MAIL_ALREADY_CONFIRMED." (3)</div>");
+                                       LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"member_failed\">{--MAIL_ALREADY_CONFIRMED--} (3)</div>");
                                }
                        } else {
                                SQL_FREERESULT($result);
-                               LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"member_failed\">".MAIL_ALREADY_CONFIRMED." (2)</div>");
+                               LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"member_failed\">{--MAIL_ALREADY_CONFIRMED--} (2)</div>");
                        }
                } else {
                        SQL_FREERESULT($result);
-                       LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"member_failed\">".MAIL_ALREADY_CONFIRMED." (1)</div>");
+                       LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"member_failed\">{--MAIL_ALREADY_CONFIRMED--} (1)</div>");
                }
 
                // Insert footer if no image