ca9b7a9e61dbe7450f847a70eadd70e4f393c379
[mailer.git] / inc / extensions / sql_patches / mode-update.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 01/14/2013 *
4  * ===================                          Last change: 01/14/2013 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : mode-update.php                                  *
8  * -------------------------------------------------------------------- *
9  * Short description : Steps for updates of ext-sql_patches             *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Schritte fuer Updates von ext-sql_patches        *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * -------------------------------------------------------------------- *
18  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
19  * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
20  * For more information visit: http://mxchange.org                      *
21  *                                                                      *
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.                                  *
26  *                                                                      *
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.                         *
31  *                                                                      *
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,               *
35  * MA  02110-1301  USA                                                  *
36  ************************************************************************/
37
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
40         die();
41 } // END - if
42
43 // @TODO Remove double-tabs
44                 switch (getCurrentExtensionVersion()) {
45                         case '0.0.1': // SQL queries for v0.0.1
46                                 addAdminMenuSql('setup', 'config_extensions', 'Erweitungsmanagement', 'Alle Einstellungen am Erweiterungsmanagement.', 10);
47
48                                 // Update notes (these will be set as task text!)
49                                 setExtensionUpdateNotes("Es kann nun bestimmt werden, ob vom Server gel&ouml;schte ext-xxx.php erkannt werden sollen und die verkn&uuml;pften Daten auch aus der Datenbank entfernt werden sollen.");
50                                 break;
51
52                         case '0.0.2': // SQL queries for v0.0.2
53                                 addConfigChangeSql('auto_purge', 'auto_purge', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay()*14));
54
55                                 // Update notes (these will be set as task text!)
56                                 setExtensionUpdateNotes("In der Tabelle <strong>{?_MYSQL_PREFIX?}_config</strong> musste die Spalte <strong>auto_purge</strong> (autom. L&ouml;schen von Best&auml;tigungsmails angepasst werden (war auf dem Testsystem auf TINYINT(4) gesetzt.)");
57                                 break;
58
59                         case '0.0.3': // SQL queries for v0.0.3
60                                 addConfigAddSql('points_word', "VARCHAR(255) NOT NULL DEFAULT '{OPEN_TEMPLATE}DEFAULT_POINTS{CLOSE_TEMPLATE}'");
61
62                                 // Update notes (these will be set as task text!)
63                                 setExtensionUpdateNotes("Das Wort &quot;Punkte&quot; kann nun per Datenbank ge&auml;ndert werden. Damit k&ouml;nnen anstelle des Wortes Punkte auch Klammlose, Wernis, Primera und auch &euro; geschrieben werden.");
64                                 break;
65
66                         case '0.0.4': // SQL queries for v0.0.4
67                                 addConfigAddSql('mails_page', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 10');
68
69                                 // Update notes (these will be set as task text!)
70                                 setExtensionUpdateNotes("Anzahl Mails pro Seite in <strong>EMail-Details ansehen</strong> und <strong>EMail-Archiv</strong> hinzugef&uuml;gt.");
71                                 break;
72
73                         case '0.0.5': // SQL queries for v0.0.5
74                                 addConfigAddSql('index_home', "VARCHAR(255) NOT NULL DEFAULT 'welcome'");
75                                 addAdminMenuSql('setup','config_home','Home-Seite festlegen','Stellen Sie hier ein, welcher Men&uuml;punkt (what-welcome ist Standard) als Einstiegspunkt in das Men&uuml;system genutzt werden soll.', 5);
76
77                                 // Update notes (these will be set as task text!)
78                                 setExtensionUpdateNotes("Die what-welcome.php ist derzeit die &quot;Home&quot;-Seite (Eingangsseite). Dies kann nun per Datenbank ge&auml;ndert werden.");
79                                 break;
80
81                         case '0.0.6': // SQL queries for v0.0.6
82                                 addExtensionAddTableColumnSql('extensions', 'ext_has_css', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
83
84                                 // Update notes (these will be set as task text!)
85                                 setExtensionUpdateNotes("Es k&ouml;nnen nun SQL-Updates von einander abh&auml;ngig gemacht werden und die CSS-Datei kann per Admin-Bereich (wegen Debuggings) ein- bzw. ausgeschaltet werden.");
86                                 break;
87
88                         case '0.0.7': // SQL queries for v0.0.7
89                                 addConfigAddSql('verbose_sql', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
90
91                                 // Update notes (these will be set as task text!)
92                                 setExtensionUpdateNotes("Die SQL-Anweisungen werden bei eingeschalteter Verbose-Funktion detailiert angezeigt.");
93                                 break;
94
95                         case '0.0.8': // SQL queries for v0.0.8
96                                 addConfigAddSql('menu_blur_spacer', "VARCHAR(255) NOT NULL DEFAULT '&nbsp;<strong><big>&middot;</big></strong>&nbsp;'");
97
98                                 // Update notes (these will be set as task text!)
99                                 setExtensionUpdateNotes("Nette Mouse-Hover-Effekte eingebaut (Anleitung <strong>MENUE_HOVER.txt</strong> zum Patchen der general.css bitte lesen!)");
100                                 break;
101
102                         case '0.0.9': // SQL queries for v0.0.9
103                                 addAdminMenuSql('email','list_unconfirmed','Unbest. Mails auflisten','Schauen Sie sich hier unbest&auml;tigte Maillinks an. Bitte diesen Link nur &uuml;ber dem EMail-Archiv oder EMail-Details aufrufen, direkt aufgerufen bekommen Sie eine Fehlermeldung.', 8);
104
105                                 // Update notes (these will be set as task text!)
106                                 setExtensionUpdateNotes("Unbest&auml;tigte Maillinks k&ouml;nnen unter Email-Management -&gt; Unbest. Mails auflisten aufgelistet werden.");
107                                 break;
108
109                         case '0.1.0': // SQL queries for v0.1.0
110                                 // Update notes (these will be set as task text!)
111                                 setExtensionUpdateNotes("Soll der einmalige Ref-Bonus &uuml;ber das Referral-System (also alle oberen Refs bekommen auch etwas davon ab) oder direkt dem Werber aufgebucht werden?");
112                                 break;
113
114                         case '0.1.1': // SQL queries for v0.1.1
115                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Men&uuml;punkt (what-welcome ist Standard) als Einstiegspunkt in das Men&uuml;system genutzt werden soll und wie die automatische Weiterleitung in der Eingangsseite funktionieren soll.' WHERE `what`='config_home' LIMIT 1");
116                                 addConfigAddSql('index_delay', 'TINYINT(3) NOT NULL DEFAULT 0');
117                                 addConfigAddSql('index_cookie', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 365));
118
119                                 // Update notes (these will be set as task text!)
120                                 setExtensionUpdateNotes("Sie k&ouml;nnen nun <a href=\"{%url=modules.php?module=admin&amp;what=config_home%}\">hier</a> die Verz&ouml;gerungszeit in der <a href=\"{%url=index.php%}\">Eingangsseite</a> einstellen.");
121                                 break;
122
123                         case '0.1.2': // SQL queries for v0.1.2
124                                 addAdminMenuSql('setup','config_refid','Standard-Ref-Id','Stellen Sie hier die Mitglieds-Id ein, die genommen werden soll, wenn der Gast n icht per Referral-Link Ihren {?mt_word?} aufgerufen hat.', 7);
125                                 addConfigAddSql('def_refid', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
126
127                                 // Update notes (these will be set as task text!)
128                                 setExtensionUpdateNotes("Standard Referral-Id kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)");
129                                 break;
130
131                         case '0.1.3': // SQL queries for v0.1.3
132                                 addConfigAddSql('refid_target', "ENUM('register','index') NOT NULL DEFAULT 'register'");
133
134                                 // Update notes (these will be set as task text!)
135                                 setExtensionUpdateNotes("Auf welche Seite soll der Ref-Link zeigen? Eingangsseite oder Anmeldeformular?");
136                                 break;
137
138                         case '0.1.4': // SQL queries for v0.1.4
139                                 // Update notes (these will be set as task text!)
140                                 setExtensionUpdateNotes("Ung&uuml;ltiges Update (nach ext-theme.php verschoben!).");
141                                 break;
142
143                         case '0.1.5': // SQL queries for v0.1.5
144                                 addExtensionDropTableColumnSql('extensions', 'ext_has_admin');
145
146                                 // Update notes (these will be set as task text!)
147                                 setExtensionUpdateNotes("Spalte <u>ext_has_admin</u> aus der Tabelle <u>{?_MYSQL_PREFIX?}_extensions</u> entfernt, da sie keinen Sinn mehr macht.");
148                                 break;
149
150                         case '0.1.6': // SQL queries for v0.1.6
151                                 addConfigAddSql('enable_title_deco', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
152                                 addConfigAddSql('title_left', "VARCHAR(10) NOT NULL DEFAULT '[--'");
153                                 addConfigAddSql('title_middle', "VARCHAR(10) NOT NULL DEFAULT '-'");
154                                 addConfigAddSql('title_right', "VARCHAR(10) NOT NULL DEFAULT '--]'");
155                                 addConfigAddSql('enable_mod_title', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
156                                 addConfigAddSql('enable_what_title', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
157                                 addAdminMenuSql('setup','config_title','Seitentitel &auml;ndern','De-/aktivieren Sie hier die Dekorationen, sowie Modul-Titel und what-Titel im Seitentitel.', 8);
158
159                                 // Update notes (these will be set as task text!)
160                                 setExtensionUpdateNotes("Dekorationen des Seitentiteles lassen sich ein- und ausschalten und selber definieren; Modul-Titel und Titel der <strong>what</strong>-Dateien kann hinzugef&uuml;gt werden.");
161                                 break;
162
163                         case '0.1.7': // SQL queries for v0.1.7
164                                 // Update notes (these will be set as task text!)
165                                 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
166                                 break;
167
168                         case '0.1.8': // SQL queries for v0.1.8
169                                 // Update notes (these will be set as task text!)
170                                 setExtensionUpdateNotes("mad_count und last_mad werden nun aus der Datenbank geladen");
171                                 break;
172
173                         case '0.1.9': // SQL queries for v0.1.9
174                                 // Update notes (these will be set as task text!)
175                                 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
176                                 break;
177
178                         case '0.2.0': // SQL queries for v0.2.0
179                                 addExtensionChangeTableColumnSql('jackpot', 'points', 'points', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
180
181                                 addExtensionChangeTableColumnSql('payments', 'payment', 'payment', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
182                                 addExtensionChangeTableColumnSql('payments', 'price', 'price', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
183
184                                 // Update notes (these will be set as task text!)
185                                 setExtensionUpdateNotes("5 Nachkommastellen implementiert");
186                                 break;
187
188                         case '0.2.1': // SQL queries for v0.2.1
189                                 addConfigAddSql('css_php', "ENUM('DIRECT','FILE','INLINE') NOT NULL DEFAULT 'FILE'");
190
191                                 // Update notes (these will be set as task text!)
192                                 setExtensionUpdateNotes("Ausgabe der CSS-Dateien entweder per css.php oder sie sind direkt eingebunden.");
193                                 break;
194
195                         case '0.2.2': // SQL queries for v0.2.2
196                                 // Update notes (these will be set as task text!)
197                                 setExtensionUpdateNotes("Erweiterung bleibt wegen integrierten Schalters immer aktiv.");
198                                 break;
199
200                         case '0.2.3': // SQL queries for v0.2.3
201                                 addConfigAddSql('guest_menu', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
202                                 addConfigAddSql('member_menu', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
203                                 addConfigAddSql('youre_here', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
204
205                                 // Update notes (these will be set as task text!)
206                                 setExtensionUpdateNotes("Gast- und Mitgliedsmen&uuml;s lassen sich getrennt voneinander abschalten.");
207                                 break;
208
209                         case '0.2.4': // SQL queries for v0.2.4
210                                 // PNG image is the default
211                                 $auto_type = 'png';
212
213                                 // Is the JPEG file found and required PHP function there?
214                                 if ((!isFileReadable(getPath() . 'theme/' . getCurrentTheme() . '/images/code_bg.png')) || (!function_exists('imagecreatefrompng'))) {
215                                         // Switch to JPEG format because PNG is not available
216                                         $auto_type = 'jpg';
217                                 } // END - if
218                                 addConfigAddSql('img_type', "ENUM('jpg','png') NOT NULL DEFAULT '" . $auto_type . "'");
219
220                                 // Update notes (these will be set as task text!)
221                                 setExtensionUpdateNotes("Generierung des Mailbest&auml;tigungscodes h&auml;ngt davon ab, ob die PHP-Funktion <u>imagecreatefromjpeg()</u> und das JPEG-Bild vorhanden sind oder nicht.");
222                                 break;
223
224                         case '0.2.5': // SQL queries for v0.2.5
225                                 // Update notes (these will be set as task text!)
226                                 setExtensionUpdateNotes("Spalten <u>max_mails</u> und <u>receive_mails</u> auf BIGINT(20) gesetzt.");
227                                 break;
228
229                         case '0.2.6': // SQL queries for v0.2.6
230                                 // Update notes (these will be set as task text!)
231                                 setExtensionUpdateNotes("Verschoben nach <strong>ext-user</strong>.");
232                                 break;
233
234                         case '0.2.7': // SQL queries for v0.2.7
235                                 addConfigAddSql('stats_limit', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 10');
236                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `what`='config_stats' WHERE `what`='stats' LIMIT 1");
237
238                                 // Update notes (these will be set as task text!)
239                                 setExtensionUpdateNotes("<ol>
240 <li>Das Mitglied kann das derzeitige Design in sein Profil abspeichern.</li>
241 <li>Mitgliederstatistik mit Seitennavigation.</li>
242 </ol>");
243                                 break;
244
245                         case '0.2.8': // SQL queries for v0.2.8
246                                 // Update notes (these will be set as task text!)
247                                 setExtensionUpdateNotes("Nicht mehr g&uuml;ltiges Update.");
248                                 break;
249
250                         case '0.2.9': // SQL queries for v0.2.9
251                                 addConfigAddSql('mt_word', "VARCHAR(255) NOT NULL DEFAULT 'Mailtausch'");
252                                 addConfigAddSql('mt_word2', "VARCHAR(255) NOT NULL DEFAULT 'Mailtausches'");
253                                 addConfigAddSql('mt_word3', "VARCHAR(255) NOT NULL DEFAULT 'Mailtauscher'");
254
255                                 // Update notes (these will be set as task text!)
256                                 setExtensionUpdateNotes("W&ouml;rter <strong>{?mt_word?}</strong>, <strong>{?mt_word2?}</strong> und <strong>{?mt_word3?}</strong> sind austauschbar.");
257                                 break;
258
259                         case '0.3.0': // SQL queries for v0.3.0
260                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='{OPEN_CONFIG}POINTS{CLOSE_CONFIG}/Referral-Ebenen' WHERE `what`='config_points' LIMIT 1");
261                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Mailverg&uuml;tungen...' WHERE `what`='payments' LIMIT 1");
262
263                                 // Update notes (these will be set as task text!)
264                                 setExtensionUpdateNotes("Zwei Men&uuml;punkte umbenannt.");
265                                 break;
266
267                         case '0.3.1': // SQL queries for v0.3.1
268                                 addExtensionAddTableUniqueSql('extensions', 'ext_name', '(`ext_name`)');
269                                 addExtensionAddTableUniqueSql('admins', 'login', '(`login`)');
270                                 addExtensionAddTableIndexSql('refbanner', 'visible', '(`visible`)');
271                                 addExtensionAddTableUniqueSql('refdepths', 'level', '(`level`)');
272                                 addExtensionAddTableIndexSql('refsystem', 'level', '(`level`)');
273                                 addExtensionAddTableIndexSql('pool', 'data_type', '(`data_type`)');
274                                 addExtensionAddTableUniqueSql('mod_reg', 'module', '(`module`)');
275                                 addExtensionAddTableIndexSql('admin_menu', 'action', '(`action`)');
276                                 addExtensionAddTableIndexSql('admin_menu', 'what', '(`what`)');
277                                 addExtensionAddTableIndexSql('extensions', 'ext_active', '(`ext_active`)');
278                                 addExtensionAddTableIndexSql('guest_menu', 'action', '(`action`)');
279                                 addExtensionAddTableIndexSql('guest_menu', 'what', '(`what`)');
280                                 addExtensionAddTableIndexSql('guest_menu', 'sort', '(`sort`)');
281                                 addExtensionAddTableIndexSql('guest_menu', 'visible', '(`visible`)');
282                                 addExtensionAddTableIndexSql('guest_menu', 'locked', '(`locked`)');
283                                 addExtensionAddTableIndexSql('member_menu', 'what', '(`what`)');
284                                 addExtensionAddTableIndexSql('member_menu', 'sort', '(`sort`)');
285                                 addExtensionAddTableIndexSql('member_menu', 'visible', '(`visible`)');
286                                 addExtensionAddTableIndexSql('member_menu', 'locked', '(`locked`)');
287                                 addExtensionAddTableIndexSql('cats', 'visible', '(`visible`)');
288                                 addExtensionAddTableIndexSql('cats', 'sort', '(`sort`)');
289
290                                 // Update notes (these will be set as task text!)
291                                 setExtensionUpdateNotes("Eindeutige Schl&uuml;ssel (UNIQUE) und normale Schl&uuml;ssel (INDEX) gesetzt.");
292                                 break;
293
294                         case '0.3.2': // SQL queries for v0.3.2
295                                 // Connection table between the menu system and the "logical area system"
296                                 addDropTableSql('admin_menu_las');
297                                 addCreateTableSql('admin_menu_las', "
298 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
299 `la_id` VARCHAR(255) NOT NULL DEFAULT '',
300 `la_action` VARCHAR(255) NOT NULL DEFAULT '',
301 `la_what` VARCHAR(255) NOT NULL DEFAULT '',
302 PRIMARY KEY (`id`),
303 INDEX (`la_id`),
304 INDEX (`la_action`),
305 INDEX (`la_what`)",
306                                         'Menu system -> LAS');
307
308                                 // All "logical areas" together
309                                 addDropTableSql('admin_menu_las_data');
310                                 addCreateTableSql('admin_menu_las_data', "
311 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
312 `la_id` VARCHAR(255) NOT NULL DEFAULT '',
313 `la_title` VARCHAR(255) NOT NULL DEFAULT '',
314 `la_posx` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
315 `la_posy` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
316 PRIMARY KEY (`id`),
317 UNIQUE INDEX (`la_id`),
318 INDEX (`la_posx`),
319 INDEX (`la_posy`)",
320                                         'LAS position and title data');
321
322                                 // Which menu do you like?
323                                 addConfigAddSql('admin_menu', "ENUM('NEW','OLD') NOT NULL DEFAULT 'OLD'");
324
325                                 // Insert menus
326                                 addAdminMenuSql('setup', 'config_admin', 'Adminmen&uuml;', 'Diverse Einstellungen am Adminmen&uuml; vornehmen.', 9);
327
328                                 // Update notes (these will be set as task text!)
329                                 setExtensionUpdateNotes("Logische Bereiche (Logical Areas = LAs) eingef&uuml;hrt. Dadurch wird das immer st&auml;rker anwachsende Admin-Men&uuml; in grosse Hauptgruppen unterteilt, wodurch ein Auffinden von Men&uuml;punkten verbessert wird.");
330                                 break;
331
332                         case '0.3.3': // SQL queries for v0.3.3
333                                 // Switch of the "intelligent menu sorter" when you want to have a fixed menu structure...
334                                 addConfigAddSql('admin_menu_sorter', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
335
336                                 // The statistics table
337                                 addDropTableSql('admin_las_stats');
338                                 addCreateTableSql('admin_las_stats', "
339 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
340 `admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
341 `type` ENUM('la','action','what') NOT NULL DEFAULT 'what',
342 `clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
343 PRIMARY KEY (`id`),
344 INDEX (`admin_id`)",
345                                         'LAS click data');
346
347                                 // Update notes (these will be set as task text!)
348                                 setExtensionUpdateNotes("Admin-abh&auml;ngig werden nun Klicks im Admin-Men&uuml; gez&auml;hlt, die zur automatischen Anpassung des Men&uuml;s in den logischen Bereichen diennen. Dieses &quot;intelligente Unbauen&quot; k&ouml;nnen Sie auch ganz abschalten.");
349                                 break;
350
351                         case '0.3.4': // SQL queries for v0.3.4
352                                 // Update notes (these will be set as task text!)
353                                 setExtensionUpdateNotes("Veraltetes Update (what=list_user&amp;mode=noref)");
354                                 break;
355
356                         case '0.3.5': // SQL queries for v0.3.5
357                                 // List accounts with no referral
358                                 addMemberMenuSql('stats', NULL, 'Statistiken', 4);
359                                 addMemberMenuSql('stats', 'stats2', 'Framekiller-Mails', 2);
360                                 addMemberMenuSql('extras', NULL, 'Extras', 5);
361                                 addMemberMenuSql('rals', NULL, 'Rallyes', 6);
362                                 addMemberMenuSql('account', NULL, 'Ihr Account', 7);
363                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='stats',`sort`=1,`title`='Klick-Mails' WHERE `what`='stats' LIMIT 1");
364                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras',`sort`=3 WHERE `what`='reflinks' LIMIT 1");
365
366                                 // Update notes (these will be set as task text!)
367                                 setExtensionUpdateNotes("Mitgliedsmen&uuml; komplett umgebaut.");
368                                 break;
369
370                         case '0.3.6': // SQL queries for v0.3.6
371                                 addConfigAddSql('salt_length', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 10');
372                                 addConfigAddSql('pass_scramble', "VARCHAR(255) NOT NULL DEFAULT ''");
373                                 addExtensionChangeTableColumnSql('admins', 'password', 'password', "VARCHAR(255) NOT NULL DEFAULT ''");
374                                 addConfigAddSql('rand_no', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
375                                 addConfigAddSql('file_hash', "VARCHAR(255) NOT NULL DEFAULT ''");
376                                 addConfigAddSql('master_salt', "VARCHAR(255) NOT NULL DEFAULT ''");
377                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_config` SET `rand_no`=(ROUND(RAND() * 99999) + 100000) WHERE `config`=0 LIMIT 1");
378                                 addExtensionAddTableColumnSql('mod_reg', 'has_menu', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
379                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `has_menu`='Y' WHERE `module`='admin' OR `module`='index' OR `module`='login' LIMIT 3");
380
381                                 // Update notes (these will be set as task text!)
382                                 setExtensionUpdateNotes("Passwort-System mit Zufallshash erweitert (Schutzt gegen Dictionary-Attacks!)");
383                                 break;
384
385                         case '0.3.7': // SQL queries for v0.3.7
386                                 setExtensionUpdateNotes("Problem w&auml;hrend des Installationsvorganges behoben.");
387                                 break;
388
389                         case '0.3.8': // SQL queries for v0.3.8
390                                 addExtensionChangeTableColumnSql('admin_menu', 'descr', 'descr', 'MEDIUMTEXT NULL');
391                                 addExtensionChangeTableColumnSql('pool', 'text', 'text', 'LONGTEXT NOT NULL');
392
393                                 // Update notes (these will be set as task text!)
394                                 setExtensionUpdateNotes("Beschreibungstexte f&uuml;r Admin-Men&uuml;s k&ouml;nnen l&auml;nger sein. Diverse Fixes.");
395                                 break;
396
397                         case '0.3.9': // SQL queries for v0.3.9
398                                 // Update notes (these will be set as task text!)
399                                 setExtensionUpdateNotes("Beschreibungstexte f&uuml;r Admin-Men&uuml;s k&ouml;nnen l&auml;nger sein. Diverse Fixes.");
400                                 break;
401
402                         case '0.4.0': // SQL queries for v0.4.0
403                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title` = 'Email-Management' WHERE `action` = 'email' AND (`what`='' OR `what` IS NULL) LIMIT 1");
404
405                                 // Update notes (these will be set as task text!)
406                                 setExtensionUpdateNotes("Email-Verwaltung nach Email-Management umbenannt.");
407                                 break;
408
409                         case '0.4.1': // SQL queries for v0.4.1
410                                 addConfigAddSql('show_timings', "ENUM ('Y','N') NOT NULL DEFAULT 'Y'");
411
412                                 // Update notes (these will be set as task text!)
413                                 setExtensionUpdateNotes("Tabellen-Schl&uuml;ssel neu gesetzt und Parsing-Zeit im Footer eingeblendet.");
414                                 break;
415
416                         case '0.4.2': // SQL queries for v0.4.2
417                                 // Update notes (these will be set as task text!)
418                                 setExtensionUpdateNotes("Nicht mehr g&uuml;ltiges Update.");
419                                 break;
420
421                         case '0.4.3': // SQL queries for v0.4.3
422                                 addConfigAddSql('proxy_host', "VARCHAR(255) NOT NULL DEFAULT ''");
423                                 addConfigAddSql('proxy_port', 'INT(5) UNSIGNED NOT NULL DEFAULT 0');
424                                 addConfigAddSql('proxy_username', "VARCHAR(255) NOT NULL DEFAULT ''");
425                                 addConfigAddSql('proxy_password', "VARCHAR(255) NOT NULL DEFAULT ''");
426                                 addAdminMenuSql('setup','config_proxy','Proxy-Einstellungen','Sollte Ihr Webserver sich hinter einem Proxy befinden, so k&ouml;nnen Sie Ihren {?mt_word?} so konfigurieren, dass es z.B. Updates, Abfragen von Netzwerkupdates &uuml;ber diesen t&auml;tigt.', 15);
427
428                                 // Update notes (these will be set as task text!)
429                                 setExtensionUpdateNotes("Proxy-Einstellungen hinzugef&uuml;gt.");
430                                 break;
431
432                         case '0.4.4': // SQL queries for v0.4.4
433                                 addExtensionChangeTableColumnSql('admin_menu', 'what', 'what', 'VARCHAR(255) NULL DEFAULT NULL');
434                                 addExtensionChangeTableColumnSql('guest_menu', 'what', 'what', 'VARCHAR(255) NULL DEFAULT NULL');
435                                 addExtensionChangeTableColumnSql('member_menu', 'what', 'what', 'VARCHAR(255) NULL DEFAULT NULL');
436                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `what`=NULL WHERE `what`=''");
437                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `what`=NULL WHERE `what`=''");
438                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `what`=NULL WHERE `what`=''");
439
440                                 // Make this depending on ext-menu
441                                 addExtensionDependency('menu');
442
443                                 // Update notes (these will be set as task text!)
444                                 setExtensionUpdateNotes("Schl&uuml;ssel in Admin-, Gast- und Mitgliedsmen&uuml; verbessert.");
445                                 break;
446
447                         case '0.4.5': // SQL queries for v0.4.5
448                                 addConfigAddSql('last_month', 'CHAR(2) NOT NULL DEFAULT 00');
449                                 addConfigAddSql('last_week', 'CHAR(2) NOT NULL DEFAULT 00');
450
451                                 // Update notes (these will be set as task text!)
452                                 setExtensionUpdateNotes("T&auml;glichen/w&ouml;chentlichen/monatlichen Reset verbessert.");
453                                 break;
454
455                         case '0.4.6': // SQL queries for v0.4.6
456                                 // Update notes (these will be set as task text!)
457                                 setExtensionUpdateNotes("Nicht mehr g&uuml;ltiges Update.");
458                                 break;
459
460                         case '0.4.7': // SQL queries for v0.4.7
461                                 // Update notes (these will be set as task text!)
462                                 setExtensionUpdateNotes("Veraltetes Update.");
463                                 break;
464
465                         case '0.4.8': // SQL queries for v0.4.8
466                                 // Update notes (these will be set as task text!)
467                                 setExtensionUpdateNotes("Update nach <strong>ext-task</strong> verschoben.");
468                                 break;
469
470                         case '0.4.9': // SQL queries for v0.4.9
471                                 // Update notes (these will be set as task text!)
472                                 setExtensionUpdateNotes("Nicht mehr g&uuml;ltiges Update.");
473                                 break;
474
475                         case '0.5.0': // SQL queries for v0.5.0
476                                 addExtensionDropTableIndexSql('refsystem', 'level');
477                                 addExtensionDropTableIndexSql('refsystem', 'userid');
478                                 addExtensionAddTableIndexSql('refsystem', 'userid_level', '(`userid`, `level`)');
479
480                                 // Update notes (these will be set as task text!)
481                                 setExtensionUpdateNotes("Referral-System unterst&uuml;tzt nun detailierte Referral-&Uuml;bersicht und vieles mehr.");
482                                 break;
483
484                         case '0.5.1': // SQL queries for v0.5.1
485                                 addExtensionDropTableColumnSql('member_menu', 'descr');
486
487                                 // Update notes (these will be set as task text!)
488                                 setExtensionUpdateNotes("Beschreibungsspalte von Mitgliedsmen&uuml; entfernt, welche ohnehin nicht genutzt wird.");
489                                 break;
490
491                         case '0.5.2': // SQL queries for v0.5.2
492                                 addExtensionChangeTableColumnSql('refdepths', 'percents', 'percents', 'FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000');
493
494                                 // Update notes (these will be set as task text!)
495                                 setExtensionUpdateNotes("Prozents&auml;tze k&ouml;nnen nun f&uuml;nf Stellen hinter dem Komma sein.");
496                                 break;
497
498                         case '0.5.3': // SQL queries for v0.5.3
499                                 addConfigAddSql('session_save_path', "VARCHAR(255) NOT NULL DEFAULT ''");
500                                 addAdminMenuSql('setup','config_session','Session-Einstellungen','&Auml;ndern Sie hier den Speicherpfad f&uuml;r Sessiondateien (Sitzungsdateien) ab, falls die Standard-Einstellung bei Ihrem Hoster zu Problem f&uuml;hren sollte.', 16);
501
502                                 // Update notes (these will be set as task text!)
503                                 setExtensionUpdateNotes("Session-Speicherpfad konfigurierbar. Beispielsweise ist dies bei all-inkl.com n&ouml;tig.");
504                                 break;
505
506                         case '0.5.4': // SQL queries for v0.5.4
507                                 addMemberMenuSql('main', 'reflist', 'Ref-&Uuml;bersicht', 5);
508
509                                 // Update notes (these will be set as task text!)
510                                 setExtensionUpdateNotes("Ref-&Uuml;bersicht eingebaut. Diese h&auml;ngt von der Erweiterung <strong>refback</strong> ab.");
511                                 break;
512
513                         case '0.5.5': // SQL queries for v0.5.5
514                                 addConfigAddSql('show_points_unconfirmed', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
515
516                                 // Update notes (these will be set as task text!)
517                                 setExtensionUpdateNotes("Anzeige der {?POINTS?} unter den unbest&auml;tigten Mails kann nun optional abgeschaltet werden.");
518                                 break;
519
520                         case '0.5.6': // SQL queries for v0.5.6
521                                 // Update notes (these will be set as task text!)
522                                 setExtensionUpdateNotes("Nicht mehr g&uuml;ltiges Update.");
523                                 break;
524
525                         case '0.5.7': // SQL queries for v0.5.7
526                                 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='list_norefs' LIMIT 1");
527
528                                 // Update notes (these will be set as task text!)
529                                 setExtensionUpdateNotes("Auflistung der Mitglieder ohne Werber nach what=list_user&amp;mode=norefs verschoben.");
530                                 break;
531
532                         case '0.5.8': // SQL queries for v0.5.8
533                                 addExtensionDropTableColumnSql('extensions', 'ext_lang_file');
534
535                                 // Update notes (these will be set as task text!)
536                                 setExtensionUpdateNotes("Sprachdateinamen werden nicht mehr in der Datenbank behalten.");
537                                 break;
538
539                         case '0.5.9': // SQL queries for v0.5.9
540                                 // Table 'filters' is vital because many functionality depends on it, so don't remove it
541                                 addCreateTableSql('filters', "
542 `filter_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
543 `filter_name` VARCHAR(50) NOT NULL DEFAULT '',
544 `filter_function` VARCHAR(100) NOT NULL DEFAULT '',
545 `filter_active` ENUM('N','Y') NOT NULL DEFAULT 'Y',
546 `filter_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
547 PRIMARY KEY (`filter_id`),
548 UNIQUE INDEX `name_function` (`filter_name`, `filter_function`)",
549                                         'Filter system');
550
551                                 // Admin menu
552                                 addAdminMenuSql('setup','list_filter','Filter-Management', 'Zeigt alle im System registrierten Filter an und l&auml;sst diese de- bzw. wieder aktivieren.', 17);
553
554                                 // Update notes (these will be set as task text!)
555                                 setExtensionUpdateNotes("Tabellen f&uuml;r Filter-System hinzugef&uuml;gt.");
556                                 break;
557
558                         case '0.6.0': // SQL queries for v0.6.0
559                                 addConfigAddSql('update_filter_usage', "ENUM('N','Y') NOT NULL DEFAULT 'N'");
560
561                                 // Update notes (these will be set as task text!)
562                                 setExtensionUpdateNotes("Benutzungsstatistik eingebaut. Das Z&auml;hlen der Filterverwendungen sollte <strong>ausschliesslich</strong> zu Debugging-Zwecken eingesetzt werden.");
563                                 break;
564
565                         case '0.6.1': // SQL queries for v0.6.1
566                                 // Update notes (these will be set as task text!)
567                                 setExtensionUpdateNotes("Nicht mehr g&uuml;ltiges Update.");
568                                 break;
569
570                         case '0.6.2': // SQL queries for v0.6.2
571                                 // Depends on refback extension
572                                 addExtensionDependency('user');
573
574                                 // Update notes (these will be set as task text!)
575                                 setExtensionUpdateNotes("Abh&auml;ngigkeit von <u>ext-user</u> gesetzt.");
576                                 break;
577
578                         case '0.6.3': // SQL queries for v0.6.3
579                                 // Update notes (these will be set as task text!)
580                                 setExtensionUpdateNotes("Filter-Tabelle bereinigt um doppelte Eintr&auml;ge und Unique-Key auf <span class=\"bad\">filter_name</span> und <span class=\"bad\">filter_function</span> zusammen gesetzt.");
581
582                                 // Add special fix include to fix filters
583                                 addIncludeToPool('extension', 'inc/fix_filters.php');
584                                 break;
585
586                         case '0.6.4': // SQL queries for v0.6.4
587                                 // Update admin menu
588                                 addExtensionSql("UPDATE  `{?_MYSQL_PREFIX?}_admin_menu` SET `title` = REPLACE(`title`, '!POINTS!', '?POINTS?') WHERE `title` LIKE '%!POINTS!%'");
589                                 addExtensionSql("UPDATE  `{?_MYSQL_PREFIX?}_admin_menu` SET `descr` = REPLACE(`descr`, '!POINTS!', '?POINTS?') WHERE `descr` LIKE '%!POINTS!%'");
590                                 addExtensionSql("UPDATE  `{?_MYSQL_PREFIX?}_guest_menu` SET `title` = REPLACE(`title`, '!POINTS!', '?POINTS?') WHERE `title` LIKE '%!POINTS!%'");
591                                 addExtensionSql("UPDATE  `{?_MYSQL_PREFIX?}_member_menu` SET `title` = REPLACE(`title`, '!POINTS!', '?POINTS?') WHERE `title` LIKE '%!POINTS!%'");
592
593                                 // Update notes (these will be set as task text!)
594                                 setExtensionUpdateNotes("Datenbank umgestellt auf Konfigurationselemente.");
595                                 break;
596
597                         case '0.6.5': // SQL queries for v0.6.5
598                                 addConfigChangeSql('css_php', 'css_php', "ENUM('DIRECT','FILE','INLINE') NOT NULL DEFAULT 'FILE'");
599
600                                 // Update notes (these will be set as task text!)
601                                 setExtensionUpdateNotes("Ausgabe der CSS-Dateien entweder per css.php oder sie sind direkt eingebunden.");
602                                 break;
603
604                         case '0.6.6': // SQL queries for v0.6.6
605                                 addAdminMenuSql('setup', 'config_secure', 'Sicherheitseinstellungen', 'Stellen Sie ein, wie lange das Passwort eines Mitgliedes mindestens sein muss uvm.', 9);
606                                 addAdminMenuSql('setup', 'config_points', '{OPEN_CONFIG}POINTS{CLOSE_CONFIG}', 'Stellen Sie hier die Willkommensgutschrift, Referral-Gutschrift (einmalige) usw. ein.', 10);
607                                 addAdminMenuSql('email', 'email_archiv', 'E-Mail Archiv', 'Sehen Sie sich hier bereits gesendete Mails an.', 6);
608
609                                 // Update notes (these will be set as task text!)
610                                 setExtensionUpdateNotes("Die Sicherheitseinstellungen, {?POINTS?}-Einstellungen und Email-Archiv funktionieren nur, wenn diese Erweiterung installiert ist.");
611                                 break;
612
613                         case '0.6.7': // SQL queries for v0.6.7
614                                 addConfigChangeSql('index_delay', 'index_delay', 'TINYINT(3) NOT NULL DEFAULT 0');
615
616                                 // Update notes (these will be set as task text!)
617                                 setExtensionUpdateNotes("Die Weiterleitungseinstellung muss auch Werte kleiner Null akzeptieren.");
618                                 break;
619
620                         case '0.6.8': // SQL queries for v0.6.8
621                                 addExtensionChangeTableColumnSql('admin_menu', 'action', 'action', 'VARCHAR(50) NOT NULL');
622                                 addExtensionChangeTableColumnSql('admin_menu', 'what', 'what', 'VARCHAR(50) NULL DEFAULT NULL');
623                                 addExtensionChangeTableColumnSql('guest_menu', 'action', 'action', 'VARCHAR(50) NOT NULL');
624                                 addExtensionChangeTableColumnSql('admin_menu', 'what', 'what', 'VARCHAR(50) NULL DEFAULT NULL');
625                                 addExtensionChangeTableColumnSql('member_menu', 'action', 'action', 'VARCHAR(50) NOT NULL');
626                                 addExtensionChangeTableColumnSql('admin_menu', 'what', 'what', 'VARCHAR(50) NULL DEFAULT NULL');
627
628                                 // Update notes (these will be set as task text!)
629                                 setExtensionUpdateNotes("Spalten verk&uuml;rzt, damit die Schl&uuml;ssel passen.");
630                                 break;
631
632                         case '0.6.9': // SQL queries for 0.6.9
633                                 // Register filter
634                                 registerFilter(__FILE__, __LINE__, 'member_login_check', 'RESET_USER_LOGIN_FAILURE', FALSE, TRUE, isExtensionDryRun());
635
636                                 // Update notes (these will be set as task text!)
637                                 setExtensionUpdateNotes("Filter zum Zur&uuml;cksetzens des fehlgeschlagenen Mitgliederlogins hinzugef&uuml;gt (internes TODO).");
638                                 break;
639
640                         case '0.7.0': // SQL queries for 0.7.0
641                                 // Table definition
642                                 addDropTableSql('dns_cache');
643                                 addCreateTableSql('dns_cache', "
644 `hostname` VARCHAR(255) NOT NULL,
645 `ip` VARCHAR(15) NOT NULL,
646 `added` DATETIME NOT NULL,
647 PRIMARY KEY (`hostname`),
648 INDEX (`ip`)",
649                                         'Cache for DNS requests');
650
651                                 // Configuration
652                                 addConfigAddSql('dns_cache_timeout', 'BIGINT(20) NOT NULL DEFAULT ' . (60*60*24));
653
654                                 // Register filter
655                                 registerFilter(__FILE__, __LINE__, 'reset', 'CLEANUP_DNS_CACHE', FALSE, TRUE, isExtensionDryRun());
656
657                                 // Update notes (these will be set as task text!)
658                                 setExtensionUpdateNotes("IP-Resolver-Klasse hinzugef&uuml;gt, um bei der Erweiterung ext-network DNS-Anfragen einzusparen.");
659                                 break;
660
661                         case '0.7.1': // SQL queries for v0.7.1
662                                 // This update just depends on ext-timezone to make integration of an essential extension much easier
663                                 addExtensionDependency('timezone');
664
665                                 // Update notes (these will be set as task text!)
666                                 setExtensionUpdateNotes("Zeitzone ist nun mit ext-timezone konfigurierbar.");
667                                 break;
668
669                         case '0.7.2': // SQL queries for v0.7.2
670                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `task_type`='MEMBER_SUPPORT' WHERE `task_type`='SUPPORT_MEMBER'");
671
672                                 // Update notes (these will be set as task text!)
673                                 setExtensionUpdateNotes("Daten an Namenskonvention angepasst.");
674                                 break;
675
676                         case '0.7.3': // SQL queries for v0.7.3
677                                 addExtensionChangeTableColumnSql('filters', 'filter_name', 'filter_name', "VARCHAR(50) NOT NULL DEFAULT ''");
678                                 addExtensionChangeTableColumnSql('filters', 'filter_function', 'filter_function', "VARCHAR(100) NOT NULL DEFAULT ''");
679
680                                 // Update notes (these will be set as task text!)
681                                 setExtensionUpdateNotes("Spalten in Filtertabelle gek&uuml;rzt (SQL-Fehler wegen zu grossem Schl&uuml;ssel).");
682                                 break;
683
684                         case '0.7.4': // SQL queries for v0.7.4
685                                 addExtensionAddTableColumnSql('pool', 'mails_sent', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
686
687                                 // Update notes (these will be set as task text!)
688                                 setExtensionUpdateNotes("Spalten in Filtertabelle gek&uuml;rzt (SQL-Fehler wegen zu grossem Schl&uuml;ssel).");
689                                 break;
690
691                         case '0.7.5': // SQL queries for v0.7.5
692                                 addConfigAddSql('last_hour', 'TINYINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT 00');
693
694                                 // Update notes (these will be set as task text!)
695                                 setExtensionUpdateNotes("Aktuelle Stunde hinzugef&uuml;gt (ist nicht konfigurierbar).");
696                                 break;
697
698                         case '0.7.6': // SQL queries for v0.7.6
699                                 addConfigChangeSql('last_month', 'last_month', 'TINYINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT 00');
700                                 addConfigChangeSql('last_week', 'last_week', 'TINYINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT 00');
701
702                                 // Update notes (these will be set as task text!)
703                                 setExtensionUpdateNotes("Spaltentyp fuer kleine Zahlen sollten auch z.B. TINYINT sein.");
704                                 break;
705
706                         case '0.7.7': // SQL queries for v0.7.7
707                                 addMemberMenuSql('earn', NULL, 'Verdienen', 2);
708                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='earn',`sort`=1 WHERE `what`='unconfirmed' LIMIT 1");
709
710                                 // Update notes (these will be set as task text!)
711                                 setExtensionUpdateNotes("Men&uuml;punkt <strong>Verdienen</strong> hinzugef&uuml;gt und <strong>Unbest&auml;tigte Mails</strong> als ersten Punkt dort hin verschoben.");
712                                 break;
713
714                         case '0.7.8': // SQL queries for v0.7.8
715                                 // Update notes (these will be set as task text!)
716                                 setExtensionUpdateNotes("Konfigurationseintr&auml;ge mit Spaltentyp <strong>ENUM</strong> werden nun immer komplett gross geschrieben.");
717                                 break;
718
719                         case '0.7.9': // SQL queries for v0.7.9
720                                 addExtensionSQL("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `what`='list_email_max_rec' WHERE `what`='config_email' LIMIT 1");
721
722                                 // Update notes (these will be set as task text!)
723                                 setExtensionUpdateNotes("Adminscript <strong>what-config_email.php</strong> nach <strong>what-list_email_max_rec.php</strong> umbenannt.");
724                                 break;
725
726                         case '0.8.0': // SQL queries for v0.8.0
727                                 // Points account data (this table should not be dropped or else you may have to re-install a lot extensions)
728                                 addCreateTableSql('points_data', "
729 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
730 `subject` VARCHAR(255) NOT NULL DEFAULT '',
731 `column_name` VARCHAR(255) NOT NULL DEFAULT 'points',
732 `locked_mode` ENUM('LOCKED','UNLOCKED') NOT NULL DEFAULT 'LOCKED',
733 `payment_method` ENUM('DIRECT','REFERRAL') NOT NULL DEFAULT 'REFERRAL',
734 `notify_recipient` ENUM('Y','N') NOT NULL DEFAULT 'N',
735 PRIMARY KEY (`id`),
736 UNIQUE KEY (`subject`)",
737                                         'Points account data');
738
739                                 // Admin menu
740                                 addAdminMenuSql('setup', 'list_point_accounts', 'Guthabenkonten...', 'Veralten Sie hier bequem Einstellungen zu den Guthabenkonten.', 5);
741
742                                 // Update notes (these will be set as task text!)
743                                 setExtensionUpdateNotes("Tabelle <span class=\"bad\">points_data</span> erzeugt, diese soll das {?POINTS?}-Guthaben komplett lenken.");
744                                 break;
745
746                         case '0.8.1': // SQL queries for v0.8.1
747                                 addExtensionChangeTableColumnSql('refdepths', 'level', 'level', 'TINYINT(3) UNSIGNED NULL DEFAULT NULL');
748                                 addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_refdepths` SET `level`=NULL WHERE `level`=0 LIMIT 1');
749
750                                 // Update notes (these will be set as task text!)
751                                 setExtensionUpdateNotes("Level 0 ist nun auch NULL.");
752                                 break;
753
754                         case '0.8.2': // SQL queries for v0.8.2
755                                 addExtensionDropTableIndexSql('points_data', 'ext_name');
756                                 addExtensionChangeTableColumnSql('points_data', 'ext_name', 'subject', "VARCHAR(255) NOT NULL DEFAULT ''");
757                                 addExtensionAddTableColumnSql('points_data', 'notify_recipient', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
758
759                                 // Register points data
760                                 registerExtensionPointsData('pool_payback', 'points', 'LOCKED', 'DIRECT');
761                                 registerExtensionPointsData('mail_deleted', 'points', 'LOCKED', 'DIRECT');
762
763                                 // Remove deprecated configuration entry
764                                 addConfigDropSql('reg_points_mode');
765
766                                 // Update notes (these will be set as task text!)
767                                 setExtensionUpdateNotes("Es sollte der Gutschriftenbetreff und nicht der Erweiterungsname gepeichert werden, zudem brauchen wir einen Konfigurationseintrag nicht mehr.");
768                                 break;
769
770                         case '0.8.3': // SQL queries for v0.8.3
771                                 addConfigAddSql('display_home_in_index', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
772
773                                 // Update notes (these will be set as task text!)
774                                 setExtensionUpdateNotes("Es kann nun die &quot;Home&quot;-Seite in <strong>index.php</strong> angezeigt werden, anstelle der Weiterleitung.");
775                                 break;
776
777                         case '0.8.4': // SQL queries for v0.8.4
778                                 addCreateTableSql('history', "
779 `history_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
780 `history_subject` VARCHAR(255) NOT NULL DEFAULT 'GENERIC',
781 `history_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
782 `history_value` VARCHAR(255) NOT NULL DEFAULT '',
783 `history_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
784 `history_last_used` TIMESTAMP NULL DEFAULT NULL,
785 PRIMARY KEY (`history_id`),
786 INDEX `userid` (`history_userid`),
787 INDEX (`history_last_used` DESC)",
788                                         'History of used data');
789
790                                 // Register filter
791                                 registerFilter(__FILE__, __LINE__, 'add_history_entry', 'ADD_HISTORY_ENTRY', FALSE, TRUE, isExtensionDryRun());
792
793                                 // Update notes (these will be set as task text!)
794                                 setExtensionUpdateNotes("Allgemeine Historie-Tabelle hinzugef&uuml;gt.");
795                                 break;
796
797                         case '0.8.5': // SQL queries for v0.8.5
798                                 // Old-lost configuration entry
799                                 addConfigDropSql('ext_autopurge');
800
801                                 // Update notes (these will be set as task text!)
802                                 setExtensionUpdateNotes("Uralten Konfigurationseintrag entfernt.");
803                                 break;
804
805                         case '0.8.6': // SQL queries for v0.8.6
806                                 addExtensionChangeTableColumnSql('points_data', 'payment_method', 'payment_method', "ENUM('DIRECT','REFERRAL') NOT NULL DEFAULT 'REFERRAL'");
807                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_points_data` SET `payment_method`='REFERRAL' WHERE `payment_method` != 'DIRECT'");
808
809                                 // Update notes (these will be set as task text!)
810                                 setExtensionUpdateNotes("Referral/REFERRAL soll es &uuml;berall heissen (ist ein Typo nur mit einem R zu schreiben).");
811                                 break;
812
813                         case '0.8.7': // SQL queries for v0.8.7
814                                 addConfigAddSql('admin_menu_javascript', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
815
816                                 // Update notes (these will be set as task text!)
817                                 setExtensionUpdateNotes("Es kann ausgew&auml;hlt werden, ob das herk&ouml;mliche JavaScrit-lose Men&uuml; oder mit JavaScript aktiv sein soll. Das herk&ouml;mliche ist erstmal Standardeinstellung, bis das JavaScript-Men&uuml; funktioniert.");
818                                 break;
819
820                         case '0.8.8': // SQL queries for v0.8.8
821                                 addExtensionDropTableIndexSql('points_data', 'subject');
822                                 addExtensionAddTableUniqueSql('points_data', 'subject', '(`subject`)');
823
824                                 // Update notes (these will be set as task text!)
825                                 setExtensionUpdateNotes("Der Wert in der Spalte <strong>subject</strong> sollte nur einmal vorkommen, damit eventuell nichts mehrfach durchfl&auuml;ft.");
826                                 break;
827
828                         case '0.8.9': // SQL queries for v0.8.9
829                                 addExtensionAddTableColumnSql('points_data', 'account_provider', "ENUM('EXTENSION', 'CUSTOM') NOT NULL DEFAULT 'EXTENSION'");
830                                 addConfigAddSql('points_remove_account', "VARCHAR(255) NOT NULL DEFAULT 'points'");
831
832                                 // Update notes (these will be set as task text!)
833                                 setExtensionUpdateNotes("&quot;Provider&quot; hinzugef&uuml;gt, welcher nur <strong>Erweiterung</strong> oder <strong>Selbstdefiniert sein kann. Es k&ouml;nnen dann auch nur selbstdefinierte gel&ouml;scht oder editiert werden, Erweiterungen k&ouml;nnen auch nur &quot;einige&quot; Eintr&auml;ge l&ouml;schen.");
834                                 break;
835
836                         case '0.9.0': // SQL queries for v0.9.0
837                                 // Register filter
838                                 registerFilter(__FILE__, __LINE__, 'init', 'GENERATE_FILE_SECRET_HASH', FALSE, TRUE, isExtensionDryRun());
839
840                                 // Register points data
841                                 registerExtensionPointsData('admin_add_single', 'points', 'LOCKED', 'DIRECT');
842                                 registerExtensionPointsData('admin_add_single_ref', 'points', 'LOCKED', 'DIRECT');
843                                 registerExtensionPointsData('admin_add_all', 'points', 'LOCKED', 'DIRECT');
844                                 registerExtensionPointsData('admin_add_all_ref', 'points', 'LOCKED', 'DIRECT');
845
846                                 // Update notes (these will be set as task text!)
847                                 setExtensionUpdateNotes("Filter zum Initialisieren von ext-sql_patches registriert und Eintr&auml;ge in <strong>{?_MYSQL_PREFIX?}_points_data</strong> hinzugef&uuml;gt.");
848                                 break;
849
850                         case '0.9.1': // SQL queries for v0.9.1
851                                 // Add admin menu
852                                 addAdminMenuSql('misc', 'list_server_name', 'Verkehrte Domains auflisten', 'Listet alle als verkehrt erkannten Domains auf.', 4);
853
854                                 // Create table
855                                 addCreateTableSql('server_name_log', "
856 `server_name_id` BIGINT (20) NOT NULL AUTO_INCREMENT,
857 `server_name` VARCHAR (255) NOT NULL DEFAULT 'invalid',
858 `server_name_remote_addr` VARCHAR (15) NOT NULL DEFAULT '0.0.0.0',
859 `server_name_ua` TINYTEXT NULL DEFAULT NULL,
860 `server_name_referrer` TINYTEXT NULL DEFAULT NULL,
861 `server_name_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
862 `server_name_counter` BIGINT (20) NOT NULL DEFAULT 1,
863 PRIMARY KEY (`server_name_id`)
864 ", 'Logging of wrong SERVER_NAME');
865
866                                 // Update notes (these will be set as task text!)
867                                 setExtensionUpdateNotes("Loggen von falschen <strong>SERVER_NAME</strong> Eintr&auml;gen hinzugef&uuml;gt.");
868                                 break;
869
870                         case '0.9.2': // SQL queries for v0.9.2
871                                 addExtensionAddTableColumnSql('server_name_log', 'server_name_remote_addr', "VARCHAR (15) NOT NULL DEFAULT '0.0.0.0'");
872                                 addExtensionAddTableColumnSql('server_name_log', 'server_name_counter', 'BIGINT (20) NOT NULL DEFAULT 0');
873                                 addExtensionAddTableColumnSql('server_name_log', 'server_name_ua', 'TINYTEXT NULL DEFAULT NULL');
874                                 addExtensionAddTableColumnSql('server_name_log', 'server_name_referrer', 'TINYTEXT NULL DEFAULT NULL');
875
876                                 // Update notes (these will be set as task text!)
877                                 setExtensionUpdateNotes("Sorry, hatte noch IP-Nummer, User-Agent, aufrufende Seite und Z&auml;hler vergessen.");
878                                 break;
879
880                         case '0.9.3': // SQL queries for v0.9.3
881                                 addConfigAddSql('ap_server_name', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
882                                 addConfigAddSql('ap_server_name_since', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 7));
883
884                                 // Register filter
885                                 registerFilter(__FILE__, __LINE__, 'extra_autopurge', 'SERVER_NAME_EXTRA_AUTOPURGE', FALSE, TRUE, isExtensionDryRun());
886
887                                 // Update notes (these will be set as task text!)
888                                 setExtensionUpdateNotes("Bereinigung von verkehrten <strong>SERVER_NAME</strong> Eintr&auml;gen hinzugef&uuml;gt.");
889                                 break;
890
891                         case '0.9.4': // SQL queries for v0.9.4
892                                 addAdminMenuSql('setup', 'list_referral_levels', 'Referral-Ebenen', 'Erlaubt das Auflisten, hinzuf&uuml;gen, &auml;ndern und l&ouml;schen von Referral-Ebenen. Seien Sie beim L&ouml;schen vorsichtig, da deren Id-Nummern zum Verkn&uuml;pfen verwendet werden. Sollten Sie also eine Ebene l&ouml;schen, in der Mitglieder {OPEN_CONFIG}POINTS{CLOSE_CONFIG} haben sollten, sind diese verloren.', 15);
893                                 addExtensionChangeTableColumnSql('refdepths', 'percents', 'percents', 'FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000');
894
895                                 // Update notes (these will be set as task text!)
896                                 setExtensionUpdateNotes("Auflisten (usw.) von Referral-Ebenen ausgelagert in eigenen Men&uuml;punkt. Referral-Prozente d&uuml;rfen nun auch 5 Stellen hinter dem Komma haben.");
897                                 break;
898
899                         case '0.9.5': // SQL queries for v0.9.5
900                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `what`='list_cats' WHERE `action`='setup' AND `what`='config_cats' LIMIT 1");
901
902                                 // Update notes (these will be set as task text!)
903                                 setExtensionUpdateNotes("Men&uuml;punkt umbenannt, da &quot;config&quot; nur f&uuml;r die Konfigurationstabelle <strong>{?_MYSQL_PREFIX?}_config</strong> ist.");
904                                 break;
905
906                         case '0.9.6': // SQL queries for v0.9.6
907                                 // Register filter
908                                 registerFilter(__FILE__, __LINE__, 'determine_menu_mode', 'DETERMINE_MENU_MODE_GENERIC', FALSE, TRUE, isExtensionDryRun());
909
910                                 // Update notes (these will be set as task text!)
911                                 setExtensionUpdateNotes("Filter hinzugef&uuml;gt, der den Men&uuml;modus f&uuml;r weitere von dieser Erweiterung benutzten Module erkennen soll.");
912                                 break;
913
914                         case '0.9.7': // SQL queries for v0.9.7
915                                 // Register filter
916                                 registerFilter(__FILE__, __LINE__, 'config_userid_exclusion_sql', 'EXCLUDE_DEFAULT_REFID', FALSE, TRUE, isExtensionDryRun());
917
918                                 // Update notes (these will be set as task text!)
919                                 setExtensionUpdateNotes("Filter hinzugef&uuml;gt, der die Standard-Referral-Id f&uuml;r SQL-Befehle ausschliesst.");
920                                 break;
921                 } // END - switch
922                 break;
923
924         case 'modify': // When the extension got modified
925                 break;
926
927         case 'test': // For testing purposes
928                 break;
929
930         case 'init': // Do stuff when extension is initialized
931                 break;
932
933         default: // Unknown extension mode
934                 reportBug(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
935                 break;
936 } // END - switch
937
938 // [EOF]
939 ?>