2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 06/25/2013 *
4 * =================== Last change: 06/25/2013 *
6 * -------------------------------------------------------------------- *
7 * File : mode-update.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Update mode for ext-beg *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Update-Modus fuer ext-beg *
12 * -------------------------------------------------------------------- *
13 * Copyright (c) 2003 - 2009 by Roland Haeder *
14 * Copyright (c) 2009 - 2015 by Mailer Developer Team *
15 * For more information visit: http://mxchange.org *
17 * This program is free software; you can redistribute it and/or modify *
18 * it under the terms of the GNU General Public License as published by *
19 * the Free Software Foundation; either version 2 of the License, or *
20 * (at your option) any later version. *
22 * This program is distributed in the hope that it will be useful, *
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
25 * GNU General Public License for more details. *
27 * You should have received a copy of the GNU General Public License *
28 * along with this program; if not, write to the Free Software *
29 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
31 ************************************************************************/
33 // Some security stuff...
34 if (!defined('__SECURITY')) {
38 // @TODO Remove double tabs from all lines
39 switch (getCurrentExtensionVersion()) {
40 case '0.0.1': // SQL queries for v0.0.1
41 // Update notes (these will be set as task text!)
42 setExtensionUpdateNotes("Design "Solid-Business" eingebaut.");
45 case '0.0.2': // SQL queries for v0.0.2
46 // Update notes (these will be set as task text!)
47 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
50 case '0.0.3': // SQL queries for v0.0.3
51 addConfigAddSql('beg_points_max', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.10000');
53 // Update notes (these will be set as task text!)
54 setExtensionUpdateNotes("Maximale Obergrenze an {?POINTS?} einstellbar (Standard: 0,1 {?POINTS?})");
57 case '0.0.4': // SQL queries for v0.0.4
58 // Update notes (these will be set as task text!)
59 setExtensionUpdateNotes("Überlange Kommastellen bei Punktangaben aus Bettellink und Gastbereich entfernt und Admin-Templates repariert ("Unbekannte Spalte <u>beg_points_ma</u>").");
62 case '0.0.5': // SQL queries for v0.0.5
63 // Update notes (these will be set as task text!)
64 setExtensionUpdateNotes("Im Mitgliedsmenü wurde die Beschreibung aus dem Gastmenü verwendet.");
67 case '0.0.6': // SQL queries for v0.0.6
68 addConfigAddSql('beg_userid', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
70 // Update notes (these will be set as task text!)
71 setExtensionUpdateNotes("Ein Mitgliedsaccount (empfehlenswert ist Ihr eigenes!) kann zum Abbuchen der {?POINTS?} verwendet werden. Template <u>admin_config_beg.tpl</u> (und pro!) nicht vergessen, zu aktualisieren.");
74 case '0.0.8': // SQL queries for v0.0.8
75 addConfigAddSql('beg_ip_timeout', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 1800');
77 // Update notes (these will be set as task text!)
78 setExtensionUpdateNotes("Zeitsperre gegen die selbe IP-Nummer hinzugefügt.");
81 case '0.0.9': // SQL queries for v0.0.9
82 // Update notes (these will be set as task text!)
83 setExtensionUpdateNotes("Bitte verschieben Sie die beg-Templates (Ordner: {?PATH?}/templates/".getLanguage()."/html/) in den neuen Order beg!");
86 case '0.1.0': // SQL queries for v0.2.1
87 // Update notes (these will be set as task text!)
88 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
91 case '0.1.1': // SQL queries for v0.1.1
92 // Update notes (these will be set as task text!)
93 setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
97 // SQL queries for v0.1.2
98 addConfigAddSql('beg_ranks', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 10');
99 addConfigAddSql('beg_active', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
100 addConfigAddSql('beg_rallye', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
101 addExtensionAddTableColumnSql('user_data', 'beg_points', 'FLOAT(21,5) UNSIGNED NOT NULL DEFAULT 0.00000');
104 addAdminMenuSql('user', 'list_beg', 'Bettel-Rallye', 'Listet alle Teilnehmer der monatlichen Bettel-Rallye auf.', 12);
106 // Update notes (these will be set as task text!)
107 setExtensionUpdateNotes("Optionale Bettel-Rallye möglich. Und die erbettelten {?POINTS?} können entweder nur dem bettelndem Mitglied direkt oder auch seinem Werber gutgeschrieben werden können.");
110 case '0.1.3': // SQL queries for v0.1.3
111 // Update notes (these will be set as task text!)
112 setExtensionUpdateNotes("Erbettelte {?POINTS?} werden nach Deaktivierung der Bettel-Rallye gelöscht.");
115 case '0.1.4': // SQL queries for v0.1.4
116 // Update notes (these will be set as task text!)
117 setExtensionUpdateNotes("Rechtlichen Hinweis im Mitgliedsbereich vergessen (<strong>member_list_beg.tpl</strong>); Template <strong>member_beg_404.tpl</strong> fehlte!");
120 case '0.1.5': // SQL queries for v0.1.5
121 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Bettellink/-rallye', descr='IP-Sperre, {OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Vergütung und auch die Bettel-Rallye können Sie hier einstellen.' WHERE `what`='config_beg' LIMIT 1");
123 // Update notes (these will be set as task text!)
124 setExtensionUpdateNotes("Fehlendes Template im Admin-Bereich hinzugefügt. Im Admin-Bereich Hinweis hinzugefügt, wenn Bettel-Rallye inaktiv ist. Bitte Script inc/monthly_beg.php löschen!");
127 case '0.1.6': // SQL queries for v0.1.6
128 // Update notes (these will be set as task text!)
129 setExtensionUpdateNotes("Es wurden immer dem ersten bettelndem Mitglied die {?POINTS?} gutgeschrieben.");
132 case '0.1.7': // SQL queries for v0.1.7
133 addConfigAddSql('beg_rallye_enable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
134 addConfigAddSql('beg_rallye_disable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
135 addConfigAddSql('beg_new_member_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
136 addConfigAddSql('beg_notify_bonus', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
137 addConfigAddSql('beg_notify_wait', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 30');
138 addExtensionAddTableColumnSql('user_data', 'beg_ral_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
139 addExtensionAddTableColumnSql('user_data', 'beg_rallye_enable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
140 addExtensionAddTableColumnSql('user_data', 'beg_rallye_disable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
142 // Update notes (these will be set as task text!)
143 setExtensionUpdateNotes("Die Mitglieder können nun optional automatisch über eine aktivierte und/oder deaktivierte Bettel-Rallye informiert werden. Beide Benachrichtigungen können Sie unter <strong>Einstellungen --> Bettel-Link/-rallye</strong> seperat ein- und ausschalten! Zudem ist eine Sperre gegen eingeloggte Mitglieder eingebaut, die das Klicken auf den eigenen Bettel-Link etwas erschweren soll.");
146 case '0.1.8': // SQL queries for v0.1.8
147 // Update notes (these will be set as task text!)
148 setExtensionUpdateNotes("Fehler im täglichen Reset beseitigt.");
151 case '0.1.9': // SQL queries for v0.1.9
152 // Update notes (these will be set as task text!)
153 setExtensionUpdateNotes("De-/Aktivieren des mit dieser Erweiterung verknüpften Modules eingebunden.");
156 case '0.2.0': // SQL queries for v0.2.0
157 // Update notes (these will be set as task text!)
158 setExtensionUpdateNotes("Bei {?POINTS?}-Gleichstand wird als nächstes nach wer als letztes Online war umsortiert.");
161 case '0.2.1': // SQL queries for v0.2.1
162 // Update notes (these will be set as task text!)
163 setExtensionUpdateNotes("Fehler <strong>unknown column 'userid'</strong> beseitigt.");
166 case '0.2.2': // SQL queries for v0.2.2
167 addConfigAddSql('beg_include_own', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
169 // Update notes (these will be set as task text!)
170 setExtensionUpdateNotes("Eigene Mitglieds-Ids sind von der Bettel-Rallye nun ausschliessbar.");
173 case '0.2.3': // SQL queries for v0.2.3
174 // Update notes (these will be set as task text!)
175 setExtensionUpdateNotes("Abfrage des Account-Status eingebaut. Es können nur bestätigte Accounts betteln.");
178 case '0.2.4': // SQL queries for v0.2.4
179 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras',`sort`=1 WHERE `what`='beg' LIMIT 1");
181 // Update notes (these will be set as task text!)
182 setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
185 case '0.2.5': // SQL queries for v0.2.5
186 // Update notes (these will be set as task text!)
187 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
190 case '0.2.6': // SQL queries for v0.2.6
191 addExtensionAddTableColumnSql('beg_ips', 'sid', "VARCHAR(255) NOT NULL DEFAULT ''");
192 addConfigAddSql('beg_pay_mode', "ENUM('IMG','JS','BOTH','NONE') DEFAULT 'NONE' NOT NULL ;");
194 // Update notes (these will be set as task text!)
195 setExtensionUpdateNotes("IP-Lock mit Session-Id erweitert. Tracker-Script eingefügt, dass das Einbinden des Bettel-Links als Bild/Script/CSS verhindern soll.");
198 case '0.2.7': // SQL queries for v0.2.7
199 addConfigChangeSql('beg_ral_en_notify', 'beg_rallye_enable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
200 addConfigChangeSql('beg_ral_di_notify', 'beg_rallye_disable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
201 addConfigChangeSql('beg_new_mem_notify', 'beg_new_member_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
202 addExtensionChangeTableColumnSql('user_data', 'beg_ral_en_notify', 'beg_rallye_enable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
203 addExtensionChangeTableColumnSql('user_data', 'beg_ral_di_notify', 'beg_rallye_disable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
205 // Update notes (these will be set as task text!)
206 setExtensionUpdateNotes("Umbenannt nach neuer Namenskonvention");
209 case '0.2.8': // SQL queries for v0.2.8
210 addConfigChangeSql('beg_ral_enable_notify', 'beg_rallye_enable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
211 addConfigChangeSql('beg_ral_disable_notify', 'beg_rallye_disable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
212 addExtensionChangeTableColumnSql('user_data', 'beg_ral_enable_notify', 'beg_rallye_enable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
213 addExtensionChangeTableColumnSql('user_data', 'beg_ral_disable_notify', 'beg_rallye_disable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
215 // Update notes (these will be set as task text!)
216 setExtensionUpdateNotes("Umbenannt nach neuer Namenskonvention");
219 case '0.2.9': // SQL queries for v0.2.9
220 addDropTableSql('beg_referrals');
221 addCreateTableSql('beg_referrals', "
222 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
223 `userid` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
224 `remote_ip` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
225 `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
226 `referral_url` TINYTEXT NOT NULL,
229 'Recorded referral URLs');
232 addAdminMenuSql('user','list_beg_referral_urls','Bettel-Referrals auflisten','Listet alle Bettellink-Aufrufe inklusive Referral-URL auf.','13');
234 // Update notes (these will be set as task text!)
235 setExtensionUpdateNotes("Loggen der Referral-URLs hinzugefügt.");
238 case '0.3.0': // SQL queries for v0.3.0
239 addConfigDropSql('beg_mode');
241 // Register points data
242 registerExtensionPointsData('beg' , 'points', 'LOCKED', 'DIRECT');
243 registerExtensionPointsData('monthly_beg', 'points', 'LOCKED', 'DIRECT');
246 setExtensionUpdateNotes("Monatliche Bettelrallye und die erbettelten {?POINTS?} werden nun über die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
249 case '0.3.1': // SQL queries for v0.3.1
251 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='beg2'");
252 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `action`='members',`sort`=3 WHERE `what`='beg' LIMIT 1");
253 addMemberMenuSql('rals', 'beg2', 'Bettel-Rallye', 3);
256 setExtensionUpdateNotes("Bettel-Rallye re-hinzugefügt.");
259 case '0.3.2': // SQL queries for v0.3.2
261 addModuleSql('beg', '{OPEN_LANGUAGE}MODULE_BEG_TITLE{CLOSE_LANGUAGE}', 'Y', 'Y', 'N', 'N');
264 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `title`='Betteln bei {OPEN_CONFIG}MAIN_TITLE{CLOSE_CONFIG}' WHERE `module`='beg' AND `title`='' LIMIT 1");
267 setExtensionUpdateNotes("Modul registriert und bei leerem Titel mit einem Standardtitel versehen.");
270 case '0.3.3': // SQL queries for v0.3.3
272 registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'BEG_RALLYE_USER_REGISTRATION_ADD_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun());
273 registerFilter(__FILE__, __LINE__, 'init', 'BEG_PURGE_IPS_NOTIFY_USER', FALSE, TRUE, isExtensionDryRun());
275 // This depends on ext-register
276 addExtensionDependency('register');
279 setExtensionUpdateNotes("Filter für Anmeldeformular und Aufrämen der IPs hinzugefügt.");
282 case '0.3.4': // SQL queries for v0.3.4
283 // SQL queries (renaming)
284 addRenameTableSql('beg_referrals', 'referrals');
285 addExtensionChangeTableColumnSql('beg_referrals', 'referal_url', 'referral_url', 'TINYTEXT NOT NULL');
286 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `what`='list_beg_referral_urls' WHERE `what`='list_beg_referal_urls' LIMIT 1");
289 setExtensionUpdateNotes("Verwendungszwecke für Referralgutgschriften registriert.");
292 case '0.3.5': // SQL queries for v0.3.5
294 registerFilter(__FILE__, __LINE__, 'config_userid_exclusion_sql', 'EXCLUDE_BEG_USERID', FALSE, TRUE, isExtensionDryRun());
297 setExtensionUpdateNotes("Filter für das Ausschließen des konfigurierbaren Mitgliedaccounts hinzugefügt.");
300 case '0.3.6': // SQL queries for v0.3.6
301 // SQL to update module
302 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `title`='{OPEN_LANGUAGE}MODULE_BEG_TITLE{CLOSE_LANGUAGE}' WHERE `module`='beg' LIMIT 1");
305 setExtensionUpdateNotes("Modul-Titel nach neuem Format angepasst.");