Introduced wrapper function addCreateTableSql(), fixed parameter order:
[mailer.git] / inc / extensions / ext-sponsor.php
index cf3564a6af76ab3828c3b76d62ac12cf2f5a00b2..4f4e82fb8d68482d99c2b8acd42086d8e6647544 100644 (file)
@@ -61,7 +61,7 @@ switch (getExtensionMode()) {
                // Sponsor data
                //
                addDropTableSql('sponsor_data');
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_data` (
+               addCreateTableSql('sponsor_data', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `company` VARCHAR(255) NOT NULL DEFAULT '',
 `position` VARCHAR(255) NOT NULL DEFAULT '',
@@ -103,7 +103,7 @@ PRIMARY KEY (`id`)
                // Sponsor orders
                //
                addDropTableSql('sponsor_orders');
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_orders` (
+               addCreateTableSql('sponsor_orders', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
@@ -123,7 +123,7 @@ PRIMARY KEY (`id`)
                // Pay-types
                //
                addDropTableSql('sponsor_paytypes');
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_paytypes` (
+               addCreateTableSql('sponsor_paytypes', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `pay_name` VARCHAR(255) NOT NULL DEFAULT '',
 `pay_rate` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
@@ -135,7 +135,7 @@ PRIMARY KEY (`id`)
                // Points-to-action converting
                //
                addDropTableSql('sponsor_action_convert');
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_action_convert` (
+               addCreateTableSql('sponsor_action_convert', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `ext_name` VARCHAR(255) NOT NULL DEFAULT 'sponsor',
 `conv_rate` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
@@ -147,7 +147,7 @@ PRIMARY KEY (`id`)
                // Sponsor menu system (default)
                //
                addDropTableSql('sponsor_menu');
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_menu` (
+               addCreateTableSql('sponsor_menu', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `action` VARCHAR(255) NOT NULL DEFAULT '',
 `what`  VARCHAR(255) NULL DEFAULT NULL,
@@ -163,7 +163,7 @@ PRIMARY KEY (`id`)
                // Registry for performable actions by your sponsors
                //
                addDropTableSql('sponsor_registry');
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_registry` (
+               addCreateTableSql('sponsor_registry', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `ext_name` VARCHAR(255) NOT NULL DEFAULT 'sponsor',
@@ -177,7 +177,7 @@ PRIMARY KEY (`id`)
                // URLs from the sponsors
                //
                addDropTableSql('sponsor_urls');
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_urls` (
+               addCreateTableSql('sponsor_urls', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `url` VARCHAR(255) NOT NULL DEFAULT 'http://',
@@ -191,7 +191,7 @@ PRIMARY KEY (`id`)
                // Banners of any size from the sponsors
                //
                addDropTableSql('sponsor_banner');
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_banner` (
+               addCreateTableSql('sponsor_banner', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `url` VARCHAR(255) NOT NULL DEFAULT 'http://',
@@ -207,7 +207,7 @@ PRIMARY KEY (`id`)
                // Campaigns
                //
                addDropTableSql('sponsor_campaigns');
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_campaigns` (
+               addCreateTableSql('sponsor_campaigns', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
@@ -230,7 +230,7 @@ PRIMARY KEY (`id`)
                // Campaigns + URLs + Banner
                //
                addDropTableSql('sponsor_campaign_assigns');
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns` (
+               addCreateTableSql('sponsor_campaign_assigns', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `campaignid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `urlid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
@@ -246,7 +246,7 @@ PRIMARY KEY (`id`)
                // Allowed data to display (administrative)
                //
                addDropTableSql('sponsor_admin_data');
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_admin_data` (
+               addCreateTableSql('sponsor_admin_data', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `data_row` VARCHAR(255) NOT NULL DEFAULT '',
 `display` ENUM('Y','N') NOT NULL DEFAULT 'N',
@@ -256,7 +256,7 @@ PRIMARY KEY (`id`)
                // Allowed data to display (sponsor-side)
                //
                addDropTableSql('sponsor_display_data');
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_display_data` (
+               addCreateTableSql('sponsor_display_data', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `data_row` VARCHAR(255) NOT NULL DEFAULT '',