./inc/extensions/ext-network.php:37: * @TODO Yoo!Media: What is LayerAd compared to Layer click? *
./inc/extensions/ext-network.php:91: // @TODO network_type_handle is an internal name and needs documentation
./inc/extensions/ext-newsletter.php:218: // @TODO Move these into configuration
-./inc/extensions/ext-order.php:335: // @TODO This should be moved out to inc/daily/
+./inc/extensions/ext-order.php:336: // @TODO This should be moved out to inc/daily/
./inc/extensions/ext-rallye.php:329: // @TODO Move this code into rallye_functions.php
./inc/extensions/ext-rallye.php:92: // @TODO Fix config_rallye_prices to list_rallye_prices
./inc/extensions/ext-yoomedia.php:121: // @TODO Can this be moved into a database table?
logDebugMessage(__FUNCTION__, __LINE__, 'Possible problem: ' . $sql . ',hasZeroNums=' . intval(SQL_HASZERONUMS($result)) . '');
}
} // END - foreach
- } elseif ((getConfig('_TABLE_TYPE') == 'InnoDB') && (strpos($sql, 'FULLTEXT') !== false)) {
+ } elseif ((getTableType() == 'InnoDB') && (strpos($sql, 'FULLTEXT') !== false)) {
// Skip this query silently
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Skipped FULLTEXT: sql=%s,tableName=%s,hasZeroNums=%d,file=%s,line=%s", $sql, $tableName, intval((is_bool($result)) ? 0 : SQL_HASZERONUMS($result)), $F, $L));
} elseif ($noIndex === false) {
} // END while
} // END - if
- // Show indexes
- $result = SQL_QUERY_ESC("SHOW INDEX FROM `%s`", array($tableName), __FUNCTION__, __LINE__);
-
- // Non-skipping is default for ADD
- $skip = false;
-
- // But should we DROP?
- if ($tableArray[3] == 'DROP') {
- // Then skip if nothing found
- $skip = true;
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Going to drop key ' . $keyName);
- } // END - if
-
- // Walk through all
- while ($content = SQL_FETCHARRAY($result)) {
- // Is it found?
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName='.$keyName.',content=<pre>' . print_r($content, true) . '</pre>');
- if (($content['Key_name'] == $keyName) && ($tableArray[3] == 'ADD')) {
- // Skip this query!
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("ADD: Skiped: %s", $sql));
- $skip = true;
- break;
- } elseif (($content['Key_name'] == $keyName) && ($tableArray[3] == 'DROP')) {
- // Don't skip this!
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("DROP: Not skiped: %s", $sql));
- $skip = false;
- break;
- }
- } // END - while
-
- // Free result
- SQL_FREERESULT($result);
-
// Shall we run it?
- if ($skip === false) {
+ if (!isSqlTableIndexAdded($tableName, $tableArray[3])) {
// Send it to the SQL_QUERY() function
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $sql);
$result = SQL_QUERY($sql, $F, $L, $enableCodes);
return;
} elseif ((!is_resource($link)) && (!is_null($link))) {
// This should never happen!
- debug_report_bug(__FUNCTION__, __LINE__, sprintf("link is not resource or null. Type: %s", gettype($link)));
+ debug_report_bug(__FUNCTION__, __LINE__, sprintf("Type of link is not resource or null, type=%s", gettype($link)));
} // END - if
// Set it
return $GLOBALS['sql_strings'][$sqlString];
}
+// Check if there is a SQL table created
+function isSqlTableCreated ($table) {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__][$table])) {
+ // Check if the table is there
+ $result = SQL_QUERY_ESC("SHOW TABLES FROM `{?__DB_NAME?}` WHERE `Tables_in_{?__DB_NAME?}`='{?_MYSQL_PREFIX?}_%s' LIMIT 1",
+ array($table), __FILE__, __LINE__);
+
+ // Is there an entry?
+ $GLOBALS[__FUNCTION__][$table] = (SQL_NUMROWS($result) == 1);
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__][$table];
+}
+
+// Checks depending on the mode if the table is there
+function isSqlTableIndexAdded ($tableName, $mode) {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__][$tableName][$mode])) {
+ // Show indexes
+ $result = SQL_QUERY_ESC("SHOW INDEX FROM `%s`", array($tableName), __FUNCTION__, __LINE__);
+
+ // Non-skipping is default for ADD
+ $GLOBALS[__FUNCTION__][$tableName][$mode] = false;
+
+ // But should we DROP?
+ if ($mode == 'DROP') {
+ // Then skip if nothing found
+ $GLOBALS[__FUNCTION__][$tableName][$mode] = true;
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Going to drop key ' . $keyName);
+ } // END - if
+
+ // Walk through all
+ while ($content = SQL_FETCHARRAY($result)) {
+ // Is it found?
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName='.$keyName.',content=<pre>' . print_r($content, true) . '</pre>');
+ if (($content['Key_name'] == $keyName) && ($mode == 'ADD')) {
+ // Skip this query!
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("ADD: Skiped: %s", $sql));
+ $GLOBALS[__FUNCTION__][$tableName][$mode] = true;
+ break;
+ } elseif (($content['Key_name'] == $keyName) && ($mode == 'DROP')) {
+ // Don't skip this!
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("DROP: Not skiped: %s", $sql));
+ $GLOBALS[__FUNCTION__][$tableName][$mode] = false;
+ break;
+ }
+ } // END - while
+
+ // Free result
+ SQL_FREERESULT($result);
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__][$tableName][$mode];
+}
+
// [EOF]
?>
return ($GLOBALS['cache_array']['extension']['ext_func'][$ext_name] == 'Y');
}
+// Adds a DROP TABLE statement if the requested tabled is there
+function addDropTableSql ($table) {
+ // Is the table there?
+ if (isSqlTableCreated($table)) {
+ // Then add it, non-existing tables can be ignored because it will
+ // happen with every newly installed extension.
+ addExtensionSql('DROP TABLE `{?_MYSQL_PREFIX?}_' . $table . '`');
+ } // END - if
+}
+
// Adds an admin menu to the SQL queue of the menu entry is not found
function addAdminMenuSql ($action, $what, $title, $descr, $sort) {
// Now check if this menu is there
case 'remove': // Do stuff when removing extension
// SQL commands to run
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='admins'");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_acls`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_mails`');
+ addDropTableSql('admins_acls');
+ addDropTableSql('admins_mails');
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` DROP `default_acl`");
// Remove filters
// But allow current admin everything (THIS SHALL BE YOU!)
addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `default_acl`='allow' WHERE `id`=".bigintval(getCurrentAdminId())." LIMIT 1");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_acls`');
+ addDropTableSql('admins_acls');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admins_acls` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
break;
case '0.4.0': // SQL queries for v0.4.0
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_mails`');
+ addDropTableSql('admins_mails');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admins_mails` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 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?}_bank_accounts`');
+ addDropTableSql('bank_accounts');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_accounts` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
INDEX (account_locked),
INDEX (last_tan_stamp)
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_transfers`');
+ addDropTableSql('bank_transfers');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_transfers` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
to_account_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
INDEX (to_account_id, from_account_id),
INDEX (day_bookkeeping, day_available)
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_packages`');
+ addDropTableSql('bank_packages');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_packages` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` VARCHAR(255) NOT NULL DEFAULT '',
// what the member shall get for the specified income. output_system_mode
// 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.
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_tanlist`');
+ addDropTableSql('bank_tanlist');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_tanlist` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`idx` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_accounts`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_transfers`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_packages`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_tanlist`');
+ addDropTableSql('bank_accounts');
+ addDropTableSql('bank_transfers');
+ addDropTableSql('bank_packages');
+ addDropTableSql('bank_tanlist');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='bank'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='bank'");
break;
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `beg_userid_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT 1800");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `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");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_beg_ips`');
+ addDropTableSql('beg_ips');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_beg_ips` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_beg_ips`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_beg_referals`');
+ addDropTableSql('beg_ips');
+ addDropTableSql('beg_referals');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('config_beg','list_beg','list_beg_referal_urls')");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='beg'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what` IN ('beg','beg2')");
break;
case '0.2.9': // SQL queries for v0.2.9
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_beg_referals`');
+ addDropTableSql('beg_referals');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_beg_referals` (
`id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL ,
case 'remove': // Do stuff when removing extension
// SQL commands to run
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` DROP birthday_sent");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_birthday`');
+ addDropTableSql('user_birthday');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_birthday'");
break;
case '0.2.0': // SQL queries for v0.2
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `birthday_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_birthday`');
+ addDropTableSql('user_birthday');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_birthday` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
// SQL commands to run
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);
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus`');
+ addDropTableSql('bonus`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bonus` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`cat_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
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' LIMIT 1");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='bonus'");
- 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`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_turbo`');
+ addDropTableSql('bonus');
+ addDropTableSql('bonus_urls');
+ addDropTableSql('bonus_customer');
+ addDropTableSql('bonus_turbo');
// Unregister filter
unregisterFilter(__FUNCTION__, __LINE__, 'member_login_check', 'ADD_LOGIN_BONUS', true, isExtensionDryRun());
break;
case '0.2.2': // SQL queries for v0.2.2
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_turbo`');
+ addDropTableSql('bonus_turbo');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bonus_turbo` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
break;
case '0.2.5': // SQL queries for v0.2.5
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_urls`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_customer`');
+ addDropTableSql('bonus_urls');
+ addDropTableSql('bonus_customer');
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Tabellen <u>{?_MYSQL_PREFIX?}_bonus_urls</u> und <u>{?_MYSQL_PREFIX?}_bonus_customer</u> entfernt, da dies bald von der Erweiterung <u>sponsor</u> erledigt wird.");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `booking_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay() * 3)."");
// Drop/create table for user bookings
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_book`');
+ addDropTableSql('user_book');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_book`(
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
break;
case 'remove': // Do stuff when removing extension
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_book`');
+ addDropTableSql('user_book');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('config_booking','list_booking')");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='booking'");
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?}_countries`');
+ addDropTableSql('countries');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_countries` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`code` CHAR(2) NOT NULL DEFAULT 'DE',
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`');
+ addDropTableSql('countries');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='country'");
break;
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// Table for debug log entries
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log`');
+ addDropTableSql('debug_log');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_log` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sender_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) TYPE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Debug log data'");
// Table against debug log abuse
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log_abuse`');
+ addDropTableSql('debug_log_abuse');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_log_abuse` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) TYPE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Debug log abuse'");
// Table on relay/server for client exchanges
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client`');
+ addDropTableSql('debug_client');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_client` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`key` VARCHAR(255) NOT NULL DEFAULT 'SELF',
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_debug_client` (`url`,`title`,`webmaster`,`status`) VALUES ('{?URL?}','{?MAIN_TITLE?}','{?WEBMASTER?}','ACTIVE')");
// Table for debug log <-> client connection
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client_log`');
+ addDropTableSql('debug_client_log');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_client_log` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 1,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client_log`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log_abuse`');
+ addDropTableSql('debug_client_log');
+ addDropTableSql('debug_client');
+ addDropTableSql('debug_log');
+ addDropTableSql('debug_log_abuse');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='debug'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='debug'");
break;
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// Doubler table
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_doubler`');
+ addDropTableSql('doubler');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_doubler` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_doubler`');
+ addDropTableSql('doubler');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='doubler'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='doubler'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='doubler'");
addExtensionDependency('sponsor');
// - Ads
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_forced_ads`');
+ addDropTableSql('forced_ads');
addExtensionSql("CREATE TABLE IF NOT EXIST `{?_MYSQL_PREFIX?}_forced_ads` (
`forced_ads_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`forced_ads_ad_url` VARCHAR( 255 ) NULL DEFAULT NULL ,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Forced Ads Data'");
// - Campaigns
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_forced_campaigns`');
+ addDropTableSql('forced_campaigns');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_forced_campaigns` (
`forced_campaign_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`forced_campaign_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Forced Campaign Data'");
// - Campaigns <-> Ads
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_forced_campaigns_ads`');
+ addDropTableSql('forced_campaigns_ads');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_forced_campaigns_ads` (
`forced_campaign_ads_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`forced_campaign_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL ,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Forced Campaigns<->Ads'");
// - Campaigns <-> User
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_forced_campaigns_user`');
+ addDropTableSql('forced_campaigns_user');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_forced_campaigns_user` (
`forced_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`forced_campaign_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL ,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Forced Campaigns<->User'");
// - Campaign costs
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_forced_costs`');
+ addDropTableSql('forced_costs');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_forced_costs` (
`forced_costs_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`forced_costs_price_click` FLOAT( 20, 5 ) UNSIGNED NULL DEFAULT NULL ,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Forced Campaign Costs'");
// - Campaign Statistics
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_forced_stats`');
+ addDropTableSql('forced_stats');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_forced_stats` (
`forced_stats_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`forced_stats_campaign_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL ,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_forced_ads`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_forced_campaigns`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_forced_campaigns_ads`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_forced_campaigns_user`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_forced_costs`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_forced_stats`');
+ addDropTableSql('forced_ads');
+ addDropTableSql('forced_campaigns');
+ addDropTableSql('forced_campaigns_ads');
+ addDropTableSql('forced_campaigns_user');
+ addDropTableSql('forced_costs');
+ addDropTableSql('forced_stats');
break;
case 'activate': // Do stuff when admin activates this extension
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// Create database
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_holidays`');
+ addDropTableSql('user_holidays');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_holidays` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_holidays`');
+ addDropTableSql('user_holidays');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='holiday' LIMIT 1");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='holiday' LIMIT 4");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE `value`=0 LIMIT 1");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `imprint_image_script` VARCHAR(255) NOT NULL DEFAULT ''");
// Create imprint data table
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_imprint_data`');
+ addDropTableSql('imprint_data');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_imprint_data` (
`imprint_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`imprint_key` VARCHAR(255) NOT NULL DEFAULT '',
case 'remove': // Do stuff when removing extension
// Imprint data
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_imprint_data`');
+ addDropTableSql('imprint_data');
// Guest menu
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='imprint' LIMIT 1");
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_mediadata`');
+ addDropTableSql('mediadata');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_mediadata'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='mediadata'");
case '0.0.4': // SQL queries for v0.0.4
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_mediadata`');
+ addDropTableSql('mediadata');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_mediadata` (
`media_key` VARCHAR(255) NOT NULL DEFAULT '',
`media_value` VARCHAR(255) NOT NULL DEFAULT '',
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// Main table which hold
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_data`');
+ addDropTableSql('network_data');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_data` (
`network_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`network_short_name` VARCHAR(50) NOT NULL DEFAULT '',
// Types the network provider is supporting (e.g. Forced-Banner and so on)
// @TODO network_type_handle is an internal name and needs documentation
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_types`');
+ addDropTableSql('network_types');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_types` (
`network_type_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Types provideable by networks'");
// HTTP parameters (names) for URLs
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_request_params`');
+ addDropTableSql('network_request_params');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_request_params` (
`network_param_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Request parameters for GET/POST request'");
// Error status codes
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_error_codes`');
+ addDropTableSql('network_error_codes');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_error_codes` (
`network_type_code_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Error codes for all types'");
// Code types (internal table)
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_error_types`');
+ addDropTableSql('network_error_types');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_error_types` (
`network_code_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`network_code` VARCHAR(100) NOT NULL DEFAULT 'INVALID_CODE',
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Error types, generic data, DO NOT ALTER!'");
// Valid translation keys (we hate hard-coded arrays, you see?)
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_translations`');
+ addDropTableSql('network_translations');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_translations` (
`network_translation_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`network_translation_name` VARCHAR(100) NOT NULL DEFAULT '',
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Translations for array keys, generic data, DO NOT ALTER!'");
// Array-Element translation tables per type/provider
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_api_translation`');
+ addDropTableSql('network_api_translation');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_api_translation` (
`network_api_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Translation of API responses, generic data, DO NOT ALTER!'");
// Data from the webmaster (you!)
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_config`');
+ addDropTableSql('network_config');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_config` (
`network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`network_affiliate_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Configuration data from the webmaster (you!)'");
// Configuration data for e.g. reload-time
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_types_config`');
+ addDropTableSql('network_types_config');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_types_config` (
`network_data_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
// Cache for queried APIs. Re-check depends on config
// `network_cache_refresh` in seconds or if set to zero, full day
// divided by query amount.
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_cache`');
+ addDropTableSql('network_cache');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_cache` (
`network_cache_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Cache for all queried APIs'");
// Reload locks for several types
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_reloads`');
+ addDropTableSql('network_reloads');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_reloads` (
`network_reload_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_data`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_types`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_request_params`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_error_codes`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_error_types`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_api_translation`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_config`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_types_config`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_cache`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_reloads`');
+ addDropTableSql('network_data');
+ addDropTableSql('network_types');
+ addDropTableSql('network_request_params');
+ addDropTableSql('network_error_codes');
+ addDropTableSql('network_error_types');
+ addDropTableSql('network_api_translation');
+ addDropTableSql('network_config');
+ addDropTableSql('network_types_config');
+ addDropTableSql('network_cache');
+ addDropTableSql('network_reloads');
// Admin menu
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='network'");
// SQL commands to run
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='newsletter'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='newsletter'");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_newsletter_data`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_newsletter_topics`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_newsletter_orders`');
+ addDropTableSql('newsletter_data');
+ addDropTableSql('newsletter_topics');
+ addDropTableSql('newsletter_orders');
break;
case 'activate': // Do stuff when admin activates this extension
case '0.2.0': // SQL queries for v0.2.0
// Tables:
// - Main data table
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_newsletter_data`');
+ addDropTableSql('newsletter_data');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_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}',
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'General newsletter data'");
// - Topics data table
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_newsletter_topics`');
+ addDropTableSql('newsletter_topics');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_newsletter_topics` (
`nl_topic_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`nl_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Newsletter topics'");
// - Sponsor orders data table
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_newsletter_orders`');
+ addDropTableSql('newsletter_orders');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_newsletter_orders` (
`nl_order_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`nl_sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
// 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('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_nickname_history`');
+ addDropTableSql('nickname_history');
break;
case 'activate': // Do stuff when admin activates this extension
case '0.1.9': // SQL queries for v0.1.9
addAdminMenuSql('user','list_nickname','Nickname-Historie','Listet alle verwendeten Nicknames der Mitglieder auf.', 12);
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_nickname_history`');
+ addDropTableSql('nickname_history');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_nickname_history` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 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?}_online`');
+ addDropTableSql('online');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_online` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sid` VARCHAR(32) NOT NULL DEFAULT '',
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_online`');
+ addDropTableSql('online');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='usr_online'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='online'");
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?}_optimize_gain`');
+ addDropTableSql('optimize_gain');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_optimize_gain` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`gain` decimal(10,3) NOT NULL DEFAULT '0.000',
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_optimize_gain`');
+ addDropTableSql('optimize_gain');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='optimize' LIMIT 1");
break;
case 'remove': // Do stuff when removing extension
// SQL commands to run
+ addDropTableSql('url_blacklist');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_order' LIMIT 1");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='order'");
break;
break;
case '0.5.0': // SQL queries for v0.5.0
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_url_blacklist`');
+ addDropTableSql('url_blacklist');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_url_blacklist` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`url` VARCHAR(255) NOT NULL DEFAULT '',
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?}_user_payouts`');
+ addDropTableSql('user_payouts');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_payouts` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
INDEX (`payout_id`),
PRIMARY KEY (`id`)
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_payout_types`');
+ addDropTableSql('payout_types');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_payout_types` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`type` VARCHAR(255) NOT NULL DEFAULT '',
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_payouts`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_payout_types`');
+ addDropTableSql('user_payouts');
+ addDropTableSql('payout_types');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='payouts'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='payout'");
break;
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?}_user_primera`');
+ addDropTableSql('user_primera');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_primera` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_primera`');
+ addDropTableSql('user_primera');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='primera'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='primera'");
break;
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?}_rallye_data`');
+ addDropTableSql('rallye_data');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_rallye_data` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
KEY (`admin_id`),
PRIMARY KEY (`id`)
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_prices`');
+ addDropTableSql('rallye_prices');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_rallye_prices` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`rallye_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
INDEX (`rallye_id`),
PRIMARY KEY (`id`)
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_users`');
+ addDropTableSql('rallye_users');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_rallye_users` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`rallye_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// Drop tables
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_data`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_prices`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_users`');
+ addDropTableSql('rallye_data');
+ addDropTableSql('rallye_prices');
+ addDropTableSql('rallye_users');
// Remove menus
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='rallye'");
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?}_user_refs`');
+ addDropTableSql('user_refs');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_refs` (
`id` BIGINT(20) UNSIGNED NOT NULL auto_increment,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_refs`');
+ addDropTableSql('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("UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET level=level-1");
case 'remove': // Do stuff when removing extension
// SQL commands to run
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_register'");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`');
+ addDropTableSql('must_register');
// Unregister a filter
unregisterFilter(__FUNCTION__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', true, isExtensionDryRun());
case 'update': // Update an extension
switch (getCurrentExtensionVersion()) {
case '0.1.0': // SQL queries for v0.1
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`');
+ addDropTableSql('must_register');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_must_register` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`field_name` VARCHAR(255) NOT NULL DEFAULT '',
//
// Sponsor data
//
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_data`');
+ addDropTableSql('sponsor_data');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_data` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`company` VARCHAR(255) NOT NULL DEFAULT '',
//
// Sponsor orders
//
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_orders`');
+ addDropTableSql('sponsor_orders');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_orders` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// Pay-types
//
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_paytypes`');
+ addDropTableSql('sponsor_paytypes');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_paytypes` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`pay_name` VARCHAR(255) NOT NULL DEFAULT '',
//
// Points-to-action converting
//
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_action_convert`');
+ addDropTableSql('sponsor_action_convert');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_action_convert` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`ext_name` VARCHAR(255) NOT NULL DEFAULT 'sponsor',
//
// Sponsor menu system (default)
//
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_menu`');
+ addDropTableSql('sponsor_menu');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_menu` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`action` VARCHAR(255) NOT NULL DEFAULT '',
//
// Registry for performable actions by your sponsors
//
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_registry`');
+ addDropTableSql('sponsor_registry');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_registry` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// URLs from the sponsors
//
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_urls`');
+ addDropTableSql('sponsor_urls');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_urls` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// Banners of any size from the sponsors
//
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_banner`');
+ addDropTableSql('sponsor_banner');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_banner` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// Campaigns
//
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaigns`');
+ addDropTableSql('sponsor_campaigns');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_campaigns` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// Campaigns + URLs + Banner
//
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns`');
+ addDropTableSql('sponsor_campaign_assigns');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`campaignid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// Allowed data to display (administrative)
//
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_admin_data`');
+ addDropTableSql('sponsor_admin_data');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_admin_data` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`data_row` VARCHAR(255) NOT NULL DEFAULT '',
//
// Allowed data to display (sponsor-side)
//
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_display_data`');
+ addDropTableSql('sponsor_display_data');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_display_data` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_data`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_orders`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_action_convert`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_paytypes`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_menu`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_registry`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_urls`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_banner`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaigns`');
- 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`');
+ addDropTableSql('sponsor_data');
+ addDropTableSql('sponsor_orders');
+ addDropTableSql('sponsor_action_convert');
+ addDropTableSql('sponsor_paytypes');
+ addDropTableSql('sponsor_menu');
+ addDropTableSql('sponsor_registry');
+ addDropTableSql('sponsor_urls');
+ addDropTableSql('sponsor_banner');
+ addDropTableSql('sponsor_campaigns');
+ addDropTableSql('sponsor_campaign_assigns');
+ addDropTableSql('sponsor_admin_data');
+ addDropTableSql('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?}_guest_menu` WHERE `action`='sponsor'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what` IN('sponsor_list','sponsor_reg')");
case 'remove': // Do stuff when removing extension
// Drop tables
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admin_menu_las`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admin_menu_las_data`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admin_menu_stats`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_filters`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_dns_cache`');
+ addDropTableSql('admin_menu_las');
+ addDropTableSql('admin_menu_las_data');
+ addDropTableSql('admin_menu_stats');
+ addDropTableSql('filters');
+ addDropTableSql('dns_cache');
// Delete admin menu entries
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE
case '0.3.2': // SQL queries for v0.3.2
// Connection table between the menu system and the "logical area" system
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admin_menu_las`');
+ addDropTableSql('admin_menu_las');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admin_menu_las` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`la_id` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
// All "logical areas" together
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admin_menu_las_data`');
+ addDropTableSql('admin_menu_las_data');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admin_menu_las_data` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`la_id` VARCHAR(255) NOT NULL DEFAULT '',
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `admin_menu_sorter` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
// The statistics table
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admin_menu_stats`');
+ addDropTableSql('admin_menu_stats');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admin_menu_stats` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
break;
case '0.5.9': // SQL queries for v0.5.9
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_filters`');
+ addDropTableSql('filters');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_filters` (
`filter_id` BIGINT(20) UNSIGNED AUTO_INCREMENT,
`filter_name` VARCHAR(50) NOT NULL DEFAULT '',
case '0.7.0': // SQL queries for 0.7.0
// Table definition
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_dns_cache`');
+ addDropTableSql('dns_cache');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_dns_cache` (
`hostname` VARCHAR(255) NOT NULL,
`ip` VARCHAR(15) NOT NULL,
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// SQL commands to run (surfbar URLs)
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_urls`');
+ addDropTableSql('surfbar_urls');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_urls` (
`url_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`url_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Surfbar URLs'");
// Reload locks
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_locks`');
+ addDropTableSql('surfbar_locks');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_locks` (
`locks_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`locks_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Surfbar reload locks'");
// Surfbar salts
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_salts`');
+ addDropTableSql('surfbar_salts');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_salts` (
`salts_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`salts_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Surfbar last used salts'");
// Statistics
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_stats`');
+ addDropTableSql('surfbar_stats');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_stats` (
`stats_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`stats_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Surfbar Statistics'");
// Member actions pending on status
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_actions`');
+ addDropTableSql('surfbar_actions');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_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,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_actions`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_locks`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_salts`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_stats`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_urls`');
+ addDropTableSql('surfbar_actions');
+ addDropTableSql('surfbar_locks');
+ addDropTableSql('surfbar_salts');
+ addDropTableSql('surfbar_stats');
+ addDropTableSql('surfbar_urls');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='surfbar'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='surfbar'");
case 'remove': // Do stuff when removing extension
// Drop theme table
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_themes`');
+ addDropTableSql('themes');
// Delete admin menu
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='theme'");
case '0.0.8': // SQL queries for v0.0.8
// Theme table
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_themes`');
+ addDropTableSql('themes');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_themes` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`theme_path` VARCHAR(255) NOT NULL DEFAULT '',
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
- // SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_in`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_out`');
-
// Transfer from a member
+ addDropTableSql('user_transfers_in');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_transfers_in` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
// Transfers to a member
+ addDropTableSql('user_transfers_out');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_transfers_out` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_in`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_out`');
+ addDropTableSql('user_transfers_in');
+ addDropTableSql('user_transfers_out');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='transfer'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='transfer'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` DROP `opt_in`");
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_cats`');
+ addDropTableSql('user_cats');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_cats` (
`id` BIGINT(22) NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
INDEX (`cat_id`)
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_data`');
+ addDropTableSql('user_data');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_data` (
`userid` BIGINT(22) NOT NULL AUTO_INCREMENT,
`surname` VARCHAR(255) NOT NULL DEFAULT '',
INDEX `status_mails` (`status`,`max_mails`)
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_points`');
+ addDropTableSql('user_points');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_points` (
`id` BIGINT(22) NOT NULL AUTO_INCREMENT,
`userid` BIGINT(22) NOT NULL DEFAULT 0,
INDEX (`userid`)
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_links`');
+ addDropTableSql('user_links');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_links` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`stats_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
INDEX (`stats_id`)
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats`');
+ addDropTableSql('user_stats');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_stats` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
INDEX (`pool_id`)
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats_data`');
+ addDropTableSql('user_stats_data');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_stats_data` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_del`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_cats`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_data`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_points`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_links`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats`');
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats_data`');
+ addDropTableSql('user_del');
+ addDropTableSql('user_cats');
+ addDropTableSql('user_data');
+ addDropTableSql('user_points');
+ addDropTableSql('user_links');
+ addDropTableSql('user_stats');
+ addDropTableSql('user_stats_data');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') OR `action`='user'");
break;
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `lock_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `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);
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_del`');
+ addDropTableSql('user_del');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_del` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 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?}_user_wernis`');
+ addDropTableSql('user_wernis');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_wernis` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_wernis`');
+ addDropTableSql('user_wernis');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='wernis'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='wernis'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='wernis_portal'");
addAdminMenuSql('email','list_yoomedia_tm','Yoo!Media Textmails','Listet Textmail-Buchungen über das Interface 2.0 von Yoo!Media nach Ihren eingestellten Kriterien auf. <strong>Vorsicht:</strong> Jede Aktualisierung dieser Liste kostet Ihnen eine Abfrage!',10);
// Reload lock table
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_yoomedia_reload`');
+ addDropTableSql('yoomedia_reload');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_yoomedia_reload` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`type` VARCHAR(255) NOT NULL DEFAULT 'general',
case 'remove': // Do stuff when removing extension
// SQL commands to run
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_yoomedia','list_yoomedia_tm')");
- addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_yoomedia_reload`');
+ addDropTableSql('yoomedia_reload');
break;
case 'activate': // Do stuff when admin activates this extension
adminEditEntriesConfirm(
postRequestParameter('id'),
'bank_packages',
- array('id', 'title', 'description', 'account_fee', 'free_transfers', 'transfer_fee', 'output_system_mode', 'package_active', 'free_months_no_fee', 'interest_plus', 'interest_minus', 'first_payment', 'free_account_income', 'free_account_stuff', 'tan_lock'),
- array('bigintval', '', '', 'translateComma', 'bigintval', 'translateComma', '', '', 'bigintval', 'translateComma', 'translateComma', 'translateComma', 'translateComma', '', 'bigintval'),
- array('', '', '', '', '', '', '', '', '', '', '', '', '', '', '')
+ array(
+ 'id',
+ 'title',
+ 'description',
+ 'account_fee',
+ 'free_transfers',
+ 'transfer_fee',
+ 'output_system_mode',
+ 'package_active',
+ 'free_months_no_fee',
+ 'interest_plus',
+ 'interest_minus',
+ 'first_payment',
+ 'free_account_income',
+ 'free_account_stuff',
+ 'tan_lock'
+ ),
+ array(
+ 'bigintval',
+ '',
+ '',
+ 'translateComma',
+ 'bigintval',
+ 'translateComma',
+ '',
+ '',
+ 'bigintval',
+ 'translateComma',
+ 'translateComma',
+ 'translateComma',
+ 'translateComma',
+ '',
+ 'bigintval'
+ ),
+ array(
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ ''
+ )
);
$show = false;
} elseif (isPostRequestParameterSet('do_edit')) {
// Delete entries (with confirmation)
- adminEditEntriesConfirm(postRequestParameter('id'), 'bank_packages', array(), array(), array(), true);
+ adminEditEntriesConfirm(
+ postRequestParameter('id'),
+ 'bank_packages',
+ array(),
+ array(),
+ array(),
+ true
+ );
} elseif (isPostRequestParameterSet('delete')) {
// Delete entries (with confirmation)
- adminDeleteEntriesConfirm(postRequestParameter('id'), 'bank_packages', array('id', 'title', 'description', 'account_fee'), array('bigintval', '', '', 'translateComma'), array('', '', '', ''));
+ adminDeleteEntriesConfirm(
+ postRequestParameter('id'),
+ 'bank_packages',
+ array(
+ 'id',
+ 'title',
+ 'description',
+ 'account_fee'
+ ),
+ array(
+ 'bigintval',
+ '',
+ '',
+ 'translateComma'
+ ),
+ array(
+ '',
+ '',
+ '',
+ ''
+ )
+ );
$show = false;
} elseif (isFormSent('remove')) {
// Delete entries (with confirmation)
- adminDeleteEntriesConfirm(postRequestParameter('id'), 'bank_packages', array(), array(), array(), true);
+ adminDeleteEntriesConfirm(
+ postRequestParameter('id'),
+ 'bank_packages',
+ array(),
+ array(),
+ array(),
+ true
+ );
}
} // END - if
adminEditEntriesConfirm(
postRequestParameter('url_id'),
'surfbar_urls',
- array('url_id', 'url_userid', 'url'),
- array('bigintval', 'addMemberSelectionBox', ''),
- array('', array(false, true, true, 'url_userid[]'), ''),
+ array(
+ 'url_id',
+ 'url_userid',
+ 'url'
+ ),
+ array(
+ 'bigintval',
+ 'addMemberSelectionBox',
+ ''
+ ),
+ array(
+ '',
+ array(
+ false,
+ true,
+ true,
+ 'url_userid[]'
+ ),
+ ''
+ ),
false,
'url_id',
'url_userid',
adminDeleteEntriesConfirm(
postRequestParameter('url_id'),
'surfbar_urls',
- array('url_id', 'url_userid', 'url', 'url_registered'),
- array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', ''),
- array('', '', '', ''),
+ array(
+ 'url_id',
+ 'url_userid',
+ 'url',
+ 'url_registered'
+ ),
+ array(
+ 'bigintval',
+ 'generateUserProfileLink',
+ 'generateFrametesterUrl',
+ ''
+ ),
+ array(
+ '',
+ '',
+ '',
+ ''
+ ),
false,
'url_id',
'url_userid',
$show = false;
} elseif (isPostRequestParameterSet('do_delete')) {
// Remove entries from database
- adminDeleteEntriesConfirm(postRequestParameter('url_id'), 'surfbar_urls', array(), array(), array(), true, 'url_id');
+ adminDeleteEntriesConfirm(
+ postRequestParameter('url_id'),
+ 'surfbar_urls',
+ array(),
+ array(),
+ array(),
+ true,
+ 'url_id'
+ );
} elseif (isFormSent('lock')) {
// Un-/lock selected URLs. This does not work for pending URLs
adminLockEntriesConfirm(
postRequestParameter('url_id'),
'surfbar_urls',
- array('url_id', 'url_userid', 'url', 'url_registered', 'url_status'),
- array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', '', 'translateSurfbarUrlStatus'),
- array('', '', '', '', ''),
+ array(
+ 'url_id',
+ 'url_userid',
+ 'url',
+ 'url_registered',
+ 'url_status'
+ ),
+ array(
+ 'bigintval',
+ 'generateUserProfileLink',
+ 'generateFrametesterUrl',
+ '',
+ 'translateSurfbarUrlStatus'
+ ),
+ array(
+ '',
+ '',
+ '',
+ '',
+ ''
+ ),
false,
'url_id',
'url_userid',
array(),
array(),
array(),
- array('url_status' => array('ACTIVE' => 'LOCKED', 'LOCKED' => 'ACTIVE')),
+ array(
+ 'url_status' => array(
+ 'ACTIVE' => 'LOCKED',
+ 'LOCKED' => 'ACTIVE'
+ )
+ ),
true,
'url_id',
'url_userid',
adminUndeleteEntriesConfirm(
postRequestParameter('url_id'),
'surfbar_urls',
- array('url_id', 'url_userid', 'url', 'url_registered', 'url_status'),
- array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', '', 'translateSurfbarUrlStatus'),
- array('', '', '', '', ''),
+ array(
+ 'url_id',
+ 'url_userid',
+ 'url',
+ 'url_registered',
+ 'url_status'
+ ),
+ array(
+ 'bigintval',
+ 'generateUserProfileLink',
+ 'generateFrametesterUrl',
+ '',
+ 'translateSurfbarUrlStatus'
+ ),
+ array(
+ '',
+ '',
+ '',
+ '',
+ ''
+ ),
false,
'url_id',
'url_userid',
array(),
array(),
array(),
- array('url_status' => array('DELETED' => 'ACTIVE')),
+ array(
+ 'url_status' => array(
+ 'DELETED' => 'ACTIVE'
+ )
+ ),
true,
'url_id',
'url_userid',