X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fextensions%2Fext-bonus.php;h=a88acfd01cf00b0be561aeb3de9513427b40a20f;hb=aa04cab9bf04a4c2a662ce77ff78882ee8a9bf16;hp=de89b7015a9c10516f6ff094a86102495bb44d96;hpb=d495bd859975d08ee459d03c9b1cd51dd9b9304d;p=mailer.git
diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php
index de89b7015a..a88acfd01c 100644
--- a/inc/extensions/ext-bonus.php
+++ b/inc/extensions/ext-bonus.php
@@ -1,7 +1,7 @@
paidlinks.");
+ setExtensionUpdateNotes("Paid-Links wurden verschoben in die Erweiterung sponsor.");
break;
case '0.2.0': // SQL queries for v0.2.0
addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `target_send`=`mails_sent` WHERE `target_send`=0 AND `mails_sent`>0 AND `receivers` != ''");
// Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Behebt ein Versand-Problem mit den Bonus-Mails. Es wurde die Spalte target_send nicht beim Einfügen der Buchung gessetzt. Bitte laden Sie sich dazu - wenn nicht bereits geschehen - alle Patches bis mindestens Patch 240 unter Updates prüfen herunter.");
+ setExtensionUpdateNotes("Behebt ein Versand-Problem mit den Bonus-Mails. Es wurde die Spalte target_send nicht beim Einfügen der Buchung gessetzt. Bitte laden Sie sich dazu - wenn nicht bereits geschehen - alle Patches bis mindestens Patch 240 unter Updates prüfen herunter.");
break;
case '0.2.1': // SQL queries for v0.2.1
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `login_bonus` FLOAT(20,3) NOT NULL DEFAULT 10.000");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `turbo_bonus` FLOAT(20,3) NOT NULL DEFAULT 100.000");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `login_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('ONE_DAY')."");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `login_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT {?ONE_DAY?}");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `turbo_rates` VARCHAR(255) NOT NULL DEFAULT '50;20;10'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_ranks` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10");
// Use actual month for this update
@@ -133,19 +137,19 @@ PRIMARY KEY (id)
break;
case '0.2.2': // SQL queries for v0.2.2
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_turbo`");
+ 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!)
@@ -166,11 +170,11 @@ KEY userid (userid)
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`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_urls`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_customer`');
// Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Tabellen {?_MYSQL_PREFIX?}_bonus_urls und {?_MYSQL_PREFIX?}_bonus_customer entfernt, da dies bald von der Erweiterung paidlinks erledigt wird.");
+ setExtensionUpdateNotes("Tabellen {?_MYSQL_PREFIX?}_bonus_urls und {?_MYSQL_PREFIX?}_bonus_customer entfernt, da dies bald von der Erweiterung sponsor erledigt wird.");
break;
case '0.2.6': // SQL queries for v0.2.6
@@ -184,12 +188,12 @@ KEY userid (userid)
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");
@@ -302,7 +306,7 @@ KEY userid (userid)
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.");
@@ -350,12 +354,12 @@ KEY userid (userid)
case '0.5.6': // SQL queries for v0.5.6
// Get current month
- $curr = date('m', time());
+ $curr = getMonth();
if (strlen($curr) == 1) $curr = '0' . $curr;
- if ($curr == "00") $curr = "12";
+ if ($curr == '00') $curr = '12';
// Generate timemark...
- $mark = mktime(0, 0, 0, $curr, 1, date('Y', time()));
+ $mark = mktime(0, 0, 0, $curr, 1, getYear());
// Update accounts which are not active last months
addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_data`
@@ -461,14 +465,14 @@ WHERE `last_online` < ".$mark." ORDER BY `userid` ASC");
break;
case '0.7.7': // SQL queries for v0.7.7
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_en_notify ENUM('Y','N') NOT NULL DEFAULT 'N'");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_di_notify ENUM('Y','N') NOT NULL DEFAULT 'N'");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_new_mem_notify ENUM('Y','N') NOT NULL DEFAULT 'N'");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_notify_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_notify_wait BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD bonus_ral_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD bonus_ral_en_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD bonus_ral_di_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_en_notify` ENUM('Y','N') NOT NULL DEFAULT 'N'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_di_notify` ENUM('Y','N') NOT NULL DEFAULT 'N'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_new_mem_notify` ENUM('Y','N') NOT NULL DEFAULT 'N'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_notify_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_notify_wait` BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `bonus_ral_en_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `bonus_ral_di_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `bonus_ral_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Optionale automatische Benachrichtigung über aktivierte und/oder deaktivierte Aktiv-Rallye einstellbar.");
@@ -538,7 +542,42 @@ WHERE `last_online` < ".$mark." ORDER BY `userid` ASC");
// Update notes
setExtensionUpdateNotes("Benachrichtigungsmails für z.B. Bettel- oder Aktiv-Rallye werden nun angezeigt.");
break;
- }
+
+ case '0.9.0': // SQL queries for v0.9.0
+ // Register filter
+ registerFilter('member_login_check', 'ADD_LOGIN_BONUS', false, true, isExtensionDryRun());
+
+ // Update notes
+ setExtensionUpdateNotes("Filter hinzugefügt der den Login-Bonus aktualisiert (bzw. soll) (internes TODO).");
+ break;
+
+ case '0.9.1': // SQL queries for v0.9.1
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `bonus_en_notify` `bonus_enable_notify` ENUM('Y','N') NOT NULL DEFAULT 'N'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `bonus_di_notify` `bonus_disable_notify` ENUM('Y','N') NOT NULL DEFAULT 'N'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `bonus_new_mem_notify` `bonus_new_member_notify` ENUM('Y','N') NOT NULL DEFAULT 'N'");
+
+ // Update notes
+ setExtensionUpdateNotes("Umbenannt nach neuer Konvention (bitte Einstellungen kontrollieren).");
+ break;
+
+ case '0.9.2': // SQL queries for v0.9.2
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `bonus_ral_en_notify` `bonus_ralley_enable_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `bonus_ral_di_notify` `bonus_ralley_disable_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `bonus_ral_notify` `bonus_rallley_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+
+ // Update notes
+ setExtensionUpdateNotes("Umbenannt nach neuer Konvention (bitte Einstellungen kontrollieren).");
+ break;
+
+ case '0.9.3': // SQL queries for v0.9.3
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `bonus_ralley_enable_notify` `bonus_rallye_enable_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `bonus_ralley_disable_notify` `bonus_rallye_disable_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` DROP `bonus_ralley_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+
+ // Update notes
+ setExtensionUpdateNotes("Typos gefixt.");
+ break;
+ } // END - switch
break;
case 'modify': // When the extension got modified
@@ -548,29 +587,15 @@ WHERE `last_online` < ".$mark." ORDER BY `userid` ASC");
break;
case 'init': // Do stuff when extension is initialized
- if (isResetModeEnabled() && (!isDebugModeEnabled()) && (getOutputMode() != 1)) {
- // Daily reset was run so let's check if active rallye is activated
- if (getConfig('bonus_active') == 'Y') {
- // Run active rallye
- addIncludeToPool('reset', 'inc/monthly/monthly_bonus.php');
- } else {
- // Reset points
- addIncludeToPool('reset', 'inc/reset/reset_bonus.php');
- }
- } // END - if
-
// Check for bonus rallye is active and send mails out
- if ((getConfig('bonus_active') == 'Y') && (getConfig('bonus_new_mem_notify') == 'Y')) {
+ if ((isBonusRallyeActive()) && (isBonusNewMemberNotifyEnabled())) {
// Include file for sending out mails
addIncludeToPool('notify', 'inc/mails/bonus_mails.php');
} // END - if
break;
- case 'init': // Do stuff when extension is initialized
- break;
-
default: // Unknown extension mode
- DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
+ logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
break;
} // END - switch