addMemberMenuSql('main','bonus','Bonuspunkte','N','Y',7);
addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus`");
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bonus` (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-cat_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-subject VARCHAR(255) NOT NULL DEFAULT '',
-text LONGTEXT NOT NULL,
-receivers LONGTEXT NOT NULL,
-points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-time TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
-data_type ENUM('NEW','QUEUE','SEND') NOT NULL DEFAULT 'NEW',
-timestamp VARCHAR(10) NOT NULL DEFAULT 0,
-url VARCHAR(255) NOT NULL DEFAULT '',
-target_send BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-mails_sent BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-KEY (cat_id),
-PRIMARY KEY (id)
-)TYPE={?_TABLE_TYPE?}");
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`cat_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`subject` VARCHAR(255) NOT NULL DEFAULT '',
+`text` LONGTEXT NOT NULL,
+`receivers` LONGTEXT NOT NULL,
+`points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`time` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
+`data_type` ENUM('NEW','QUEUE','SEND') NOT NULL DEFAULT 'NEW',
+`timestamp` VARCHAR(10) NOT NULL DEFAULT 0,
+`url` VARCHAR(255) NOT NULL DEFAULT '',
+`target_send` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`mails_sent` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+KEY (`cat_id`),
+PRIMARY KEY (`id`)
+)TYPE={?_TABLE_TYPE?} COMMENT='Bonus mails'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` MODIFY `link_type` ENUM('NORMAL','BONUS') NOT NULL DEFAULT 'NORMAL'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` ADD `bonus_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` ADD INDEX (`bonus_id`)");
switch (getCurrentExtensionVersion()) {
case '0.1.6': // SQL queries for v0.1.6
// Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Paid-Links wurden verschoben in die Erweiterung <strong>paidlinks</strong>.");
+ setExtensionUpdateNotes("Paid-Links wurden verschoben in die Erweiterung <strong>sponsor</strong>.");
break;
case '0.2.0': // SQL queries for v0.2.0
case '0.2.2': // SQL queries for v0.2.2
addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_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,
-mail_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-bonus_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-level BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-points FLOAT(20,3) NOT NULL DEFAULT '0.000',
-timemark VARCHAR(32) NOT NULL DEFAULT 0,
-PRIMARY KEY (id),
-KEY mail_id (mail_id),
-KEY bonus_id (bonus_id),
-KEY userid (userid)
+`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,
+`bonus_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`level` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`points` FLOAT(20,3) NOT NULL DEFAULT '0.000',
+`timemark` VARCHAR(32) NOT NULL DEFAULT 0,
+PRIMARY KEY (`id`),
+INDEX `mail_id` (`mail_id`),
+INDEX `bonus_id` (`bonus_id`),
+INDEX `userid` (`userid`)
) TYPE={?_TABLE_TYPE?}");
// Update notes (these will be set as task text!)
addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_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>paidlinks</u> erledigt wird.");
+ 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.");
break;
case '0.2.6': // SQL queries for v0.2.6
break;
case '0.2.8': // SQL queries for v0.2.8
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET timestamp=0 WHERE timestamp='0000000000'");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_bonus_turbo` CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE turbo_bonus turbo_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE login_bonus login_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE turbo_bonus turbo_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE login_bonus login_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `timestamp`=0 WHERE `timestamp`='0000000000'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_bonus_turbo` CHANGE `points` `points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `turbo_bonus` `turbo_bonus` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `login_bonus` `login_bonus` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `turbo_bonus` `turbo_bonus` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `login_bonus` `login_bonus` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("5 Nachkommastellen implementiert");
break;
case '0.4.7': // SQL queries for v0.4.7
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET login_bonus=0, turbo_bonus=0,bonus_ref=0,bonus_order=0,bonus_stats=0");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `login_bonus`=0, `turbo_bonus`=0, `bonus_ref`=0, `bonus_order`=0, `bonus_stats`=0");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Die Aktiv-Rallye wurde nicht auf 0 {?POINTS?} gesetzt. Dieser Fehler ist nun behoben. Allerdings ist mit diesem Update auch die Aktiv-Rallye zurückgesetzt worden.");