75914187c3f38c036ddd8c31fdff562a0c60b19f
[mailer.git] / inc / extensions / beg / mode-update.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 06/25/2013 *
4  * ===================                          Last change: 06/25/2013 *
5  *                                                                      *
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 - 2013 by Mailer Developer Team                   *
15  * For more information visit: http://mxchange.org                      *
16  *                                                                      *
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.                                  *
21  *                                                                      *
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.                         *
26  *                                                                      *
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,               *
30  * MA  02110-1301  USA                                                  *
31  ************************************************************************/
32
33 // Some security stuff...
34 if (!defined('__SECURITY')) {
35         die();
36 } // END - if
37
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 &quot;Solid-Business&quot; eingebaut.");
43                                 break;
44
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> &uuml;berfl&uuml;ssige HTML-Tags entfernt.");
48                                 break;
49
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');
52
53                                 // Update notes (these will be set as task text!)
54                                 setExtensionUpdateNotes("Maximale Obergrenze an {?POINTS?} einstellbar (Standard: 0,1 {?POINTS?})");
55                                 break;
56
57                         case '0.0.4': // SQL queries for v0.0.4
58                                 // Update notes (these will be set as task text!)
59                                 setExtensionUpdateNotes("&Uuml;berlange Kommastellen bei Punktangaben aus Bettellink und Gastbereich entfernt und Admin-Templates repariert (&quot;Unbekannte Spalte <u>beg_points_ma</u>&quot;).");
60                                 break;
61
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&uuml; wurde die Beschreibung aus dem Gastmen&uuml; verwendet.");
65                                 break;
66
67                         case '0.0.6': // SQL queries for v0.0.6
68                                 addConfigAddSql('beg_userid', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
69
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.");
72                                 break;
73
74                         case '0.0.8': // SQL queries for v0.0.8
75                                 addConfigAddSql('beg_ip_timeout', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 1800');
76
77                                 // Update notes (these will be set as task text!)
78                                 setExtensionUpdateNotes("Zeitsperre gegen die selbe IP-Nummer hinzugef&uuml;gt.");
79                                 break;
80
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!");
84                                 break;
85
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.");
89                                 break;
90
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.");
94                                 break;
95
96                         case '0.1.2':
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');
102
103                                 // Menu system
104                                 addAdminMenuSql('user', 'list_beg', 'Bettel-Rallye', 'Listet alle Teilnehmer der monatlichen Bettel-Rallye auf.', 12);
105
106                                 // Update notes (these will be set as task text!)
107                                 setExtensionUpdateNotes("Optionale Bettel-Rallye m&ouml;glich. Und die erbettelten {?POINTS?} k&ouml;nnen entweder nur dem bettelndem Mitglied direkt oder auch seinem Werber gutgeschrieben werden k&ouml;nnen.");
108                                 break;
109
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&ouml;scht.");
113                                 break;
114
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!");
118                                 break;
119
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&uuml;tung und auch die Bettel-Rallye k&ouml;nnen Sie hier einstellen.' WHERE `what`='config_beg' LIMIT 1");
122
123                                 // Update notes (these will be set as task text!)
124                                 setExtensionUpdateNotes("Fehlendes Template im Admin-Bereich hinzugef&uuml;gt. Im Admin-Bereich Hinweis hinzugef&uuml;gt, wenn Bettel-Rallye inaktiv ist. Bitte Script inc/monthly_beg.php l&ouml;schen!");
125                                 break;
126
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.");
130                                 break;
131
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');
141
142                                 // Update notes (these will be set as task text!)
143                                 setExtensionUpdateNotes("Die Mitglieder k&ouml;nnen nun optional automatisch &uuml;ber eine aktivierte und/oder deaktivierte Bettel-Rallye informiert werden. Beide Benachrichtigungen k&ouml;nnen Sie unter <strong>Einstellungen --&gt; 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.");
144                                 break;
145
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&auml;glichen Reset beseitigt.");
149                                 break;
150
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&uuml;pften Modules eingebunden.");
154                                 break;
155
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&auml;chstes nach wer als letztes Online war umsortiert.");
159                                 break;
160
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 &#39;userid&#39;</strong> beseitigt.");
164                                 break;
165
166                         case '0.2.2': // SQL queries for v0.2.2
167                                 addConfigAddSql('beg_include_own', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
168
169                                 // Update notes (these will be set as task text!)
170                                 setExtensionUpdateNotes("Eigene Mitglieds-Ids sind von der Bettel-Rallye nun ausschliessbar.");
171                                 break;
172
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&ouml;nnen nur best&auml;tigte Accounts betteln.");
176                                 break;
177
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");
180
181                                 // Update notes (these will be set as task text!)
182                                 setExtensionUpdateNotes("Mitgliedsmen&uuml; komplett umgebaut.");
183                                 break;
184
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.");
188                                 break;
189
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 ;");
193
194                                 // Update notes (these will be set as task text!)
195                                 setExtensionUpdateNotes("IP-Lock mit Session-Id erweitert. Tracker-Script eingef&uuml;gt, dass das Einbinden des Bettel-Links als Bild/Script/CSS verhindern soll.");
196                                 break;
197
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');
204
205                                 // Update notes (these will be set as task text!)
206                                 setExtensionUpdateNotes("Umbenannt nach neuer Namenskonvention");
207                                 break;
208
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');
214
215                                 // Update notes (these will be set as task text!)
216                                 setExtensionUpdateNotes("Umbenannt nach neuer Namenskonvention");
217                                 break;
218
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,
227 PRIMARY KEY (`id`),
228 INDEX (`userid`)",
229                                         'Recorded referral URLs');
230
231                                 // Add admin menu
232                                 addAdminMenuSql('user','list_beg_referral_urls','Bettel-Referrals auflisten','Listet alle Bettellink-Aufrufe inklusive Referral-URL auf.','13');
233
234                                 // Update notes (these will be set as task text!)
235                                 setExtensionUpdateNotes("Loggen der Referral-URLs hinzugef&uuml;gt.");
236                                 break;
237
238                         case '0.3.0': // SQL queries for v0.3.0
239                                 addConfigDropSql('beg_mode');
240
241                                 // Register points data
242                                 registerExtensionPointsData('beg'        , 'points', 'LOCKED', 'DIRECT');
243                                 registerExtensionPointsData('monthly_beg', 'points', 'LOCKED', 'DIRECT');
244
245                                 // Update notes
246                                 setExtensionUpdateNotes("Monatliche Bettelrallye und die erbettelten {?POINTS?} werden nun &uuml;ber die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
247                                 break;
248
249                         case '0.3.1': // SQL queries for v0.3.1
250                                 // Add/move menu
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);
254
255                                 // Update notes
256                                 setExtensionUpdateNotes("Bettel-Rallye re-hinzugef&uuml;gt.");
257                                 break;
258
259                         case '0.3.2': // SQL queries for v0.3.2
260                                 // Add module entry
261                                 addModuleSql('beg', '{OPEN_LANGUAGE}MODULE_BEG_TITLE{CLOSE_LANGUAGE}', 'Y', 'Y', 'N', 'N');
262
263                                 // Set module title
264                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `title`='Betteln bei {OPEN_CONFIG}MAIN_TITLE{CLOSE_CONFIG}' WHERE `module`='beg' AND `title`='' LIMIT 1");
265
266                                 // Update notes
267                                 setExtensionUpdateNotes("Modul registriert und bei leerem Titel mit einem Standardtitel versehen.");
268                                 break;
269
270                         case '0.3.3': // SQL queries for v0.3.3
271                                 // Register a filter
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());
274
275                                 // This depends on ext-register
276                                 addExtensionDependency('register');
277
278                                 // Update notes
279                                 setExtensionUpdateNotes("Filter f&uuml;r Anmeldeformular und Aufr&auml;men der IPs hinzugef&uuml;gt.");
280                                 break;
281
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");
287
288                                 // Update notes
289                                 setExtensionUpdateNotes("Verwendungszwecke f&uuml;r Referralgutgschriften registriert.");
290                                 break;
291
292                         case '0.3.5': // SQL queries for v0.3.5
293                                 // Register a filter
294                                 registerFilter(__FILE__, __LINE__, 'config_userid_exclusion_sql', 'EXCLUDE_BEG_USERID', FALSE, TRUE, isExtensionDryRun());
295
296                                 // Update notes
297                                 setExtensionUpdateNotes("Filter f&uuml;r das Ausschlie&szlig;en des konfigurierbaren Mitgliedaccounts hinzugef&uuml;gt.");
298                                 break;
299
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");
303
304                                 // Update notes
305                                 setExtensionUpdateNotes("Modul-Titel nach neuem Format angepasst.");
306                                 break;
307                 } // END - switch
308
309 // [EOF]
310 ?>