]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-connect.php
Moved doTemplateFooBar() down (to match with other include files)
[mailer.git] / inc / mysql-connect.php
index bd91776d29aeff97a51e04932384e6dc5c7c8c9e..8243597d6629cef12ed24e8bb615e0c7d14ee839 100644 (file)
@@ -18,6 +18,7 @@
  * 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 *
@@ -71,6 +72,9 @@ initFatalMessages();
 // Init message system
 initMessages();
 
+// Enable HTML templates by default
+enableTemplateHtml();
+
 // Are we in installation phase?
 if ((!isInstalling()) && (!isInstallationPhase())) {
        // Load configuration file(s) here
@@ -82,7 +86,7 @@ if ((!isInstalling()) && (!isInstallationPhase())) {
        // CSS array
        initExtensionCssFiles();
 
-       if ((!empty($GLOBALS['mysql']['host'])) && (!empty($GLOBALS['mysql']['login'])) && (!empty($GLOBALS['mysql']['password'])) && (!empty($GLOBALS['mysql']['dbase']))) {
+       if ((!empty($GLOBALS['mysql']['host'])) && (!empty($GLOBALS['mysql']['login'])) && (!empty($GLOBALS['mysql']['dbase']))) {
                // Connect to DB
                SQL_CONNECT($GLOBALS['mysql']['host'], $GLOBALS['mysql']['login'], $GLOBALS['mysql']['password'], __FILE__, __LINE__);
 
@@ -117,26 +121,22 @@ if ((!isInstalling()) && (!isInstallationPhase())) {
                                }
                        } else {
                                // Wrong database?
-                               addFatalMessage(__FILE__, __LINE__, getMessage('WRONG_DB_SELECTED'));
+                               addFatalMessage(__FILE__, __LINE__, '{--WRONG_DB_SELECTED--}');
                        }
                } else {
                        // No link to database!
-                       addFatalMessage(__FILE__, __LINE__, getMessage('NO_DB_LINK'));
+                       addFatalMessage(__FILE__, __LINE__, '{--NO_DB_LINK--}');
                }
        } else {
                // Maybe you forgot to enter your MySQL data?
-               addFatalMessage(__FILE__, __LINE__, getMessage('MYSQL_DATA_MISSING'));
+               addFatalMessage(__FILE__, __LINE__, '{--MYSQL_DATA_MISSING--}');
        }
 } else {
-       ///////////////////////////////////////////////////
-       // Include neccessary functions for installation //
-       ///////////////////////////////////////////////////
-
        // Default output is 'direct' for HTML output
        setConfigEntry('OUTPUT_MODE', 'direct');
 
        // This hack prevents a backtrace in CSS output
-       if (getOutputMode() == 1) {
+       if (getScriptOutputMode() == 1) {
                // Problem with config so set output mode
                setConfigEntry('OUTPUT_MODE', 'render');
        } // END - if
@@ -150,20 +150,17 @@ if ((!isInstalling()) && (!isInstallationPhase())) {
                loadIncludeOnce($inc);
        } // END - foreach
 
-       // Init filter system here
-       initFilterSystem();
-
-       // Are we installation routine?
-       if ((!isInstalling()) && (getOutputMode() != 1) && (getOutputMode() != -1)) {
-               // You have to install first!
-               redirectToUrl('install.php');
-       } // END - if
-
        // Load cache
        loadIncludeOnce('inc/load_cache.php');
 
        // Run the init filter chain
        runFilterChain('init');
+
+       // Are we installation routine?
+       if ((!isInstalling()) && (getScriptOutputMode() != 1) && (getScriptOutputMode() != -1)) {
+               // You have to install first!
+               redirectToUrl('install.php');
+       } // END - if
 }
 
 // Handle fatal errors