- 'add_points' and 'sub_points' are user actions and should belong into ext-user
- Some minor comment improvements
`what_menu` VARCHAR(255) NOT NULL DEFAULT '',
`access_mode` ENUM('deny','allow') NOT NULL DEFAULT 'deny',
PRIMARY KEY (`id`),
-KEY (`admin_id`)",
+INDEX (`admin_id`)",
'Access control lines (ACLs)');
// Update notes (these will be set as task text!)
break;
case '0.7.1': // SQL queries for v0.7.1
- // Update depends on sql_patches
+ // Update depends on ext-sql_patches
addExtensionDependency('sql_patches');
// Add filters
`account_type` ENUM('CHECK','SAVING') NOT NULL DEFAULT 'CHECK',
`overdraft_credit` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
PRIMARY KEY (`id`),
-UNIQUE KEY (`pin`),
+UNIQUE (`pin`),
INDEX `userid_type` (`userid`, `account_type`),
INDEX (`account_created`),
INDEX (`account_locked`),
`points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`chk_value` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
-KEY (`userid`)",
+INDEX (`userid`)",
'Pending birthday codes');
// Admin menu
break;
case '0.2.0': // SQL queries for v0.2.0
- // This update depends on sql_patches
+ // This update depends on ext-sql_patches
addExtensionDependency('sql_patches');
// Update notes (these will be set as task text!)
`descr` VARCHAR(255) NOT NULL DEFAULT 'Deutschland',
`is_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (`id`),
-UNIQUE KEY (`code`)",
+UNIQUE (`code`)",
'Country codes and their full-length descriptions');
// Insert first (Germany) country
`coupon_code` VARCHAR(30) NULL DEFAULT NULL,
`cashed_on` TIMESTAMP NULL DEFAULT NULL,
PRIMARY KEY (`id`),
-UNIQUE KEY `coupon_user` (`coupon_id`, `userid`),
-UNIQUE KEY (`coupon_code`)",
+UNIQUE `coupon_user` (`coupon_id`, `userid`),
+UNIQUE (`coupon_code`)",
'Coupon->user connection');
// Configuration entries
`grade_description` TINYTEXT NOT NULL,
`grade_parent_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
PRIMARY KEY (`id`),
-UNIQUE KEY (`grade_name`),
+UNIQUE (`grade_name`),
INDEX (`grade_parent_id`)",
'Grade general data');
`reached_mails` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
`time_valid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
-UNIQUE KEY (`grade_cash_name`)",
+UNIQUE (`grade_cash_name`)",
'Grade data if the grade have been "cashed"');
// Connection grade<->cash data
`grade_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`grade_cash_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
-UNIQUE KEY `grade_cash` (`grade_id`, `grade_cash_id`),
+UNIQUE `grade_cash` (`grade_id`, `grade_cash_id`),
INDEX (`grade_cash_id`)",
'Grade<->cash data connection');
`grade_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`grade_expired` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
-UNIQUE KEY (`userid`, `grade_id`),
+UNIQUE (`userid`, `grade_id`),
INDEX (`grade_id`)",
'Grade<->user connection');
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (`la_id`, `la_action`, `la_what`) VALUES ('member', '', 'del_holiday')");
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (`la_id`, `la_action`, `la_what`) VALUES ('config', '', 'config_holiday')");
- // Depends on sql_patches (or you have to execute these both SQL statements by phpMyAdmin
+ // Depends on ext-sql_patches (or you have to execute these both SQL statements by phpMyAdmin
addExtensionDependency('sql_patches');
// Update notes (these will be set as task text!)
// Change menu-string
addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Admin-Menü editieren' WHERE `what` = 'adminedit' LIMIT 1");
+ // Update notes (these will be set as task text!)
setExtensionUpdateNotes("Menüpunkt 'Vom Admin editieren' in 'Admin-Menü editieren' bei bereits bestehenden Installationen umändern.");
break;
case '0.0.4': // SQL queries for v0.0.4
// Change menu-string
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admin_menu` CHANGE `title` `title` VARCHAR(255) NOT NULL DEFAULT ''");
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='{OPEN_TEMPLATE}DEFAULT_POINTS{CLOSE_TEMPLATE} gutschreiben' WHERE `what` = 'add_points' LIMIT 1");
+ // Update notes (these will be set as task text!)
setExtensionUpdateNotes("VARCHAR(50) ist zu kurz für Linktitel (wegen der dynamischen Anteile).");
break;
} // END - switch
`nl_order_placed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`nl_order_accepted` ENUM('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (`nl_order_id`),
-UNIQUE KEY `sponsor_nl_topic` (`nl_sponsor_id`, `nl_id`, `nl_topic_id`),
+UNIQUE `sponsor_nl_topic` (`nl_sponsor_id`, `nl_id`, `nl_topic_id`),
INDEX `topic` (`nl_topic_id`)",
'Newsletter orders');
case 'update': // Update an extension
switch (getCurrentExtensionVersion()) {
case '0.0.1': // SQL queries for v0.0.1
- // This update depends on sql_patches update!
+ // This update depends on ext-sql_patches update!
addExtensionDependency('sql_patches');
// Update notes (these will be set as task text!)
`primera_api_message` TINYTEXT,
`primera_api_status` VARCHAR(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
-KEY (`userid`)",
+INDEX (`userid`)",
'Transfers in Primera');
// Configuration
`send_notify` ENUM('Y','N') NOT NULL DEFAULT 'Y',
`notified` ENUM('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (`id`),
-KEY (`admin_id`)",
+INDEX (`admin_id`)",
'Main rallye data');
addDropTableSql('rallye_prices');
break;
case '0.3.5': // SQL queries for 0.3.5
- // This update depends on sql_patches
+ // This update depends on ext-sql_patches
addExtensionDependency('sql_patches');
// Register filter
break;
case '0.1.1': // SQL queries for v0.1.1
- // This update depends on sql_patches update!
+ // This update depends on ext-sql_patches update!
addExtensionDependency('sql_patches');
// Update notes (these will be set as task text!)
break;
case '0.1.3': // SQL queries for v0.1.3
- // This update depends on sql_patches update!
+ // This update depends on ext-sql_patches update!
addExtensionDependency('sql_patches');
// Update notes (these will be set as task text!)
case 'update': // Update an extension
switch (getCurrentExtensionVersion()) {
case '0.0.1': // SQL queries for v0.0.1
- // Update depends on sql_patches
+ // Update depends on ext-sql_patches
addExtensionDependency('sql_patches');
// Add filters
`last_payment` FLOAT(7,2) UNSIGNED NOT NULL DEFAULT 0.00,
`last_currency` VARCHAR(255) NOT NULL DEFAULT '€',
PRIMARY KEY (`id`),
-UNIQUE KEY (`hash`),
+UNIQUE (`hash`),
INDEX (`refid`),
INDEX (`email`)",
'Main sponsor data');
`active` ENUM('Y','N') NOT NULL DEFAULT 'N',
`sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
-UNIQUE KEY `action_what` (`action`, `what`),
-UNIQUE KEY (`what`),
+UNIQUE `action_what` (`action`, `what`),
+UNIQUE (`what`),
INDEX (`action`)",
'Sponsor menu');
//
'list_unconfirmed',
'config_refid',
'config_title',
- 'sub_points',
'config_admin',
'config_proxy',
'config_session',
break;
case '0.2.6': // SQL queries for v0.2.6
- addAdminMenuSql('user','sub_points','{OPEN_CONFIG}POINTS{CLOSE_CONFIG} abziehen','Allen oder einem Mitglied {OPEN_CONFIG}POINTS{CLOSE_CONFIG} abziehen.', 8);
-
// Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Abzug von {?POINTS?} nun möglich.");
+ setExtensionUpdateNotes("Verschoben nach <strong>ext-user</strong>.");
break;
case '0.2.7': // SQL queries for v0.2.7
break;
case '0.3.1': // SQL queries for v0.3.1
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_extensions` ADD UNIQUE KEY `ext_name` (`ext_name`)");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` ADD UNIQUE KEY `login` (`login`)");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_extensions` ADD UNIQUE `ext_name` (`ext_name`)");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` ADD UNIQUE `login` (`login`)");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_refbanner` ADD INDEX `visible` (`visible`)");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_refdepths` ADD UNIQUE KEY `level` (`level`)");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_refdepths` ADD UNIQUE `level` (`level`)");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD INDEX `level` (`level`)");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_pool` ADD INDEX `data_type` (`data_type`)");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_mod_reg` ADD UNIQUE KEY `module` (`module`)");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_mod_reg` ADD UNIQUE `module` (`module`)");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admin_menu` ADD INDEX `action` (`action`)");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admin_menu` ADD INDEX `what` (`what`)");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_task_system` ADD INDEX `task_type` (`task_type`)");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_cats` ADD INDEX `sort` (`sort`)");
// Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Eindeutige Schlüssel (UNIQUE KEY) und normale Schlüssel (INDEX) gesetzt.");
+ setExtensionUpdateNotes("Eindeutige Schlüssel (UNIQUE) und normale Schlüssel (INDEX) gesetzt.");
break;
case '0.3.2': // SQL queries for v0.3.2
`la_posx` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`la_posy` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
-UNIQUE KEY (`la_id`),
+UNIQUE (`la_id`),
INDEX (`la_posx`),
INDEX (`la_posy`)",
'LAS position and title data');
`url_reject_reason` VARCHAR(255) NOT NULL DEFAULT '',
`url_fixed_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`url_id`),
-UNIQUE KEY `userid_url` (`url_userid`, `url`),
+UNIQUE `userid_url` (`url_userid`, `url`),
INDEX `status_userid` (`url_status`, `url_userid`)",
'Surfbar URLs');
`locks_url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`locks_last_surfed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`locks_id`),
-UNIQUE KEY `userid_url` (`locks_userid`, `locks_url_id`),
+UNIQUE `userid_url` (`locks_userid`, `locks_url_id`),
INDEX (`locks_url_id`)",
'Surfbar reload locks');
`salts_url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`salts_last_salt` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`salts_id`),
-UNIQUE KEY `salts_userid_url` (`salts_userid`, `salts_url_id`),
+UNIQUE `salts_userid_url` (`salts_userid`, `salts_url_id`),
INDEX (`salts_url_id`)",
'Surfbar last used salts');
`stats_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`stats_last_surfed` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`stats_id`),
-UNIQUE KEY `userid_url` (`stats_userid`, `stats_url_id`),
+UNIQUE `userid_url` (`stats_userid`, `stats_url_id`),
INDEX (`stats_url_id`)",
'Surfbar Statistics');
`actions_action` ENUM('EDIT','DELETE','PAUSE','UNPAUSE','FRAMETEST','RETREAT','RESUBMIT','BOOKNOW') NULL DEFAULT NULL,
`actions_new_status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL,
PRIMARY KEY (`actions_id`),
-UNIQUE KEY `status_action` (`actions_status`, `actions_action`)",
+UNIQUE `status_action` (`actions_status`, `actions_action`)",
'Surfbar Member Actions');
// Member actions
case 'update': // Update an extension
switch (getCurrentExtensionVersion()) {
case '0.0.1': // SQL queries for v0.0.1
- // This update depends on sql_patches update!
+ // This update depends on ext-sql_patches update!
addExtensionDependency('sql_patches');
// Update notes (these will be set as task text!)
`theme_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
`theme_ver` VARCHAR(255) NOT NULL DEFAULT '0.0.0',
PRIMARY KEY (`id`),
-UNIQUE KEY (`theme_path`),
+UNIQUE (`theme_path`),
INDEX (`theme_active`)", 'Themes');
// Admin menu
`time_trans` VARCHAR(14) NOT NULL DEFAULT 0,
`trans_id` VARCHAR(12) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
-KEY (`userid`),
-KEY (`from_userid`)",
+INDEX (`userid`),
+INDEX (`from_userid`)",
'Ingoing points transfers');
// Transfers to a member
`time_trans` VARCHAR(14) NOT NULL DEFAULT 0,
`trans_id` VARCHAR(12) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
-KEY (`userid`),
-KEY (`to_userid`)",
+INDEX (`userid`),
+INDEX (`to_userid`)",
'Outgoing points transfers');
// Admin menu
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (`la_id`, `la_action`, `la_what`) VALUES ('member', '', 'del_transfer')");
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu_las` (`la_id`, `la_action`, `la_what`) VALUES ('config', '', 'config_transfer')");
- // Depends on sql_patches (or you have to execute these both SQL statements by phpMyAdmin
+ // Depends on ext-sql_patches (or you have to execute these both SQL statements by phpMyAdmin
addExtensionDependency('sql_patches');
// Update notes (these will be set as task text!)
} // END - if
// Version number
-setThisExtensionVersion('0.4.5');
+setThisExtensionVersion('0.4.6');
// Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5'));
+setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6'));
// Keep this extension always active!
setExtensionAlwaysActive('Y');
break;
case '0.1.1': // SQL queries for v0.1.1
- // This update depends on sql_patches update!
+ // This update depends on ext-sql_patches update!
addExtensionDependency('sql_patches');
// Update notes (these will be set as task text!)
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Die Spalte <strong>link_type</strong> ist nun kein ENUM mehr, um weitere Mailtypen zu erlauben.");
break;
+
+ case '0.4.6': // SQL queries for v0.4.6
+ // SQL commands to run
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='{OPEN_TEMPLATE}DEFAULT_POINTS{CLOSE_TEMPLATE} gutschreiben' WHERE `what` = 'add_points' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='{OPEN_TEMPLATE}DEFAULT_POINTS{CLOSE_TEMPLATE} abziehen' WHERE `what` = 'sub_points' LIMIT 1");
+ addAdminMenuSql('user','sub_points','{OPEN_CONFIG}POINTS{CLOSE_CONFIG} abziehen','Allen oder einem Mitglied {OPEN_CONFIG}POINTS{CLOSE_CONFIG} abziehen.', 8);
+
+ // This update depends on ext-menu update
+ addExtensionDependency('menu');
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Abzug von {?POINTS?} sollte nun dabei sein und Hinzufügen gefixt (war zu kurze Spalte).");
+ break;
} // END - switch
break;
return false;
} // END - if
- // Is the extension sql_patches updated?
+ // Is the extension ext-sql_patches updated?
if ((!isExtensionInstalled('sql_patches')) || (isExtensionInstalledAndOlder('sql_patches', '0.5.9'))) {
// Abort silently here
logDebugMessage(__FUNCTION__, __LINE__, 'Cannot flush filters, sql_patches might be missing. isExtensionInstalled()=' . isExtensionInstalled('sql_patches') . ',isExtensionInstalledAndOlder()=' . isExtensionInstalledAndOlder('sql_patches', '0.5.9'));
// Init random number/cache buster
function FILTER_INIT_RANDOM_NUMBER () {
- // Is the extension sql_patches installed and at least 0.3.6?
+ // Is the extension ext-sql_patches installed and at least 0.3.6?
if ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && (isExtensionInstalledAndNewer('other', '0.2.5'))) {
// Generate random number
setConfigEntry('RAND_NUMBER', generateRandomCode(10, mt_rand(10000, 32766), getMemberId(), ''));
// Is the required extension 'sql_patches' there and a salt is not given?
// 123 4 43 3 4 432 2 3 32 2 3 32 2 3 3 21
if (((isExtensionInstalledAndOlder('sql_patches', '0.3.6')) && (empty($salt))) || (!isExtensionActive('sql_patches')) || (!isExtensionInstalledAndNewer('other', '0.2.5')) || (strlen($salt) == 32)) {
- // Extension sql_patches is missing/outdated so we hash the plain text with MD5
+ // Extension ext-sql_patches is missing/outdated so we hash the plain text with MD5
if ($hash === true) {
// Is plain password
return md5($plainText);
$countryRow = '`country`';
$countryData = substr(postRequestParameter('cntry'), 0, 2);
- // Add design when extension sql_patches is v0.2.7 or greater
+ // Add design when extension ext-theme is v0.0.8 or greater
// @TODO Rewrite these all to a single filter
$GLOBALS['register_sql_columns'] = '';
$GLOBALS['register_sql_data'] = '';
`reason` VARCHAR(255) NOT NULL DEFAULT '',
`time_trans` VARCHAR(10) NOT NULL DEFAULT 0,
`trans_type` ENUM('IN','OUT') NOT NULL DEFAULT 'IN',
-KEY (`party_userid`)
+INDEX (`party_userid`)
) ENGINE = HEAP COMMENT = 'Temporary transfer table'", array(getMemberId()), __FILE__, __LINE__);
// Let's begin with the incoming list
// Get points data for given subject
function getPointsDataArrayFromSubject ($subject) {
- // Extension sql_patches must be up-to-date
+ // Extension ext-sql_patches must be up-to-date
if (isExtensionInstalledAndOlder('sql_patches', '0.8.2')) {
// Please update ext-sql_patches
debug_report_bug(__FUNCTION__, __LINE__, 'sql_patches is out-dated. Please update to at least 0.8.2 to continue. subject=' . $subject);
`password` VARCHAR(255) NOT NULL DEFAULT '',
`email` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`),
- UNIQUE KEY (`login`)
+ UNIQUE (`login`)
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci;
DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_cats`;