Fixes and cleanups
[mailer.git] / inc / filters.php
index 903dd6978b5286c6496fc313eac3b3e479da8744..92a0174bb59e2b548634eac357a494c6986846eb 100644 (file)
@@ -17,7 +17,7 @@
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * 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 *
@@ -60,8 +60,12 @@ function FILTER_FLUSH_FILTERS () {
 
        // Is the extension ext-sql_patches updated?
        if ((!isExtensionInstalled('sql_patches')) || (isExtensionInstalledAndOlder('sql_patches', '0.5.9'))) {
+               // Log only in debug mode
+               if (isDebugModeEnabled()) {
+                       logDebugMessage(__FUNCTION__, __LINE__, 'Cannot flush filters, sql_patches might be missing. isExtensionInstalled()=' . intval(isExtensionInstalled('sql_patches')) . ',isExtensionInstalledAndOlder()=' . intval(isExtensionInstalledAndOlder('sql_patches', '0.5.9')));
+               } // END - if
+
                // Abort silently here
-               logDebugMessage(__FUNCTION__, __LINE__, 'Cannot flush filters, sql_patches might be missing. isExtensionInstalled()=' . isExtensionInstalled('sql_patches') . ',isExtensionInstalledAndOlder()=' . isExtensionInstalledAndOlder('sql_patches', '0.5.9'));
                return false;
        } // END - if
 
@@ -252,7 +256,7 @@ function FILTER_RUN_SQLS ($filterData) {
        if ((isSqlsValid()) && ((!isset($filterData['dry_run'])) || ($filterData['dry_run'] == false))) {
                // Run SQL commands
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '- Found ' . countSqls() . ' queries to run.');
-               foreach (getSqls() as $mode=>$sqls) {
+               foreach (getSqls() as $mode => $sqls) {
                        // Debug message
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'mode=' . $mode . ',count()=' . count($sqls));
 
@@ -1113,8 +1117,8 @@ function FILTER_ACTIVATE_EXCHANGE () {
        // Check total amount of users
        if (getTotalConfirmedUser() >= getActivateXchange()) {
                // Activate System
-               addSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='N', `hidden`='N', `mem_only`='Y' WHERE `module`='order' LIMIT 1");
-               addSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='order' OR `what`='unconfirmed' LIMIT 2");
+               addSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='N',`hidden`='N',`mem_only`='Y' WHERE `module`='order' LIMIT 1");
+               addSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y',`locked`='N' WHERE `what`='order' OR `what`='unconfirmed' LIMIT 2");
 
                // Run SQLs
                runFilterChain('run_sqls');