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 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2013 by Mailer Developer Team *
20 * For more information visit: http://mxchange.org *
22 * This program is free software; you can redistribute it and/or modify *
23 * it under the terms of the GNU General Public License as published by *
24 * the Free Software Foundation; either version 2 of the License, or *
25 * (at your option) any later version. *
27 * This program is distributed in the hope that it will be useful, *
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
30 * GNU General Public License for more details. *
32 * You should have received a copy of the GNU General Public License *
33 * along with this program; if not, write to the Free Software *
34 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
36 ************************************************************************/
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
43 // @TODO Remove double tabs from all lines
44 switch (getCurrentExtensionVersion()) {
45 case '0.0.1': // SQL queries for v0.0.1
46 // Update notes (these will be set as task text!)
47 setExtensionUpdateNotes("Design "Solid-Business" eingebaut.");
50 case '0.0.2': // SQL queries for v0.0.2
51 // Update notes (these will be set as task text!)
52 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
55 case '0.0.3': // SQL queries for v0.0.3
56 addConfigAddSql('beg_points_max', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.10000');
58 // Update notes (these will be set as task text!)
59 setExtensionUpdateNotes("Maximale Obergrenze an {?POINTS?} einstellbar (Standard: 0,1 {?POINTS?})");
62 case '0.0.4': // SQL queries for v0.0.4
63 // Update notes (these will be set as task text!)
64 setExtensionUpdateNotes("Überlange Kommastellen bei Punktangaben aus Bettellink und Gastbereich entfernt und Admin-Templates repariert ("Unbekannte Spalte <u>beg_points_ma</u>").");
67 case '0.0.5': // SQL queries for v0.0.5
68 // Update notes (these will be set as task text!)
69 setExtensionUpdateNotes("Im Mitgliedsmenü wurde die Beschreibung aus dem Gastmenü verwendet.");
72 case '0.0.6': // SQL queries for v0.0.6
73 addConfigAddSql('beg_userid', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
75 // Update notes (these will be set as task text!)
76 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.");
79 case '0.0.8': // SQL queries for v0.0.8
80 addConfigAddSql('beg_ip_timeout', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 1800');
82 // Update notes (these will be set as task text!)
83 setExtensionUpdateNotes("Zeitsperre gegen die selbe IP-Nummer hinzugefügt.");
86 case '0.0.9': // SQL queries for v0.0.9
87 // Update notes (these will be set as task text!)
88 setExtensionUpdateNotes("Bitte verschieben Sie die beg-Templates (Ordner: {?PATH?}/templates/".getLanguage()."/html/) in den neuen Order beg!");
91 case '0.1.0': // SQL queries for v0.2.1
92 // Update notes (these will be set as task text!)
93 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
96 case '0.1.1': // SQL queries for v0.1.1
97 // Update notes (these will be set as task text!)
98 setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
102 // SQL queries for v0.1.2
103 addConfigAddSql('beg_ranks', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 10');
104 addConfigAddSql('beg_active', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
105 addConfigAddSql('beg_rallye', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
106 addExtensionAddTableColumnSql('user_data', 'beg_points', 'FLOAT(21,5) UNSIGNED NOT NULL DEFAULT 0.00000');
109 addAdminMenuSql('user', 'list_beg', 'Bettel-Rallye', 'Listet alle Teilnehmer der monatlichen Bettel-Rallye auf.', 12);
111 // Update notes (these will be set as task text!)
112 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.");
115 case '0.1.3': // SQL queries for v0.1.3
116 // Update notes (these will be set as task text!)
117 setExtensionUpdateNotes("Erbettelte {?POINTS?} werden nach Deaktivierung der Bettel-Rallye gelöscht.");
120 case '0.1.4': // SQL queries for v0.1.4
121 // Update notes (these will be set as task text!)
122 setExtensionUpdateNotes("Rechtlichen Hinweis im Mitgliedsbereich vergessen (<strong>member_list_beg.tpl</strong>); Template <strong>member_beg_404.tpl</strong> fehlte!");
125 case '0.1.5': // SQL queries for v0.1.5
126 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");
128 // Update notes (these will be set as task text!)
129 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!");
132 case '0.1.6': // SQL queries for v0.1.6
133 // Update notes (these will be set as task text!)
134 setExtensionUpdateNotes("Es wurden immer dem ersten bettelndem Mitglied die {?POINTS?} gutgeschrieben.");
137 case '0.1.7': // SQL queries for v0.1.7
138 addConfigAddSql('beg_rallye_enable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
139 addConfigAddSql('beg_rallye_disable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
140 addConfigAddSql('beg_new_member_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
141 addConfigAddSql('beg_notify_bonus', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
142 addConfigAddSql('beg_notify_wait', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 30');
143 addExtensionAddTableColumnSql('user_data', 'beg_ral_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
144 addExtensionAddTableColumnSql('user_data', 'beg_rallye_enable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
145 addExtensionAddTableColumnSql('user_data', 'beg_rallye_disable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
147 // Update notes (these will be set as task text!)
148 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.");
151 case '0.1.8': // SQL queries for v0.1.8
152 // Update notes (these will be set as task text!)
153 setExtensionUpdateNotes("Fehler im täglichen Reset beseitigt.");
156 case '0.1.9': // SQL queries for v0.1.9
157 // Update notes (these will be set as task text!)
158 setExtensionUpdateNotes("De-/Aktivieren des mit dieser Erweiterung verknüpften Modules eingebunden.");
161 case '0.2.0': // SQL queries for v0.2.0
162 // Update notes (these will be set as task text!)
163 setExtensionUpdateNotes("Bei {?POINTS?}-Gleichstand wird als nächstes nach wer als letztes Online war umsortiert.");
166 case '0.2.1': // SQL queries for v0.2.1
167 // Update notes (these will be set as task text!)
168 setExtensionUpdateNotes("Fehler <strong>unknown column 'userid'</strong> beseitigt.");
171 case '0.2.2': // SQL queries for v0.2.2
172 addConfigAddSql('beg_include_own', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
174 // Update notes (these will be set as task text!)
175 setExtensionUpdateNotes("Eigene Mitglieds-Ids sind von der Bettel-Rallye nun ausschliessbar.");
178 case '0.2.3': // SQL queries for v0.2.3
179 // Update notes (these will be set as task text!)
180 setExtensionUpdateNotes("Abfrage des Account-Status eingebaut. Es können nur bestätigte Accounts betteln.");
183 case '0.2.4': // SQL queries for v0.2.4
184 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras',`sort`=1 WHERE `what`='beg' LIMIT 1");
186 // Update notes (these will be set as task text!)
187 setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
190 case '0.2.5': // SQL queries for v0.2.5
191 // Update notes (these will be set as task text!)
192 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
195 case '0.2.6': // SQL queries for v0.2.6
196 addExtensionAddTableColumnSql('beg_ips', 'sid', "VARCHAR(255) NOT NULL DEFAULT ''");
197 addConfigAddSql('beg_pay_mode', "ENUM('IMG','JS','BOTH','NONE') DEFAULT 'NONE' NOT NULL ;");
199 // Update notes (these will be set as task text!)
200 setExtensionUpdateNotes("IP-Lock mit Session-Id erweitert. Tracker-Script eingefügt, dass das Einbinden des Bettel-Links als Bild/Script/CSS verhindern soll.");
203 case '0.2.7': // SQL queries for v0.2.7
204 addConfigChangeSql('beg_ral_en_notify', 'beg_rallye_enable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
205 addConfigChangeSql('beg_ral_di_notify', 'beg_rallye_disable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
206 addConfigChangeSql('beg_new_mem_notify', 'beg_new_member_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
207 addExtensionChangeTableColumnSql('user_data', 'beg_ral_en_notify', 'beg_rallye_enable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
208 addExtensionChangeTableColumnSql('user_data', 'beg_ral_di_notify', 'beg_rallye_disable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
210 // Update notes (these will be set as task text!)
211 setExtensionUpdateNotes("Umbenannt nach neuer Namenskonvention");
214 case '0.2.8': // SQL queries for v0.2.8
215 addConfigChangeSql('beg_ral_enable_notify', 'beg_rallye_enable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
216 addConfigChangeSql('beg_ral_disable_notify', 'beg_rallye_disable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
217 addExtensionChangeTableColumnSql('user_data', 'beg_ral_enable_notify', 'beg_rallye_enable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
218 addExtensionChangeTableColumnSql('user_data', 'beg_ral_disable_notify', 'beg_rallye_disable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
220 // Update notes (these will be set as task text!)
221 setExtensionUpdateNotes("Umbenannt nach neuer Namenskonvention");
224 case '0.2.9': // SQL queries for v0.2.9
225 addDropTableSql('beg_referrals');
226 addCreateTableSql('beg_referrals', "
227 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
228 `userid` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
229 `remote_ip` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
230 `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
231 `referral_url` TINYTEXT NOT NULL,
234 'Recorded referral URLs');
237 addAdminMenuSql('user','list_beg_referral_urls','Bettel-Referrals auflisten','Listet alle Bettellink-Aufrufe inklusive Referral-URL auf.','13');
239 // Update notes (these will be set as task text!)
240 setExtensionUpdateNotes("Loggen der Referral-URLs hinzugefügt.");
243 case '0.3.0': // SQL queries for v0.3.0
244 addConfigDropSql('beg_mode');
246 // Register points data
247 registerExtensionPointsData('beg' , 'points', 'LOCKED', 'DIRECT');
248 registerExtensionPointsData('monthly_beg', 'points', 'LOCKED', 'DIRECT');
251 setExtensionUpdateNotes("Monatliche Bettelrallye und die erbettelten {?POINTS?} werden nun über die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
254 case '0.3.1': // SQL queries for v0.3.1
256 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='beg2'");
257 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `action`='members',`sort`=3 WHERE `what`='beg' LIMIT 1");
258 addMemberMenuSql('rals', 'beg2', 'Bettel-Rallye', 3);
261 setExtensionUpdateNotes("Bettel-Rallye re-hinzugefügt.");
264 case '0.3.2': // SQL queries for v0.3.2
266 addModuleSql('beg', '{OPEN_LANGUAGE}MODULE_BEG_TITLE{CLOSE_LANGUAGE}', 'Y', 'Y', 'N', 'N');
269 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `title`='Betteln bei {OPEN_CONFIG}MAIN_TITLE{CLOSE_CONFIG}' WHERE `module`='beg' AND `title`='' LIMIT 1");
272 setExtensionUpdateNotes("Modul registriert und bei leerem Titel mit einem Standardtitel versehen.");
275 case '0.3.3': // SQL queries for v0.3.3
277 registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'BEG_RALLYE_USER_REGISTRATION_ADD_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun());
278 registerFilter(__FILE__, __LINE__, 'init', 'BEG_PURGE_IPS_NOTIFY_USER', FALSE, TRUE, isExtensionDryRun());
280 // This depends on ext-register
281 addExtensionDependency('register');
284 setExtensionUpdateNotes("Filter für Anmeldeformular und Aufrämen der IPs hinzugefügt.");
287 case '0.3.4': // SQL queries for v0.3.4
288 // SQL queries (renaming)
289 addRenameTableSql('beg_referrals', 'referrals');
290 addExtensionChangeTableColumnSql('beg_referrals', 'referal_url', 'referral_url', 'TINYTEXT NOT NULL');
291 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `what`='list_beg_referral_urls' WHERE `what`='list_beg_referal_urls' LIMIT 1");
294 setExtensionUpdateNotes("Verwendungszwecke für Referralgutgschriften registriert.");
297 case '0.3.5': // SQL queries for v0.3.5
299 registerFilter(__FILE__, __LINE__, 'config_userid_exclusion_sql', 'EXCLUDE_BEG_USERID', FALSE, TRUE, isExtensionDryRun());
302 setExtensionUpdateNotes("Filter für das Ausschließen des konfigurierbaren Mitgliedaccounts hinzugefügt.");
305 case '0.3.6': // SQL queries for v0.3.6
306 // SQL to update module
307 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `title`='{OPEN_LANGUAGE}MODULE_BEG_TITLE{CLOSE_LANGUAGE}' WHERE `module`='beg' LIMIT 1");
310 setExtensionUpdateNotes("Modul-Titel nach neuem Format angepasst.");