Introduced wrapper function addCreateTableSql(), fixed parameter order:
[mailer.git] / inc / extensions / ext-beg.php
index 0a4f650bd24bda1a5458b5fcae6c9a54965c7081..249dd1a9f61631194a25a157249901c6a79fd332 100644 (file)
@@ -57,7 +57,7 @@ switch (getExtensionMode()) {
                addConfigAddSql('beg_points', "FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00100");
                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `beg_clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
                addDropTableSql('beg_ips');
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_beg_ips` (
+               addCreateTableSql('beg_ips', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `remote_ip` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
@@ -65,7 +65,7 @@ switch (getExtensionMode()) {
 `sid` VARCHAR(255) NOT NULL DEFAULT '',
 KEY (`userid`),
 PRIMARY KEY (`id`)
-) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
+) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'IP lock data for beg links'");
                break;
 
        case 'remove': // Do stuff when removing extension
@@ -104,7 +104,7 @@ PRIMARY KEY (`id`)
                                break;
 
                        case '0.0.3': // SQL queries for v0.0.3
-                               addConfigAddSql("beg_points_max FLOAT(20,5) UNSIGNED NOT NULL DEFAULT '0.10000'");
+                               addConfigAddSql('beg_points_max', "FLOAT(20,5) UNSIGNED NOT NULL DEFAULT '0.10000'");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Maximale Obergrenze an {?POINTS?} einstellbar (Standard: 0,1 {?POINTS?})");
@@ -121,14 +121,14 @@ PRIMARY KEY (`id`)
                                break;
 
                        case '0.0.6': // SQL queries for v0.0.6
-                               addConfigAddSql("beg_userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+                               addConfigAddSql('beg_userid', "BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Ein Mitgliedsaccount (empfehlenswert ist Ihr eigenes!) kann zum Abbuchen der {?POINTS?} verwendet werden. Template <u>admin_config_beg.tpl</u> (und pro!) nicht vergessen, zu aktualisieren.");
                                break;
 
                        case '0.0.8': // SQL queries for v0.0.8
-                               addConfigAddSql("beg_ip_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT 1800");
+                               addConfigAddSql('beg_ip_timeout', "BIGINT(20) UNSIGNED NOT NULL DEFAULT 1800");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Zeitsperre gegen die selbe IP-Nummer hinzugef&uuml;gt.");
@@ -282,7 +282,7 @@ PRIMARY KEY (`id`)
 
                        case '0.2.9': // SQL queries for v0.2.9
                                addDropTableSql('beg_referals');
-                               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_beg_referals` (
+                               addCreateTableSql('beg_referals', "(
 `id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
 `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL ,
 `remote_ip` VARCHAR( 15 ) NOT NULL DEFAULT '0.0.0.0',