Removed all LIMIT x statements from extension removal queries, several minor fixes
authorRoland Häder <roland@mxchange.org>
Sat, 7 Mar 2009 07:19:03 +0000 (07:19 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 7 Mar 2009 07:19:03 +0000 (07:19 +0000)
46 files changed:
inc/extensions.php
inc/extensions/ext-active.php
inc/extensions/ext-admins.php
inc/extensions/ext-admintheme1.php
inc/extensions/ext-autopurge.php
inc/extensions/ext-bank.php
inc/extensions/ext-beg.php
inc/extensions/ext-birthday.php
inc/extensions/ext-bonus.php
inc/extensions/ext-booking.php
inc/extensions/ext-cache.php
inc/extensions/ext-country.php
inc/extensions/ext-debug.php
inc/extensions/ext-doubler.php
inc/extensions/ext-html_mail.php
inc/extensions/ext-logs.php
inc/extensions/ext-maintenance.php
inc/extensions/ext-mediadata.php
inc/extensions/ext-mods.php
inc/extensions/ext-newsletter.php
inc/extensions/ext-nickname.php
inc/extensions/ext-online.php
inc/extensions/ext-optimize.php
inc/extensions/ext-order.php
inc/extensions/ext-other.php
inc/extensions/ext-payout.php
inc/extensions/ext-primera.php
inc/extensions/ext-rallye.php
inc/extensions/ext-refback.php
inc/extensions/ext-register.php
inc/extensions/ext-removeip.php
inc/extensions/ext-repair.php
inc/extensions/ext-rewrite.php
inc/extensions/ext-sponsor.php
inc/extensions/ext-sql_patches.php
inc/extensions/ext-surfbar.php
inc/extensions/ext-task.php
inc/extensions/ext-theme.php
inc/extensions/ext-top10.php
inc/extensions/ext-transfer.php
inc/extensions/ext-usage.php
inc/extensions/ext-user.php
inc/extensions/ext-wernis.php
inc/extensions/ext-yoomedia.php
inc/install-inc.php
inc/modules/admin/admin-inc.php

index 1fd2977..5e94c32 100644 (file)
@@ -138,6 +138,21 @@ function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = tr
        // Is this extension already installed?
        if (EXT_IS_ACTIVE($ext_name)) return false;
 
+       // Is the task id zero? Then we need to auto-fix it here
+       if ($task_id == 0) {
+               // Try to find the task
+               $task_id = DETERMINE_EXTENSION_TASK_ID($ext_name);
+
+               // Still zero and not in dry-run?
+               if (($task_id == 0) && (!$dry_run)) {
+                       // Then request a bug report
+                       debug_report_bug(sprintf("%s: task_id is still zero after DETERMINE_EXTENSION_TASK_ID(%s)",
+                               __FUNCTION__,
+                               $ext_name
+                       ));
+               } // END - if
+       } // END - if
+
        // Init queries
        INIT_SQLS();
 
index 61a3106..66494ef 100644 (file)
@@ -57,8 +57,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='active' LIMIT 1");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_active' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='active'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_active'");
 
        // Unregister filter
        UNREGISTER_FILTER('online_extra_links', 'ADD_LINK_ACTIVE_LIST', true, $dry_run);
index 39402c3..0d31836 100644 (file)
@@ -59,7 +59,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='admins' LIMIT 6");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='admins'");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admins_acls`");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admins_mails`");
        ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP default_acl");
index ae20aba..55729a2 100644 (file)
@@ -53,9 +53,9 @@ switch ($EXT_LOAD_MODE)
 case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
        // Remove all other themes
        ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name LIKE 'admintheme%'");
-       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='stats' WHERE `what`='usr_online' LIMIT 1");
-       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='stats' WHERE `what`='email_stats' LIMIT 1");
-       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='misc' WHERE `what`='maintenance' LIMIT 1");
+       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='stats' WHERE `what`='usr_online'");
+       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='stats' WHERE `what`='email_stats'");
+       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='misc' WHERE `what`='maintenance'");
        break;
 
 case "remove": // Do stuff when removing extension
index baf2910..4542fb1 100644 (file)
@@ -66,7 +66,7 @@ case "remove": // Do stuff when removing extension
        {
                ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_bonus` MODIFY data_type ENUM('NEW','QUEUE','SEND') NOT NULL DEFAULT 'NEW'");
        }
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN('config_autopurge','list_autopurge') LIMIT 2");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN('config_autopurge','list_autopurge')");
        ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP ap_notified");
        break;
 
index eaf7987..1e507a8 100644 (file)
@@ -160,8 +160,8 @@ case "remove": // Do stuff when removing extension
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_transfers`");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_packages`");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_tanlist`");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='bank' LIMIT 14");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='bank' LIMIT 8");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='bank'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='bank'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 59cf530..af774a5 100644 (file)
@@ -72,9 +72,9 @@ PRIMARY KEY(id)
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_beg' OR `what`='list_beg' LIMIT 2");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='beg' LIMIT 1");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='beg' OR `what`='beg2' LIMIT 2");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_beg' OR `what`='list_beg'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='beg'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='beg' OR `what`='beg2'");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_beg_ips`");
        break;
 
index 18d328c..ffbfc09 100644 (file)
@@ -59,7 +59,7 @@ case "remove": // Do stuff when removing extension
        // SQL commands to run
        ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP birthday_sent");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_birthday`");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_birthday' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_birthday'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 17ec62a..d2459f3 100644 (file)
@@ -82,9 +82,9 @@ PRIMARY KEY  (id)
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN ('bonus','config_bonus','send_bonus','list_bonus','list_notifications') LIMIT 5");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='bonus' LIMIT 1");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='bonus' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN ('bonus','config_bonus','send_bonus','list_bonus','list_notifications')");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='bonus'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='bonus'");
        ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_links` MODIFY link_type ENUM('NORMAL') NOT NULL DEFAULT 'NORMAL'");
        ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_links` DROP bonus_id");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bonus`");
index 03d109f..e8f1079 100644 (file)
@@ -77,8 +77,8 @@ PRIMARY KEY(`id`)
 
 case "remove": // Do stuff when removing extension
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_book`");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN ('config_booking','list_booking') LIMIT 2");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='booking' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN ('config_booking','list_booking')");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='booking'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 887639c..fcf7e91 100644 (file)
@@ -61,7 +61,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_cache' OR `what`='cache_stats' LIMIT 2");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_cache','cache_stats')");
 
        // Unregister all filters
        UNREGISTER_FILTER('extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', true, $dry_run);
index 3f8702a..2d5ecda 100644 (file)
@@ -74,7 +74,7 @@ PRIMARY KEY(id)
 case "remove": // Do stuff when removing extension
        // SQL commands to run
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_countries`");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='country' LIMIT 2");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='country'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 07a2b73..848c541 100644 (file)
@@ -141,8 +141,8 @@ case "remove": // Do stuff when removing extension
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_debug_client`");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_debug_log`");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_debug_log_abuse`");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='debug' LIMIT 5");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='debug' LIMIT 6");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='debug'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='debug'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index cafcd84..0bf3f2b 100644 (file)
@@ -120,9 +120,9 @@ PRIMARY KEY(id)
 case "remove": // Do stuff when removing extension
        // SQL commands to run
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_doubler`");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='doubler' LIMIT 3");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='doubler' LIMIT 1");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='doubler' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='doubler'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='doubler'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='doubler'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index fc9de44..9dd2d09 100644 (file)
@@ -63,7 +63,7 @@ case "remove": // Do stuff when removing extension
        ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP html");
        ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_bonus` DROP html_msg");
        ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_pool` DROP html_msg");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='html_mail' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='html_mail'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 8099c4b..34c56bc 100644 (file)
@@ -58,7 +58,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='logs' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='logs'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 0aa42ad..2d5c8d7 100644 (file)
@@ -58,7 +58,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='maintenance' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='maintenance'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index d9147d1..eb5df54 100644 (file)
@@ -58,8 +58,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 case "remove": // Do stuff when removing extension
        // SQL commands to run
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_mediadata`");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_mediadata' LIMIT 1");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='mediadata' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_mediadata'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='mediadata'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 2e969a9..19bfafd 100644 (file)
@@ -59,7 +59,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='mods' LIMIT 3");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='mods'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index ac8d48e..0b24623 100644 (file)
@@ -57,8 +57,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='newsletter' AND what != 'send_newsletter' LIMIT 3");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='newsletter' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='newsletter' AND what != 'send_newsletter'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='newsletter'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 6f6632e..b195767 100644 (file)
@@ -59,8 +59,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='nickname' LIMIT 1");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN ('config_nickname','list_nickname') LIMIT 2");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='nickname'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN ('config_nickname','list_nickname')");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_nickname_history`");
        break;
 
index 1aa0222..9d87ada 100644 (file)
@@ -76,8 +76,8 @@ KEY `admin_member` (`is_admin`,`is_member`)
 case "remove": // Do stuff when removing extension
        // SQL commands to run
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_online`");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='usr_online' LIMIT 1");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='online' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='usr_online'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='online'");
 
        // Unregister filter
        UNREGISTER_FILTER('init', 'UPDATE_ONLINE_LIST', true, $dry_run);
index 97fc309..5dd1f18 100644 (file)
@@ -63,7 +63,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 case "remove": // Do stuff when removing extension
        // SQL commands to run
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_optimize_gain`");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='optimize' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='optimize'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 9dca71d..43fbadf 100644 (file)
@@ -57,7 +57,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_order' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_order'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 5a97a87..99a94cb 100644 (file)
@@ -57,7 +57,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_other' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_other'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 55e3476..4b1f7d4 100644 (file)
@@ -84,7 +84,7 @@ case "remove": // Do stuff when removing extension
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_payouts`");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_payout_types`");
        ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='payouts'");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='payout' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='payout'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 169ea94..db02d3f 100644 (file)
@@ -84,7 +84,7 @@ case "remove": // Do stuff when removing extension
        // SQL commands to run
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_primera`");
        ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='primera'");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='primera' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='primera'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 83fa1cf..336eb3a 100644 (file)
@@ -109,9 +109,9 @@ case "remove": // Do stuff when removing extension
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_rallye_users`");
 
        // Remove menus
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='rallye' LIMIT 4");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='rallyes' LIMIT 1");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='rallyes' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='rallye'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='rallyes'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='rallyes'");
 
        // Unregister filter
        UNREGISTER_FILTER('extra_autopurge', 'RALLYE_EXTRA_AUTOPURGE', true, $dry_run);
index 32aa44c..8f5c9ba 100644 (file)
@@ -71,8 +71,8 @@ KEY (`refid`)
 case "remove": // Do stuff when removing extension
        // SQL commands to run
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_refs`");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='refback' LIMIT 1");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN('config_refback','list_refback') LIMIT 2");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='refback'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN('config_refback','list_refback')");
        ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_refsystem` SET level=level-1");
        break;
 
index 947e997..823d933 100644 (file)
@@ -57,7 +57,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_register' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_register'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 11b7f14..1e0eb36 100644 (file)
@@ -66,7 +66,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_removeip' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_removeip'");
 
        // Remove filters
        UNREGISTER_FILTER('post_youhere_line', 'ADD_ANONYMITY_NOTICE', true, $dry_run);
index 8a48615..197f1a6 100644 (file)
@@ -58,7 +58,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='repair' LIMIT 5");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='repair'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 63f7076..28a8eca 100644 (file)
@@ -63,7 +63,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_rewrite' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_rewrite'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index a3eca42..61a4fde 100644 (file)
@@ -383,9 +383,9 @@ case "remove": // Do stuff when removing extension
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_campaign_assigns`");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_admin_data`");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_display_data`");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='sponsor' OR what IN('repr_sponsor','sponsor_medit','sponsor_madd') LIMIT 20");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='sponsor' LIMIT 5");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='sponsor' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='sponsor' OR what IN('repr_sponsor','sponsor_medit','sponsor_madd')");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='sponsor'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='sponsor'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index e6b870a..3dc3932 100644 (file)
@@ -93,6 +93,7 @@ action='rals' OR
 action='account'");
 
        // Drop indexes
+       /* @TODO SQL_ALTER_TABLE() should work now properly
        ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_extensions` DROP UNIQUE KEY `ext_name`");
        ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP UNIQUE KEY `login`");
        ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP INDEX `status`");
@@ -124,6 +125,7 @@ action='account'");
        ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` DROP INDEX `locked`");
        ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_cats` DROP INDEX `visible`");
        ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_cats` DROP INDEX `sort`");
+       */
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 2d02c54..e84a1a7 100644 (file)
@@ -200,8 +200,8 @@ case "remove": // Do stuff when removing extension
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_salts`");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_stats`");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_urls`");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='surfbar' LIMIT 5");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='surfbar' LIMIT 7");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='surfbar'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='surfbar'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index ced2cc5..6ddbc42 100644 (file)
@@ -59,7 +59,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='task' LIMIT 2");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='task'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 6de24ad..ae9421a 100644 (file)
@@ -59,13 +59,13 @@ case "remove": // Do stuff when removing extension
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_themes`");
 
        // Delete admin menu
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='theme' LIMIT 4");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='theme'");
 
        // Delete guest menu entries
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='themes' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='themes'");
 
        // Delete member menu entries
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='themes' OR `what`='themes' LIMIT 2");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='themes' OR `what`='themes'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index b31a07f..f0ebdd9 100644 (file)
@@ -59,8 +59,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='top10' LIMIT 1");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_top10' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='top10'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_top10'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 55dec05..2bbb481 100644 (file)
@@ -107,9 +107,9 @@ case "remove": // Do stuff when removing extension
        // SQL commands to run
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_transfers_in`");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_transfers_out`");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='transfer' LIMIT 4");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='transfer' LIMIT 1");
-       ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP opt_in");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='transfer'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='transfer'");
+       ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP `opt_in`");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 1547c4a..035f5cc 100644 (file)
@@ -58,7 +58,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='usage' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='usage'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 53495b7..b75d24d 100644 (file)
@@ -66,7 +66,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') LIMIT 3");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') OR `action`='user'");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_del`");
        break;
 
index db288cc..76c1663 100644 (file)
@@ -87,8 +87,8 @@ case "remove": // Do stuff when removing extension
        // SQL commands to run
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_wernis`");
        ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='wernis'");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='wernis' LIMIT 1");
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='wernis_portal' LIMIT 1");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='wernis'");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='wernis_portal'");
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 92acaf6..5417137 100644 (file)
@@ -86,7 +86,7 @@ UNIQUE `y_type` (`type`,`y_id`)
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_yoomedia','list_yoomedia_tm') LIMIT 2");
+       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_yoomedia','list_yoomedia_tm')");
        ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_yoomedia_reload`");
        break;
 
index 2cc38fa..06c7e1f 100644 (file)
@@ -47,7 +47,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Init variables
-$mysql = "";
+$mysql = array();
 if ((REQUEST_ISSET_POST(('mysql'))) && (is_array(REQUEST_POST('mysql')))) $mysql = REQUEST_POST('mysql');
 
 // Check if both passwords from SMTP are matching
index bd0d935..d668fba 100644 (file)
@@ -1251,6 +1251,16 @@ function ADMIN_DELETE_TASK ($id) {
 }
 // Function to update task data
 function ADMIN_UPDATE_TASK_DATA ($id, $row, $data) {
+       // Is the id not set, then we need a backtrace here... :(
+       if ($id <= 0) {
+               // Initiate backtrace
+               debug_report_bug(sprintf("id is invalid: %s. row=%s, data=%s",
+                       $id,
+                       $row,
+                       $data
+               ));
+       } // END - if
+
        // Update the task
        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET %s='%s' WHERE id=%s LIMIT 1",
                array($row, $data, bigintval($id)), __FUNCTION__, __LINE__);