SQLs improved, verbose listing for SQLs fixed
authorRoland Häder <roland@mxchange.org>
Sat, 31 Oct 2009 18:12:14 +0000 (18:12 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 31 Oct 2009 18:12:14 +0000 (18:12 +0000)
inc/extensions-functions.php
inc/extensions/ext-autopurge.php
inc/extensions/ext-beg.php
inc/extensions/ext-bonus.php
inc/extensions/ext-network.php
inc/extensions/ext-nickname.php
inc/extensions/ext-refback.php
inc/extensions/ext-sponsor.php
inc/modules/admin/overview-inc.php

index dfa79d8..990c04c 100644 (file)
@@ -676,9 +676,9 @@ function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false
                $SW = 2;
 
                // Get all SQLs
-               foreach (getExtensionSqls() as $idx => $sqls) {
+               foreach (getExtensionSqls() as $sqls) {
                        // New array format is recursive
-                       foreach ($sqls as $sql) {
+                       foreach ($sqls as $idx => $sql) {
                                // Trim out spaces
                                $sql = trim($sql);
 
index 50fbd19..c2514e9 100644 (file)
@@ -65,7 +65,7 @@ switch (getExtensionMode()) {
                if (isExtensionActive('bonus')) {
                        addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_bonus` MODIFY data_type ENUM('NEW','QUEUE','SEND') NOT NULL DEFAULT 'NEW'");
                }
-               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE what IN('config_autopurge','list_autopurge')");
+               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_autopurge','list_autopurge')");
                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` DROP ap_notified");
                break;
 
index bbaf8b2..389917a 100644 (file)
@@ -86,7 +86,7 @@ PRIMARY KEY (id)
        case 'deactivate': // Do stuff when admin deactivates this extension
                // SQL commands to run
                addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='N', `locked`='Y' WHERE `what`='beg' LIMIT 1");
-               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N', `locked`='Y' WHERE what IN('beg','beg2') LIMIT 2");
+               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what` IN('beg','beg2') LIMIT 2");
                addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='Y' WHERE `module`='beg' LIMIT 1");
                break;
 
index f8650b3..fe73b15 100644 (file)
@@ -80,11 +80,9 @@ PRIMARY KEY  (id)
 
        case 'remove': // Do stuff when removing extension
                // SQL commands to run
-               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE what IN ('bonus','config_bonus','send_bonus','list_bonus','list_notifications')");
+               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('bonus','config_bonus','send_bonus','list_bonus','list_notifications')");
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='bonus'");
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='bonus'");
-               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` MODIFY link_type ENUM('NORMAL') NOT NULL DEFAULT 'NORMAL'");
-               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` DROP bonus_id");
                addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus`");
                addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_urls`");
                addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_customer`");
index 7a3f7ba..5bb4e73 100644 (file)
@@ -39,7 +39,7 @@
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-}
+} // END - if
 
 // Version number
 setThisExtensionVersion('0.0');
@@ -50,10 +50,20 @@ setExtensionVersionHistory(array('0.0'));
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
                // SQL commands to run
+               addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_config`");
+               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_config` (
+`network_id` BIGINT(20) NOT NULL AUTO_INCREMENT,
+`network_name` VARCHAR(255) NOT NULL DEFAULT '',
+`network_title` VARCHAR(255) NOT NULL DEFAULT '',
+`network_reflink` VARCHAR(255) NOT NULL DEFAULT '',
+UNIQUE (`network_name`),
+PRIMARY KEY (`network_id`)
+) TYPE={?_TABLE_TYPE?} COMMENT='Network data'");
                break;
 
        case 'remove': // Do stuff when removing extension
                // SQL commands to run
+               addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_config`");
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 0118114..8ca9f15 100644 (file)
@@ -58,7 +58,7 @@ switch (getExtensionMode()) {
        case 'remove': // Do stuff when removing extension
                // SQL commands to run
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='nickname'");
-               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE what IN ('config_nickname','list_nickname')");
+               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('config_nickname','list_nickname')");
                addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_nickname_history`");
                break;
 
index cd653a6..22e30a9 100644 (file)
@@ -74,7 +74,7 @@ KEY (`refid`)
                // SQL commands to run
                addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_refs`");
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='refback'");
-               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE what IN('config_refback','list_refback')");
+               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_refback','list_refback')");
                addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET level=level-1");
                break;
 
index 8741bf8..a5d1377 100644 (file)
@@ -384,7 +384,7 @@ PRIMARY KEY (`id`)
                addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns`");
                addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_admin_data`");
                addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_display_data`");
-               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='sponsor' OR what IN('repr_sponsor','sponsor_medit','sponsor_madd')");
+               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='sponsor' OR `what` IN('repr_sponsor','sponsor_medit','sponsor_madd')");
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='sponsor'");
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='sponsor'");
                break;
index 2a09cb9..ebd9c83 100644 (file)
@@ -48,7 +48,7 @@ function outputStandardOverview (&$result_tasks) {
                array(getCurrentAdminId()), __FILE__, __LINE__);
 
        // We currently don't want to install an extension so let's find out if we need...
-       setExtensionMode('register');
+       setExtensionMode('test');
        $jobsDone = true;
 
        // Open the extension directory