Rewrites/fixes for handling config entries in SQLs
[mailer.git] / inc / fix_menu.php
index b50b07f..31d3f96 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 10/22/2009 *
- * ===============                              Last change: 10/22/2009 *
+ * Mailer v0.2.1-FINAL                                Start: 10/22/2009 *
+ * ===================                          Last change: 10/22/2009 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : fix_menu.php                                     *
@@ -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 *
@@ -86,17 +87,19 @@ foreach (array('guest','member','admin') as $menu) {
        // Free result
        SQL_FREERESULT($result);
 
+       // Init sqls
+       initSqls();
+
        // Now insert our unqiue key for action-what combination
-       SQL_QUERY_ESC("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP KEY `action_what`",
-               array($menu), __FILE__, __LINE__);
-       SQL_QUERY_ESC("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE `action_what` (`action` , `what`)",
-               array($menu), __FILE__, __LINE__);
+       addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP KEY `action_what`", $menu));
+       addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE `action_what` (`action` , `what`)", $menu));
 
        // Now insert our unqiue key for what
-       SQL_QUERY_ESC("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP KEY `what`",
-               array($menu), __FILE__, __LINE__);
-       SQL_QUERY_ESC("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE `what` (`what`)",
-               array($menu), __FILE__, __LINE__);
+       addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP KEY `what`", $menu));
+       addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE `what` (`what`)", $menu));
+
+       // And run all
+       runFilterChain('run_sqls');
 } // END - foreach
 
 // [EOF]