more boolean constants improved
authorRoland Häder <roland@mxchange.org>
Fri, 22 Feb 2008 22:21:33 +0000 (22:21 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 22 Feb 2008 22:21:33 +0000 (22:21 +0000)
inc/db/lib-mysql3.php
inc/footer.php
inc/functions.php
inc/install-inc.php
inc/mysql-connect.php

index 0c2b15b17f24bf7e8715cdf2449928196ea0820a..0cff40c6fc061fc5840336ba23c4ebd714e352b0 100644 (file)
@@ -59,7 +59,7 @@ function SQL_QUERY($sql_string, $F, $L)
         // Debug output
         //* DEBUG: */ print "Query=<pre>".$sql_string."</pre>, affected=<b>".SQL_AFFECTEDROWS()."</b>, numrows=<b>".SQL_NUMROWS($result)."</b><br />\n";
 
-       if (($CSS != "1") && ($CSS != "-1") && (DEBUG_MODE) && (DEBUG_SQL))
+       if (($CSS != "1") && ($CSS != "-1") && (isBooleanConstantAndTrue('DEBUG_MODE')) && (DEBUG_SQL))
        {
                //
                // Debugging stuff...
index 5f520f237280bc56150aaad15897d797366736b1..85ebb5be438e37a5517ba945f8ed461532595638 100644 (file)
@@ -48,7 +48,7 @@ if (($footer != "1") && ($footer != "2") && ($CSS != "1")) {
        }
 
        // Shall we display the copyright notice?
-       if ((empty($frame)) && (basename($_SERVER['PHP_SELF']) != "mailid_top.php") && (WRITE_FOOTER == true)) {
+       if ((empty($frame)) && (basename($_SERVER['PHP_SELF']) != "mailid_top.php") && ((isBooleanConstantAndTrue('WRITE_FOOTER ')))) {
                LOAD_TEMPLATE("copyright");
        }
 
index 150de6cc595ab853a719d60bdd373325191b3d86..30106b29732fc3060fd16093aff4da1ed3ce91fc 100644 (file)
@@ -320,7 +320,7 @@ function LOAD_TEMPLATE($template, $return=false, $content="") {
                        // Output direct
                        OUTPUT_HTML($ret);
                }
-       } elseif (DEBUG_MODE) {
+       } elseif (isBooleanConstantAndTrue('DEBUG_MODE')) {
                // Warning, empty output!
                return "E:".$template."<br />\n";
        }
@@ -355,7 +355,7 @@ function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML='N', $FROM="") {
                        // Append header
                        $FROM .= LOAD_EMAIL_TEMPLATE("header");
                }
-       } elseif (DEBUG_MODE) {
+       } elseif (isBooleanConstantAndTrue('DEBUG_MODE')) {
                if (empty($FROM)) {
                        // Load email header template
                        $FROM = LOAD_EMAIL_TEMPLATE("header");
@@ -367,7 +367,7 @@ function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML='N', $FROM="") {
 
        // Fix HTML parameter (default is no!)
        if (empty($HTML)) $HTML = 'N';
-       if (DEBUG_MODE) {
+       if (isBooleanConstantAndTrue('DEBUG_MODE')) {
                // In debug mode we want to display the mail instead of sending it away so we can debug this part
                echo "<PRE>
 ".htmlentities(trim($FROM))."
index 14d36d3efbf2a59d71d5f836be289c55d0383fcf..9d9f1c165ab948f7c993ba98882843644b9e625c 100644 (file)
@@ -264,10 +264,10 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
   <TD>
     <SELECT name=\"warn_no_pass\" size=\"1\" class=\"install_select\">
       <OPTION value=\"true\"");
-               if (warn_no_pass) OUTPUT_HTML(" selected=\"selected\"");
+               if (isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
                OUTPUT_HTML(">".YES."</OPTION>
       <OPTION value=\"false\"");
-               if (!warn_no_pass) OUTPUT_HTML(" selected=\"selected\"");
+               if (!isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
                OUTPUT_HTML(">".NO."</OPTION>
     </SELECT>
   </TD>
@@ -278,10 +278,10 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
   <TD>
     <SELECT name=\"wfooter\" size=\"1\" class=\"install_select\">
       <OPTION value=\"true\"");
-               if (WRITE_FOOTER) OUTPUT_HTML(" selected=\"selected\"");
+               if (isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
                OUTPUT_HTML(">".YES."</OPTION>
       <OPTION value=\"false\"");
-               if (!WRITE_FOOTER) OUTPUT_HTML(" selected=\"selected\"");
+               if (!isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
                OUTPUT_HTML(">".NO."</OPTION>
     </SELECT>
   </TD>
index 6f2f6182a12a7f94a2e0f0dc9aa52922d2a9d808..c4aca483a49de8b549663984b00a8cb111b1cccc 100644 (file)
@@ -60,7 +60,7 @@ if ((empty($MySQL['login'])) && (!isBooleanConstantAndTrue('mxchange_installing'
                // Please run the installation script (maybe again)
                die(DIE_RUN_INSTALL_MYSQL);
        }
-} elseif ((!isBooleanConstantAndTrue('mxchange_installing')) && (!isset($_GET['installing'])) && (empty($MySQL['password'])) && (warn_no_pass)) {
+} elseif ((!isBooleanConstantAndTrue('mxchange_installing')) && (!isset($_GET['installing'])) && (empty($MySQL['password'])) && (isBooleanConstantAndTrue('warn_no_pass'))) {
        // No database password entered!!!
        echo "<STRONG>".LANG_WARNING.":</STRONG> ".WARN_NULL_PASSWORD;
 }
@@ -121,7 +121,7 @@ LIMIT 1", __FILE__, __LINE__);
                                        require_once(PATH."inc/mysql-manager.php"); // Functions which interact with the database
 
                                        // Run daily reset
-                                       if ((date("d", $_CONFIG['last_update']) != date("d", time()) || (DEBUG_MODE == true)) && (!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1)) {
+                                       if ((date("d", $_CONFIG['last_update']) != date("d", time()) || ((isBooleanConstantAndTrue('DEBUG_MODE')))) && (!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1)) {
                                                // Do daily things in external PHP file but only when script is completely setup
                                                $INC_POOL[] = PATH."inc/reset/reset_daily.php";