From: Roland Häder Date: Sat, 25 Jun 2011 03:00:45 +0000 (+0000) Subject: Introduced wrapper function addCreateTableSql(), fixed parameter order: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=be39a7fb887473487fd2c5f8d550aa03b720cb73;p=mailer.git Introduced wrapper function addCreateTableSql(), fixed parameter order: - Wrapper function addCreateTableSql() introduced which encapsulates checking if a given table is already there and if not it will add a SQL statement to the current extension's SQL queue - Fixed a parameter ordering for ext-register --- diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index dc7660b24c..90b2bd495d 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -1741,13 +1741,28 @@ function isExtensionFunctionFileReadable ($ext_name) { return ($GLOBALS['cache_array']['extension']['ext_func'][$ext_name] == 'Y'); } +// Adds a CREATE TABLE statement if the requested table is not there +function addCreateTableSql ($tableName, $sql) { + // Is the table not there? + if (!isSqlTableCreated($tableName)) { + // Is not found, so add it + addExtensionSql('CREATE TABLE `{?_MYSQL_PREFIX?}_' . $tableName . '` ' . $sql); + } else { + // Is already there, which should not happen + debug_report_bug(__FUNCTION__, __LINE__, 'The table ' . $tableName . ' is already created which should not happen.'); + } +} + // Adds a DROP TABLE statement if the requested tabled is there -function addDropTableSql ($table) { +function addDropTableSql ($tableName) { // Is the table there? - if (isSqlTableCreated($table)) { + if (isSqlTableCreated($tableName)) { // Then add it, non-existing tables can be ignored because it will // happen with every newly installed extension. - addExtensionSql('DROP TABLE `{?_MYSQL_PREFIX?}_' . $table . '`'); + addExtensionSql('DROP TABLE `{?_MYSQL_PREFIX?}_' . $tableName . '`'); + + // Mark it as gone + $GLOBALS['isSqlTableCreated'][$tableName] = false; } // END - if } diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php index 2759d3f793..fc1a9b6e22 100644 --- a/inc/extensions/ext-admins.php +++ b/inc/extensions/ext-admins.php @@ -103,7 +103,7 @@ switch (getExtensionMode()) { // But allow current admin everything (THIS SHALL BE YOU!) addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `default_acl`='allow' WHERE `id`=".bigintval(getCurrentAdminId())." LIMIT 1"); addDropTableSql('admins_acls'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admins_acls` ( + addCreateTableSql('admins_acls', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `action_menu` VARCHAR(255) NOT NULL DEFAULT '', @@ -123,7 +123,7 @@ PRIMARY KEY (`id`) case '0.4.0': // SQL queries for v0.4.0 addDropTableSql('admins_mails'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admins_mails` ( + addCreateTableSql('admins_mails', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `mail_template` VARCHAR(255) NOT NULL, diff --git a/inc/extensions/ext-bank.php b/inc/extensions/ext-bank.php index be1fe1884a..b3ac778552 100644 --- a/inc/extensions/ext-bank.php +++ b/inc/extensions/ext-bank.php @@ -53,7 +53,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run addDropTableSql('bank_accounts'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_accounts` ( + addCreateTableSql('bank_accounts', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `account_created` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -80,7 +80,7 @@ INDEX (`account_locked`), INDEX (`last_tan_stamp`) ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'User bank accounts data'"); addDropTableSql('bank_transfers'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_transfers` ( + addCreateTableSql('bank_transfers', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `to_account_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `from_account_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -93,7 +93,7 @@ INDEX (`to_account_id`, `from_account_id`), INDEX (`day_bookkeeping`, `day_available`) ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Bank user->user transfers'"); addDropTableSql('bank_packages'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_packages` ( + addCreateTableSql('bank_packages', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `title` VARCHAR(255) NOT NULL DEFAULT '', `description` TINYTEXT, @@ -117,7 +117,7 @@ PRIMARY KEY (`id`) // must be extended with the mode you get for free: output_system_mode:LOGIN // should be fine. More than one entry and not DISABLED ;) are not supported. addDropTableSql('bank_tanlist'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_tanlist` ( + addCreateTableSql('bank_tanlist', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `idx` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0, `account_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-beg.php b/inc/extensions/ext-beg.php index c5ead91f5e..249dd1a9f6 100644 --- a/inc/extensions/ext-beg.php +++ b/inc/extensions/ext-beg.php @@ -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', @@ -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 admin_config_beg.tpl (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ü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', diff --git a/inc/extensions/ext-birthday.php b/inc/extensions/ext-birthday.php index 5c96814e86..330bc843d6 100644 --- a/inc/extensions/ext-birthday.php +++ b/inc/extensions/ext-birthday.php @@ -79,7 +79,7 @@ switch (getExtensionMode()) { case '0.2.0': // SQL queries for v0.2 addConfigAddSql('birthday_points', "BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); addDropTableSql('user_birthday'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_birthday` ( + addCreateTableSql('user_birthday', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index b57f4fced3..7e6d7d444c 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -55,7 +55,7 @@ switch (getExtensionMode()) { addAdminMenuSql('email','send_bonus','Bonusmail senden','Versenden Sie hier Bonus-Mails an alle Mitglieder oder nur an alle aus einer Kategorie. Es spielt keine Rolle, wie viele Mails bereits versendet worden, Sie können hier immer senden.', 5); addMemberMenuSql('main','bonus','Bonuspunkte','N','Y',7); addDropTableSql('bonus'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bonus` ( + addCreateTableSql('bonus', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `cat_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `subject` VARCHAR(255) NOT NULL DEFAULT '', @@ -144,7 +144,7 @@ PRIMARY KEY (`id`) case '0.2.2': // SQL queries for v0.2.2 addDropTableSql('bonus_turbo'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bonus_turbo` ( + addCreateTableSql('bonus_turbo', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `mail_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-booking.php b/inc/extensions/ext-booking.php index aa0f8f1ee2..99797b6b37 100644 --- a/inc/extensions/ext-booking.php +++ b/inc/extensions/ext-booking.php @@ -57,7 +57,7 @@ switch (getExtensionMode()) { // Drop/create table for user bookings addDropTableSql('user_book'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_book`( + addCreateTableSql('user_book', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `subject` VARCHAR(255) NOT NULL DEFAULT 'missing', diff --git a/inc/extensions/ext-cache.php b/inc/extensions/ext-cache.php index fd920a839c..8d631beaac 100644 --- a/inc/extensions/ext-cache.php +++ b/inc/extensions/ext-cache.php @@ -121,8 +121,8 @@ switch (getExtensionMode()) { break; case '0.0.7': // SQL queries for v0.0.7 - addConfigAddSql("db_hits BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); - addConfigAddSql("cache_hits BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + addConfigAddSql('db_hits', "BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + addConfigAddSql('cache_hits', "BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); addAdminMenuSql('stats','cache_stats','DB-Cache','Auf Cache und gesamte Datenbank registrierte Anfragen anzeigen.', 4); // Update notes (these will be set as task text!) @@ -218,7 +218,7 @@ switch (getExtensionMode()) { break; case '0.2.3': // SQL queries for v0.2.3 - addConfigAddSql("cache_filter ENUM('Y','N') NOT NULL DEFAULT 'Y'"); + addConfigAddSql('cache_filter', "ENUM('Y','N') NOT NULL DEFAULT 'Y'"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Cachen von Filtern hinzugefügt."); diff --git a/inc/extensions/ext-country.php b/inc/extensions/ext-country.php index fd04c72618..729594731d 100644 --- a/inc/extensions/ext-country.php +++ b/inc/extensions/ext-country.php @@ -53,7 +53,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run addDropTableSql('countries'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_countries` ( + addCreateTableSql('countries', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `code` CHAR(2) NOT NULL DEFAULT 'DE', `descr` VARCHAR(255) NOT NULL DEFAULT 'Deutschland', diff --git a/inc/extensions/ext-coupon.php b/inc/extensions/ext-coupon.php index 8c87f9ab67..f173b2c4f8 100644 --- a/inc/extensions/ext-coupon.php +++ b/inc/extensions/ext-coupon.php @@ -55,7 +55,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installtion is running (modules.php?module=admin&action=login is called) // Coupon data addDropTableSql('coupons'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_coupons` ( + addCreateTableSql('coupons', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `timestamp_created` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', `timestamp_expired` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', @@ -70,7 +70,7 @@ UNIQUE KEY (`coupon_code`) // Coupon->user connection table addDropTableSql('user_coupons'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_coupons` ( + addCreateTableSql('coupons', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `coupon_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `userid` BIGINT(2) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-debug.php b/inc/extensions/ext-debug.php index 53ddff9cd0..66919d5555 100644 --- a/inc/extensions/ext-debug.php +++ b/inc/extensions/ext-debug.php @@ -56,7 +56,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // Table for debug log entries addDropTableSql('debug_log'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_log` ( + addCreateTableSql('debug_log', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `sender_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00', @@ -72,7 +72,7 @@ PRIMARY KEY (`id`) // Table against debug log abuse addDropTableSql('debug_log_abuse'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_log_abuse` ( + addCreateTableSql('debug_log_abuse', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00', @@ -84,7 +84,7 @@ PRIMARY KEY (`id`) // Table on relay/server for client exchanges addDropTableSql('debug_client'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_client` ( + addCreateTableSql('debug_client', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `key` VARCHAR(255) NOT NULL DEFAULT 'SELF', `url` VARCHAR(255) NOT NULL DEFAULT '', @@ -104,7 +104,7 @@ PRIMARY KEY (`id`) // Table for debug log <-> client connection addDropTableSql('debug_client_log'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_client_log` ( + addCreateTableSql('debug_client_log', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 1, `log_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php index 15a59f0001..43a732d729 100644 --- a/inc/extensions/ext-doubler.php +++ b/inc/extensions/ext-doubler.php @@ -50,7 +50,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // Doubler table addDropTableSql('doubler'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_doubler` ( + addCreateTableSql('doubler', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -145,7 +145,7 @@ PRIMARY KEY (`id`) case '0.0.2': // SQL queries for v0.0.2 // Total used points - addConfigAddSql("doubler_used FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"); + addConfigAddSql('doubler_user', "FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Gebühr wird vom Verdoppler-Pott abgezogen."); @@ -158,7 +158,7 @@ PRIMARY KEY (`id`) case '0.0.4': // SQL queries for v0.0.4 // Shall I use the doubler's account to take points from? (Y/N, default=Y) - addConfigAddSql("doubler_own ENUM('Y','N') NOT NULL DEFAULT 'Y'"); + addConfigAddSql('doubler_own', "ENUM('Y','N') NOT NULL DEFAULT 'Y'"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("{?POINTS?}-Guthaben des Verdopplers kann optional nicht mit einbezogen werden."); diff --git a/inc/extensions/ext-forced.php b/inc/extensions/ext-forced.php index a98fe19915..8313a04b94 100644 --- a/inc/extensions/ext-forced.php +++ b/inc/extensions/ext-forced.php @@ -57,7 +57,7 @@ switch (getExtensionMode()) { // All required tables for this extension: // - Ads addDropTableSql('forced_ads'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_forced_ads` ( + addCreateTableSql('forced_ads', "( `forced_ads_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT , `forced_ads_ad_url` VARCHAR( 255 ) NULL DEFAULT NULL , `forced_ads_click_url` VARCHAR( 255 ) NOT NULL , @@ -74,7 +74,7 @@ PRIMARY KEY ( `forced_ads_id` ) // - Campaigns addDropTableSql('forced_campaigns'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_forced_campaigns` ( + addCreateTableSql('forced_campaigns', "( `forced_campaign_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT , `forced_campaign_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , `forced_campaign_status` ENUM( 'ACTIVE', 'PENDING', 'EXPIRED', 'LOCKED' ) NOT NULL DEFAULT 'PENDING', @@ -91,7 +91,7 @@ PRIMARY KEY ( `forced_campaign_id` ) // - Campaigns <-> Ads addDropTableSql('forced_campaigns_ads'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_forced_campaigns_ads` ( + addCreateTableSql('forced_campaigns_ads', "( `forced_campaign_ads_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT , `forced_campaign_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL , `forced_ads_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL , @@ -101,7 +101,7 @@ PRIMARY KEY ( `forced_campaign_ads_id` ) // - Campaigns <-> User addDropTableSql('forced_campaigns_user'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_forced_campaigns_user` ( + addCreateTableSql('forced_campaigns_user', "( `forced_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT , `forced_campaign_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL , `forced_user_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL , @@ -113,7 +113,7 @@ PRIMARY KEY ( `forced_id` ) // - Campaign costs addDropTableSql('forced_costs'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_forced_costs` ( + addCreateTableSql('forced_costs', "( `forced_costs_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT , `forced_costs_price_click` FLOAT( 20, 5 ) UNSIGNED NULL DEFAULT NULL , `forced_costs_payment_click` FLOAT( 20, 5 ) UNSIGNED NULL DEFAULT NULL , @@ -123,7 +123,7 @@ PRIMARY KEY ( `forced_costs_id` ) // - Campaign Statistics addDropTableSql('forced_stats'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_forced_stats` ( + addCreateTableSql('forced_stats', "( `forced_stats_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT , `forced_stats_campaign_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL , `forced_stats_user_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL , diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index 6e025d4599..d327ac1692 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -50,7 +50,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // Create database addDropTableSql('user_holidays'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_holidays` ( + addCreateTableSql('user_holidays', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `holiday_start` VARCHAR(10) NOT NULL DEFAULT 0, @@ -61,7 +61,7 @@ PRIMARY KEY (`id`) ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'User holiday data'"); // Add default values to config - addConfigAddSql("holiday_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'"); + addConfigAddSql('holiday_max', "BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'"); // Add member menu addMemberMenuSql('main','holiday','Urlaubsschaltung','Y','Y',4); @@ -156,7 +156,7 @@ PRIMARY KEY (`id`) case '0.1.3': // SQL queries for v0.1.3 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD holiday_active ENUM('Y','N') NOT NULL DEFAULT 'N'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value=0 LIMIT 1"); - addConfigAddSql("holiday_lock BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getOneDay()*2)."'"); + addConfigAddSql('holiday_lock', "BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getOneDay()*2)."'"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Die Mitglieder-Accounts werden nicht mehr gesperrt, sondern nur auf Urlaub geschaltet. Lassen Sie sich nicht davon verwirren, dass sie "freigegeben" sind!"); diff --git a/inc/extensions/ext-imprint.php b/inc/extensions/ext-imprint.php index 74c3d1d2bb..2111be26e9 100644 --- a/inc/extensions/ext-imprint.php +++ b/inc/extensions/ext-imprint.php @@ -66,7 +66,7 @@ switch (getExtensionMode()) { // Create imprint data table addDropTableSql('imprint_data'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_imprint_data` ( + addCreateTableSql('imprint_data', "( `imprint_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `imprint_key` VARCHAR(255) NOT NULL DEFAULT '', `imprint_value` VARCHAR(255) NOT NULL DEFAULT '', diff --git a/inc/extensions/ext-mediadata.php b/inc/extensions/ext-mediadata.php index c328aa75c7..bfc8dc47a5 100644 --- a/inc/extensions/ext-mediadata.php +++ b/inc/extensions/ext-mediadata.php @@ -100,7 +100,7 @@ switch (getExtensionMode()) { case '0.0.4': // SQL queries for v0.0.4 // SQL commands to run addDropTableSql('mediadata'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_mediadata` ( + addCreateTableSql('mediadata', "( `media_key` VARCHAR(255) NOT NULL DEFAULT '', `media_value` VARCHAR(255) NOT NULL DEFAULT '', PRIMARY KEY (`media_key`) diff --git a/inc/extensions/ext-network.php b/inc/extensions/ext-network.php index 98be8b9603..02150fc03b 100644 --- a/inc/extensions/ext-network.php +++ b/inc/extensions/ext-network.php @@ -75,7 +75,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // Main table which hold addDropTableSql('network_data'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_data` ( + addCreateTableSql('network_data', "( `network_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `network_short_name` VARCHAR(50) NOT NULL DEFAULT '', `network_title` VARCHAR(255) NOT NULL DEFAULT '', @@ -92,7 +92,7 @@ PRIMARY KEY (`network_id`) // Types the network provider is supporting (e.g. Forced-Banner and so on) // @TODO network_type_handle is an internal name and needs documentation addDropTableSql('network_types'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_types` ( + addCreateTableSql('network_types', "( `network_type_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_type_handle` VARCHAR(255) NOT NULL DEFAULT '', @@ -105,7 +105,7 @@ PRIMARY KEY (`network_type_id`) // HTTP parameters (names) for URLs addDropTableSql('network_request_params'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_request_params` ( + addCreateTableSql('network_request_params', "( `network_param_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -119,7 +119,7 @@ PRIMARY KEY (`network_param_id`) // Error status codes addDropTableSql('network_error_codes'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_error_codes` ( + addCreateTableSql('network_error_codes', "( `network_type_code_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_type_code_value` VARCHAR(50) NOT NULL DEFAULT '', @@ -131,7 +131,7 @@ PRIMARY KEY (`network_type_code_id`) // Code types (internal table) addDropTableSql('network_error_types'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_error_types` ( + addCreateTableSql('network_error_types', "( `network_code_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `network_code` VARCHAR(100) NOT NULL DEFAULT 'INVALID_CODE', UNIQUE (`network_code`), @@ -140,7 +140,7 @@ PRIMARY KEY (`network_code_id`) // Valid translation keys (we hate hard-coded arrays, you see?) addDropTableSql('network_translations'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_translations` ( + addCreateTableSql('network_translations', "( `network_translation_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `network_translation_name` VARCHAR(100) NOT NULL DEFAULT '', UNIQUE (`network_translation_name`), @@ -149,7 +149,7 @@ PRIMARY KEY (`network_translation_id`) // Array-Element translation tables per type/provider addDropTableSql('network_api_translation'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_api_translation` ( + addCreateTableSql('network_api_translation', "( `network_api_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -162,7 +162,7 @@ PRIMARY KEY (`network_api_id`) // Data from the webmaster (you!) addDropTableSql('network_config'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_config` ( + addCreateTableSql('network_config', "( `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_affiliate_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_api_password` VARCHAR(255) NOT NULL DEFAULT '', @@ -176,7 +176,7 @@ PRIMARY KEY (`network_id`) // Configuration data for e.g. reload-time addDropTableSql('network_types_config'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_types_config` ( + addCreateTableSql('network_types_config', "( `network_data_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -193,7 +193,7 @@ PRIMARY KEY (`network_data_id`) // `network_cache_refresh` in seconds or if set to zero, full day // divided by query amount. addDropTableSql('network_cache'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_cache` ( + addCreateTableSql('network_cache', "( `network_cache_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -205,7 +205,7 @@ PRIMARY KEY (`network_cache_id`) // Reload locks for several types addDropTableSql('network_reloads'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_reloads` ( + addCreateTableSql('network_reloads', "( `network_reload_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php index 5729ed7cfb..aed01066fb 100644 --- a/inc/extensions/ext-newsletter.php +++ b/inc/extensions/ext-newsletter.php @@ -140,7 +140,7 @@ switch (getExtensionMode()) { // Tables: // - Main data table addDropTableSql('newsletter_data'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_newsletter_data` ( + addCreateTableSql('newsletter_data', "( `nl_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `nl_subject` VARCHAR(255) NOT NULL DEFAULT '{OPEN_CONFIG}nl_default_subject{CLOSE_CONFIG}', `nl_header_text` MEDIUMTEXT, @@ -159,7 +159,7 @@ PRIMARY KEY (`nl_id`) // - Topics data table addDropTableSql('newsletter_topics'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_newsletter_topics` ( + addCreateTableSql('newsletter_topics', "( `nl_topic_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `nl_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `nl_topic_title` VARCHAR(255) NOT NULL DEFAULT '', @@ -171,7 +171,7 @@ PRIMARY KEY (`nl_topic_id`) // - Sponsor orders data table addDropTableSql('newsletter_orders'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_newsletter_orders` ( + addCreateTableSql('newsletter_orders', "( `nl_order_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `nl_sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `nl_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-nickname.php b/inc/extensions/ext-nickname.php index 93ec509a3f..a81ff0c029 100644 --- a/inc/extensions/ext-nickname.php +++ b/inc/extensions/ext-nickname.php @@ -173,7 +173,7 @@ switch (getExtensionMode()) { case '0.1.9': // SQL queries for v0.1.9 addAdminMenuSql('user','list_nickname','Nickname-Historie','Listet alle verwendeten Nicknames der Mitglieder auf.', 12); addDropTableSql('nickname_history'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_nickname_history` ( + addCreateTableSql('nickname_history', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `nickname` VARCHAR(255) NOT NULL DEFAULT '', diff --git a/inc/extensions/ext-online.php b/inc/extensions/ext-online.php index 8ea5bd76ac..aa43010721 100644 --- a/inc/extensions/ext-online.php +++ b/inc/extensions/ext-online.php @@ -50,7 +50,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run addDropTableSql('online'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_online` ( + addCreateTableSql('online', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `sid` VARCHAR(32) NOT NULL DEFAULT '', `ip` VARCHAR(15) NOT NULL DEFAULT '', diff --git a/inc/extensions/ext-optimize.php b/inc/extensions/ext-optimize.php index dc434dfbf9..ff6b0a45b1 100644 --- a/inc/extensions/ext-optimize.php +++ b/inc/extensions/ext-optimize.php @@ -53,7 +53,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run addDropTableSql('optimize_gain'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_optimize_gain` ( + addCreateTableSql('optimize_gain', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `gain` decimal(10,3) NOT NULL DEFAULT '0.000', PRIMARY KEY (`id`) diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index 08a78deecd..a7c72ed4a0 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -300,7 +300,7 @@ nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der Us case '0.5.0': // SQL queries for v0.5.0 addDropTableSql('url_blacklist'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_url_blacklist` ( + addCreateTableSql('url_blacklist', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `url` VARCHAR(255) NOT NULL DEFAULT '', `pool_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-other.php b/inc/extensions/ext-other.php index fd651510e6..b7a4ff2091 100644 --- a/inc/extensions/ext-other.php +++ b/inc/extensions/ext-other.php @@ -91,7 +91,7 @@ switch (getExtensionMode()) { break; case '0.0.4': // SQL queries for v0.0.4 - addConfigAddSql("max_comma TINYINT(3) UNSIGNED NOT NULL DEFAULT 3"); + addConfigAddSql('max_comma', "TINYINT(3) UNSIGNED NOT NULL DEFAULT 3"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Angezeigte Kommastellen können zwischen 0 und 5 eingestellt werden."); diff --git a/inc/extensions/ext-payout.php b/inc/extensions/ext-payout.php index 10f3077909..adbb2a90a1 100644 --- a/inc/extensions/ext-payout.php +++ b/inc/extensions/ext-payout.php @@ -50,7 +50,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run addDropTableSql('user_payouts'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_payouts` ( + addCreateTableSql('user_payouts', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `payout_total` FLOAT(22,3) UNSIGNED NOT NULL DEFAULT '0.000', @@ -64,7 +64,7 @@ INDEX (`payout_id`), PRIMARY KEY (`id`) ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Done user payouts (and status)'"); addDropTableSql('payout_types'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_payout_types` ( + addCreateTableSql('payout_types', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `type` VARCHAR(255) NOT NULL DEFAULT '', `rate` FLOAT(22,3) UNSIGNED NOT NULL DEFAULT '0.000', diff --git a/inc/extensions/ext-primera.php b/inc/extensions/ext-primera.php index b76c24c6f7..e9611eede7 100644 --- a/inc/extensions/ext-primera.php +++ b/inc/extensions/ext-primera.php @@ -55,7 +55,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run addDropTableSql('user_primera'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_primera` ( + addCreateTableSql('user_primera', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `primera_account` VARCHAR(255) NOT NULL DEFAULT '', diff --git a/inc/extensions/ext-rallye.php b/inc/extensions/ext-rallye.php index f874bd1eb9..21f53da8ff 100644 --- a/inc/extensions/ext-rallye.php +++ b/inc/extensions/ext-rallye.php @@ -50,7 +50,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run addDropTableSql('rallye_data'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_rallye_data` ( + addCreateTableSql('rallye_data', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `title` VARCHAR(255) NOT NULL DEFAULT '', @@ -66,7 +66,7 @@ KEY (`admin_id`), PRIMARY KEY (`id`) ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Main rallye data'"); addDropTableSql('rallye_prices'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_rallye_prices` ( + addCreateTableSql('rallye_prices', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `rallye_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `price_level` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -76,7 +76,7 @@ INDEX (`rallye_id`), PRIMARY KEY (`id`) ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Prices data for a rallye'"); addDropTableSql('rallye_users'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_rallye_users` ( + addCreateTableSql('rallye_users', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `rallye_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-refback.php b/inc/extensions/ext-refback.php index e8584fa90e..94771b67b5 100644 --- a/inc/extensions/ext-refback.php +++ b/inc/extensions/ext-refback.php @@ -50,7 +50,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run addDropTableSql('user_refs'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_refs` ( + addCreateTableSql('user_refs', "( `id` BIGINT(20) UNSIGNED NOT NULL auto_increment, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `level` smallINT(6) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-register.php b/inc/extensions/ext-register.php index dcaa8e3793..42809d622a 100644 --- a/inc/extensions/ext-register.php +++ b/inc/extensions/ext-register.php @@ -49,7 +49,7 @@ setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1 switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run - addGuestMenuSql('register', 'members', 'Anmeldung', 'Y', 'N', 2); + addGuestMenuSql('members', 'register', 'Anmeldung', 'Y', 'N', 2); break; case 'remove': // Do stuff when removing extension @@ -76,7 +76,7 @@ switch (getExtensionMode()) { switch (getCurrentExtensionVersion()) { case '0.1.0': // SQL queries for v0.1 addDropTableSql('must_register'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_must_register` ( + addCreateTableSql('must_register', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `field_name` VARCHAR(255) NOT NULL DEFAULT '', `field_required` ENUM('Y','N') NOT NULL DEFAULT 'Y', diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index cf3564a6af..4f4e82fb8d 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -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 '', diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 1549db5e50..d9f1abbb6b 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -197,7 +197,7 @@ switch (getExtensionMode()) { break; case '0.1.3': // SQL queries for v0.1.3 - addConfigAddSql("refid_target ENUM('register','index') NOT NULL DEFAULT 'register'"); + addConfigAddSql('refid_target', "ENUM('register','index') NOT NULL DEFAULT 'register'"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Auf welche Seite soll der Ref-Link zeigen? Eingangsseite oder Anmeldeformular?"); @@ -369,7 +369,7 @@ switch (getExtensionMode()) { case '0.3.2': // SQL queries for v0.3.2 // Connection table between the menu system and the "logical area system" addDropTableSql('admin_menu_las'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admin_menu_las` ( + addCreateTableSql('admin_menu_las', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `la_id` VARCHAR(255) NOT NULL DEFAULT '', `la_action` VARCHAR(255) NOT NULL DEFAULT '', @@ -381,7 +381,7 @@ PRIMARY KEY (`id`) ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Menu system -> LAS'"); // All "logical areas" together addDropTableSql('admin_menu_las_data'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admin_menu_las_data` ( + addCreateTableSql('admin_menu_las_data', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `la_id` VARCHAR(255) NOT NULL DEFAULT '', `la_title` VARCHAR(255) NOT NULL DEFAULT '', @@ -408,7 +408,7 @@ PRIMARY KEY (`id`) // The statistics table addDropTableSql('admin_las_stats'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admin_las_stats` ( + addCreateTableSql('admin_las_stats', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `type` ENUM('la','action','what') NOT NULL DEFAULT 'what', @@ -616,7 +616,7 @@ PRIMARY KEY (`id`) case '0.5.9': // SQL queries for v0.5.9 addDropTableSql('filters'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_filters` ( + addCreateTableSql('filters', "( `filter_id` BIGINT(20) UNSIGNED AUTO_INCREMENT, `filter_name` VARCHAR(50) NOT NULL DEFAULT '', `filter_function` VARCHAR(100) NOT NULL DEFAULT '', @@ -715,7 +715,7 @@ PRIMARY KEY (`filter_id`) case '0.7.0': // SQL queries for 0.7.0 // Table definition addDropTableSql('dns_cache'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_dns_cache` ( + addCreateTableSql('dns_cache', "( `hostname` VARCHAR(255) NOT NULL, `ip` VARCHAR(15) NOT NULL, `added` DATETIME NOT NULL, diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index 131726809c..6ee4cd5b7a 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -53,7 +53,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run (surfbar URLs) addDropTableSql('surfbar_urls'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_urls` ( + addCreateTableSql('surfbar_urls', "( `url_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `url_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `url` VARCHAR(255) NOT NULL DEFAULT '', @@ -74,7 +74,7 @@ INDEX `status_userid` (`url_status`,`url_userid`) // Reload locks addDropTableSql('surfbar_locks'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_locks` ( + addCreateTableSql('surfbar_locks', "( `locks_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `locks_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `locks_url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -86,7 +86,7 @@ INDEX (`locks_url_id`) // Surfbar salts addDropTableSql('surfbar_salts'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_salts` ( + addCreateTableSql('surfbar_salts', "( `salts_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `salts_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `salts_url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -98,7 +98,7 @@ INDEX (`salts_url_id`) // Statistics addDropTableSql('surfbar_stats'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_stats` ( + addCreateTableSql('surfbar_stats', "( `stats_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `stats_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `stats_url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -111,7 +111,7 @@ INDEX (`stats_url_id`) // Member actions pending on status addDropTableSql('surfbar_actions'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_actions` ( + addCreateTableSql('surfbar_actions', "( `actions_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `actions_status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL, `actions_action` ENUM('EDIT','DELETE','PAUSE','UNPAUSE','FRAMETEST','RETREAT','RESUBMIT','BOOKNOW') NULL DEFAULT NULL, diff --git a/inc/extensions/ext-theme.php b/inc/extensions/ext-theme.php index 6f09b59a7d..ce0686a779 100644 --- a/inc/extensions/ext-theme.php +++ b/inc/extensions/ext-theme.php @@ -121,7 +121,7 @@ switch (getExtensionMode()) { case '0.0.8': // SQL queries for v0.0.8 // Theme table addDropTableSql('themes'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_themes` ( + addCreateTableSql('themes', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `theme_path` VARCHAR(255) NOT NULL DEFAULT '', `theme_name` VARCHAR(255) NOT NULL DEFAULT '', diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php index 4d0e516c4f..e5988f9d87 100644 --- a/inc/extensions/ext-transfer.php +++ b/inc/extensions/ext-transfer.php @@ -50,7 +50,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running // Transfer from a member addDropTableSql('user_transfers_in'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_transfers_in` ( + addCreateTableSql('user_transfers_in', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `from_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -65,7 +65,7 @@ PRIMARY KEY (`id`) // Transfers to a member addDropTableSql('user_transfers_out'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_transfers_out` ( + addCreateTableSql('user_transfers_out', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `to_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index 8cc037b7da..daa3137169 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -52,7 +52,7 @@ setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) addDropTableSql('user_cats'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_cats` ( + addCreateTableSql('user_cats', "( `id` BIGINT(22) NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `cat_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0, @@ -62,7 +62,7 @@ INDEX (`cat_id`) ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'User->category connection data'"); addDropTableSql('user_data'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_data` ( + addCreateTableSql('user_data', "( `userid` BIGINT(22) NOT NULL AUTO_INCREMENT, `surname` VARCHAR(255) NOT NULL DEFAULT '', `family` VARCHAR(255) NOT NULL DEFAULT '', @@ -103,7 +103,7 @@ INDEX `status_mails` (`status`,`max_mails`) ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Main user data'"); addDropTableSql('user_points'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_points` ( + addCreateTableSql('user_points', "( `id` BIGINT(22) NOT NULL AUTO_INCREMENT, `userid` BIGINT(22) NOT NULL DEFAULT 0, `ref_depth` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0, @@ -114,7 +114,7 @@ INDEX (`userid`) ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'User points (no used points)'"); addDropTableSql('user_links'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_links` ( + addCreateTableSql('user_links', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `stats_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -125,7 +125,7 @@ INDEX (`stats_id`) ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Unconfirmed mails per user'"); addDropTableSql('user_stats'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_stats` ( + addCreateTableSql('user_stats', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `cat_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -147,7 +147,7 @@ INDEX (`pool_id`) ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Mail statistics per user order'"); addDropTableSql('user_stats_data'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_stats_data` ( + addCreateTableSql('user_stats_data', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `stats_type` VARCHAR(255) NOT NULL DEFAULT 'unknown', @@ -348,7 +348,7 @@ INDEX (`stats_type`) addConfigAddSql('user_delete_purge', "BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay() * 30).""); addAdminMenuSql('user', 'list_user_del', 'Löschungen auflisten', 'Listet die Löschungen von Usern auf.', 9); addDropTableSql('user_del'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_del` ( + addCreateTableSql('user_del', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `email` VARCHAR(255) NOT NULL DEFAULT '', diff --git a/inc/extensions/ext-wernis.php b/inc/extensions/ext-wernis.php index d781efb447..edec44185d 100644 --- a/inc/extensions/ext-wernis.php +++ b/inc/extensions/ext-wernis.php @@ -50,7 +50,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run addDropTableSql('user_wernis'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_wernis` ( + addCreateTableSql('user_wernis', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `wernis_account` VARCHAR(255) NOT NULL DEFAULT '', @@ -64,11 +64,11 @@ PRIMARY KEY (`id`) ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Transfered Wernis per user'"); // Confiuration - addConfigAddSql("wernis_min_payout BIGINT(20) UNSIGNED NOT NULL DEFAULT '40000'"); - addConfigAddSql("wernis_min_withdraw BIGINT(20) UNSIGNED NOT NULL DEFAULT '5000'"); - addConfigAddSql("wernis_api_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); - addConfigAddSql("wernis_api_md5 VARCHAR(32) NOT NULL DEFAULT ''"); - addConfigAddSql("wernis_api_url VARCHAR(255) NOT NULL DEFAULT 'http://www.wds66.com/api/'"); + addConfigAddSql('wernis_min_payout', "BIGINT(20) UNSIGNED NOT NULL DEFAULT '40000'"); + addConfigAddSql('wernis_min_withdraw', "BIGINT(20) UNSIGNED NOT NULL DEFAULT '5000'"); + addConfigAddSql('wernis_api_id', "BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + addConfigAddSql('wernis_api_md5', "VARCHAR(32) NOT NULL DEFAULT ''"); + addConfigAddSql('wernis_api_url', "VARCHAR(255) NOT NULL DEFAULT 'http://www.wds66.com/api/'"); // User data addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD wernis_userid VARCHAR(6) NOT NULL DEFAULT ''"); @@ -82,7 +82,7 @@ PRIMARY KEY (`id`) addMemberMenuSql('main','wernis','Wernis-Ein-/Auszahlungen','N','Y', 11); // Guest menu - addGuestMenuSql('main','wernis_portal','WDS66-News','N','Y', 7); + addGuestMenuSql('main', 'wernis_portal', 'WDS66-News', 'N', 'Y', 7); break; case 'remove': // Do stuff when removing extension diff --git a/inc/extensions/ext-yoomedia.php b/inc/extensions/ext-yoomedia.php index 33fdc927be..f2472132a6 100644 --- a/inc/extensions/ext-yoomedia.php +++ b/inc/extensions/ext-yoomedia.php @@ -73,7 +73,7 @@ switch (getExtensionMode()) { // Reload lock table addDropTableSql('yoomedia_reload'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_yoomedia_reload` ( + addCreateTableSql('yoomedia_reload', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `type` VARCHAR(255) NOT NULL DEFAULT 'general', `y_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,