X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fextensions%2Fext-bonus.php;h=c1e40a09aac428e3353cf6a360d4e1600f6d6056;hb=fd0bc034f4e10c4b0feb28e85dc302ddce919339;hp=b30b1ba113dac0c2af2a609d8dba624dd138e2c0;hpb=c01694397f34eee38b8f5933dbb385c122c79e50;p=mailer.git
diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php
index b30b1ba113..c1e40a09aa 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,20 +138,20 @@ 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)
-) TYPE={?_TABLE_TYPE?}");
+`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`)
+) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Turbo-Bonus wird in Tabelle gezählt für Anzeige, wer alles bereits geklickt hat und welchen Platz er gemacht hat.");
@@ -166,11 +171,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 +189,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");
@@ -256,7 +261,7 @@ KEY userid (userid)
break;
case '0.4.0': // SQL queries for v0.4.0
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*7)."");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay()*7)."");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_lines` BIGINT(20) UNSIGNED NOT NULL DEFAULT 10");
// Update notes (these will be set as task text!)
@@ -302,7 +307,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 +355,12 @@ KEY userid (userid)
case '0.5.6': // SQL queries for v0.5.6
// Get current month
- $curr = date('m', time());
- if (strlen($curr) == 1) $curr = 0 . $curr;
- if ($curr == "00") $curr = "12";
+ $curr = getMonth();
+ if (strlen($curr) == 1) $curr = '0' . $curr;
+ 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 +466,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 +543,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 +588,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