Cache class rewritten to better convention
[mailer.git] / inc / extensions / ext-sql_patches.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 08/21/2004 *
4  * ================                             Last change: 12/04/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : ext-sql_patches.php                              *
8  * -------------------------------------------------------------------- *
9  * Short description : SQL fixes for pro versions                       *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Ausgelagertes "Profildaten aendern"              *
12  * -------------------------------------------------------------------- *
13  *                                                                      *
14  * -------------------------------------------------------------------- *
15  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
16  * For more information visit: http://www.mxchange.org                  *
17  *                                                                      *
18  * This program is free software; you can redistribute it and/or modify *
19  * it under the terms of the GNU General Public License as published by *
20  * the Free Software Foundation; either version 2 of the License, or    *
21  * (at your option) any later version.                                  *
22  *                                                                      *
23  * This program is distributed in the hope that it will be useful,      *
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
26  * GNU General Public License for more details.                         *
27  *                                                                      *
28  * You should have received a copy of the GNU General Public License    *
29  * along with this program; if not, write to the Free Software          *
30  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
31  * MA  02110-1301  USA                                                  *
32  ************************************************************************/
33
34 // Some security stuff...
35 if (!defined('__SECURITY')) {
36         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
37         require($INC);
38 }
39
40 // Version number
41 $EXT_VERSION = "0.5.7";
42
43 // Auto-set extension version
44 if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION;
45
46 // Version history array (add more with , "0.1" and so on)
47 $EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9", "0.5.0", "0.5.1", "0.5.2", "0.5.3", "0.5.4", "0.5.5", "0.5.6", "0.5.7");
48
49 switch ($EXT_LOAD_MODE)
50 {
51 case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
52         // SQL commands to run
53         $SQLs[] = "";
54         break;
55
56 case "remove": // Do stuff when removing extension
57         // Drop tables
58         $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_themes";
59         $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las";
60         $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las_data";
61         $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_stats";
62         $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_stats_data`";
63         $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_book`";
64
65         // Delete admin menu entries
66         $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE
67 `what`='theme_import' OR
68 `what`='theme_edit' OR
69 `what`='config_extensions' OR
70 `what`='config_home' OR
71 `what`='list_unconfirmed' OR
72 `what`='config_refid' OR
73 `what`='config_title' OR
74 `what`='sub_points' OR
75 `what`='config_admin' OR
76 `what`='config_proxy' OR
77 `what`='config_session' OR
78 LIMIT 13";
79
80         // Delete guest menu entries
81         $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE action='themes' LIMIT 1";
82
83         // Delete/update member menu entries
84         $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE
85 action='themes' OR
86 `what`='themes' OR
87 `what`='stats2' OR
88 `what`='reflist' OR
89 (action='stats' AND (`what`='' OR what IS NULL)) OR
90 (action='extras' AND (`what`='' OR what IS NULL)) OR
91 (action='rals' AND (`what`='' OR what IS NULL)) OR
92 (action='account' AND (`what`='' OR what IS NULL))";
93         $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='main' WHERE
94 action='stats' OR
95 action='extras' OR
96 action='rals' OR
97 action='account'";
98
99         // Drop indexes
100         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP UNIQUE KEY (ext_name)";
101         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins DROP UNIQUE KEY (login)";
102         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (status)";
103         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refbanner DROP INDEX (visible)";
104         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refdepths DROP UNIQUE KEY (level)";
105         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refsystem DROP INDEX (level)";
106         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool DROP INDEX (data_type)";
107         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg DROP UNIQUE KEY (module)";
108         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu DROP INDEX (action)";
109         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu DROP INDEX (what)";
110         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (task_type)";
111         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (status)";
112         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (task_created)";
113         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP FULLTEXT (subject)";
114         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (subject)";
115         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP INDEX (ext_active)";
116         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (status)";
117         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP FULLTEXT (family)";
118         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (max_mails)";
119         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (password)";
120         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (action)";
121         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (what)";
122         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (sort)";
123         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (visible)";
124         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (locked)";
125         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (what)";
126         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (sort)";
127         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (visible)";
128         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (locked)";
129         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats DROP INDEX (visible)";
130         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats DROP INDEX (sort)";
131         break;
132
133 case "activate": // Do stuff when admin activates this extension
134         // SQL commands to run
135         $SQLs[] = "";
136         break;
137
138 case "deactivate": // Do stuff when admin deactivates this extension
139         // SQL commands to run
140         $SQLs[] = "";
141         break;
142
143 case "update": // Update an extension
144         switch ($EXT_VER)
145         {
146         case "0.0.1": // SQL queries for v0.0.1
147                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ext_autopurge ENUM('Y','N') NOT NULL DEFAULT 'Y'";
148                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_extensions','Erweitungsmanagement','Alle Einstellungen am Erweiterungsmanagement.', 10)";
149
150                 // Update notes (these will be set as task text!)
151                 $UPDATE_NOTES = "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.";
152                 break;
153
154         case "0.0.2": // SQL queries for v0.0.2
155                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config CHANGE auto_purge auto_purge BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*14)."";
156
157                 // Update notes (these will be set as task text!)
158                 $UPDATE_NOTES = "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.)";
159                 break;
160
161         case "0.0.3": // SQL queries for v0.0.3
162                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD points_word VARCHAR(255) NOT NULL DEFAULT 'Punkte'";
163
164                 // Update notes (these will be set as task text!)
165                 $UPDATE_NOTES = "Das Wort &quot;Punkte&quot; kann nun per Datenbank ge&auml;ndert werden. Damit k&ouml;nnen Sie anstelle des Wortes Punkte auch Klammlose oder &euro; schreiben.";
166                 break;
167
168         case "0.0.4": // SQL queries for v0.0.4
169                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mails_page BIGINT(20) UNSIGNED NOT NULL DEFAULT 10";
170
171                 // Update notes (these will be set as task text!)
172                 $UPDATE_NOTES = "Anzahl Mails pro Seite in <STRONG>EMail-Details ansehen</STRONG> und <STRONG>EMail-Archiv</STRONG> hinzugef&uuml;gt.";
173                 break;
174
175         case "0.0.5": // SQL queries for v0.0.5
176                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_home VARCHAR(255) NOT NULL DEFAULT 'welcome'";
177                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_home','Home-Seite festlegen','Stellen Sie hier ein, welcher Men&uuml;punkt (what-welcome ist Standart) als Einstiegspunkt in das Men&uuml;system genutzt werden soll.', 5)";
178
179                 // Update notes (these will be set as task text!)
180                 $UPDATE_NOTES = "Die what-welcome.php ist derzeit die &quot;Home&quot;-Seite (Eingangsseite). Dies kann nun per Datenbank ge&auml;ndert werden.";
181                 break;
182
183         case "0.0.6": // SQL queries for v0.0.6
184                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD ext_has_css ENUM('Y','N') NOT NULL DEFAULT 'N'";
185
186                 // Update notes (these will be set as task text!)
187                 $UPDATE_NOTES = "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.";
188                 break;
189
190         case "0.0.7": // SQL queries for v0.0.7
191                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD verbose_sql ENUM('Y','N') NOT NULL DEFAULT 'Y'";
192
193                 // Update notes (these will be set as task text!)
194                 $UPDATE_NOTES = "Die SQL-Anweisungen werden bei eingeschalteter Verbose-Funktion detailiert angezeigt.";
195                 break;
196
197         case "0.0.8": // SQL queries for v0.0.8
198                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD menu_blur_spacer VARCHAR(255) NOT NULL DEFAULT '&nbsp;<STRONG><BIG>&middot;</BIG></STRONG>&nbsp;'";
199
200                 // Update notes (these will be set as task text!)
201                 $UPDATE_NOTES = "Nette Mouse-Hover-Effekte eingebaut (Anleitung <STRONG>MENUE_HOVER.txt</STRONG> zum Patchen der general.css bitte lesen!)";
202                 break;
203
204         case "0.0.9": // SQL queries for v0.0.9
205                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('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)";
206
207                 // Update notes (these will be set as task text!)
208                 $UPDATE_NOTES = "Unbest&auml;tigte Maillinks k&ouml;nnen unter Email-Management -&gt; Unbest. Mails auflisten aufgelistet werden.";
209                 break;
210
211         case "0.1.0": // SQL queries for v0.2.1
212                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD reg_points_mode ENUM('ref','direct') NOT NULL DEFAULT 'ref'";
213
214                 // Update notes (these will be set as task text!)
215                 $UPDATE_NOTES = "Soll der einmalige Ref-Bonus &uuml;ber das Referal-System (also alle oberen Refs bekommen auch etwas davon ab) oder direkt dem Werber aufgebucht werden?";
216                 break;
217
218         case "0.1.1": // SQL queries for v0.1.1
219                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Men&uuml;punkt (what-welcome ist Standart) 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";
220                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_delay TINYINT(3) UNSIGNED NOT NULL DEFAULT '-1'";
221                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*365)."";
222
223                 // Update notes (these will be set as task text!)
224                 $UPDATE_NOTES = "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.";
225                 break;
226
227         case "0.1.2": // SQL queries for v0.1.2
228                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_refid','Standart-Ref-ID','Stellen Sie hier die User-ID ein, die genommen werden soll, wenn der Gast n icht per Referal-Link Ihren Mailtausch aufgerufen hat.', 7)";
229                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD def_refid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
230
231                 // Update notes (these will be set as task text!)
232                 $UPDATE_NOTES = "Standart Referal-ID kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)";
233                 break;
234
235         case "0.1.3": // SQL queries for v0.1.3
236                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD refid_target ENUM('register','index') NOT NULL DEFAULT 'register'";
237
238                 // Update notes (these will be set as task text!)
239                 $UPDATE_NOTES = "Auf welche Seite soll der Ref-Link zeigen? Eingangsseite oder Anmeldeformular?";
240                 break;
241
242         case "0.1.4": // SQL queries for v0.1.4
243                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD default_theme VARCHAR(255) NOT NULL DEFAULT '".GET_CURR_THEME()."'";
244                 $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='theme' LIMIT 3";
245                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme', NULL, 'Themes','Verwalten Sie hier alle Designs (Themes) Ihres Mailtausch-Scriptes.', 8)";
246                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_import','Importieren','Es wird das Verzeichnis &quot;theme&quot; nach neuen Ordnern durchsucht und anschliessend in die Datenbank gesperrt aufgenommen.', 1)";
247                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_edit','Modifizieren','&Auml;ndern Sie Titel, Freigaben usw. an den Themes. Sie k&ouml;nnen bis auf das Standart-Theme &quot;default&quot; auch Themes aus der Datenbank entfernen. Vorher sollten Sie es jedoch vom Server l&ouml;schen, damit es niht erneut importiert werden kann.', 2)";
248                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',4,'Y','N')";
249                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',3,'Y','N')";
250                 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_themes";
251                 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_themes (
252 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
253 theme_path VARCHAR(255) NOT NULL DEFAULT '',
254 theme_active ENUM('Y','N') NOT NULL DEFAULT 'N',
255 theme_ver VARCHAR(255) NOT NULL DEFAULT '0.0',
256 PRIMARY KEY(id)
257 ) TYPE=MyISAM";
258
259                 // Update notes (these will be set as task text!)
260                 $UPDATE_NOTES = "Theme-Support integriert. Bitte laden Sie sich zu dieser Version das <A href=\"http://www.mxchange.org\">281-Patch</A> (wenn Ihr Script v0.2.0-pre7 ist) herunter, da ansonsten die Themes nicht klappen werden!";
261                 break;
262
263         case "0.1.5": // SQL queries for v0.1.5
264                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP ext_has_admin";
265
266                 // Update notes (these will be set as task text!)
267                 $UPDATE_NOTES = "Spalte <U>ext_has_admin</U> aus der Tabelle <U>"._MYSQL_PREFIX."_extensions</U> entfernt, da sie keinen Sinn mehr macht.";
268                 break;
269
270         case "0.1.6": // SQL queries for v0.1.6
271                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD enable_title_deco ENUM('Y','N') NOT NULL DEFAULT 'Y'";
272                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD title_left VARCHAR(10) NOT NULL DEFAULT '[--'";
273                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD title_middle VARCHAR(10) NOT NULL DEFAULT '-'";
274                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD title_right VARCHAR(10) NOT NULL DEFAULT '--]'";
275                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD enable_mod_title ENUM('Y','N') NOT NULL DEFAULT 'Y'";
276                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD enable_what_title ENUM('Y','N') NOT NULL DEFAULT 'Y'";
277                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_title','Seitentitel &auml;ndern','De-/aktivieren Sie hier die Dekorationen, sowie Modul-Titel und what-Titel im Seitentitel.', 8)";
278
279                 // Update notes (these will be set as task text!)
280                 $UPDATE_NOTES = "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.";
281                 break;
282
283         case "0.1.7": // SQL queries for v0.1.7
284                 // Update notes (these will be set as task text!)
285                 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
286                 break;
287
288         case "0.1.8": // SQL queries for v0.1.8
289                 // Update notes (these will be set as task text!)
290                 $UPDATE_NOTES = "mad_count und last_mad werden nun aus der Datenbank geladen";
291                 break;
292
293         case "0.1.9": // SQL queries for v0.1.9
294                 // Update notes (these will be set as task text!)
295                 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
296                 break;
297
298         case "0.2.0": // SQL queries for v0.2.0
299                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_jackpot CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
300
301                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payments CHANGE payment payment FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
302                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payments CHANGE price price FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
303
304                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE used_points used_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
305                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_points CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
306                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_points CHANGE locked_points locked_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
307
308                 // Update notes (these will be set as task text!)
309                 $UPDATE_NOTES = "5 Nachkommastellen implementiert";
310                 break;
311
312         case "0.2.1": // SQL queries for v0.2.1
313                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD css_php ENUM('DIRECT','FILE') NOT NULL DEFAULT 'FILE'";
314
315                 // Update notes (these will be set as task text!)
316                 $UPDATE_NOTES = "Ausgabe der CSS-Dateien entweder per css.php oder sie sind direkt eingebunden.";
317                 break;
318
319         case "0.2.2": // SQL queries for v0.2.2
320                 // Update notes (these will be set as task text!)
321                 $UPDATE_NOTES = "Erweiterung bleibt wegen integrierten Schalters immer aktiv.";
322                 break;
323
324         case "0.2.3": // SQL queries for v0.2.3
325                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD guest_menu ENUM('Y','N') NOT NULL DEFAULT 'Y'";
326                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD member_menu ENUM('Y','N') NOT NULL DEFAULT 'Y'";
327                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD youre_here ENUM('Y','N') NOT NULL DEFAULT 'Y'";
328
329                 // Update notes (these will be set as task text!)
330                 $UPDATE_NOTES = "Gast- und Mitgliedsmen&uuml;s lassen sich getrennt voneinander abschalten.";
331                 break;
332
333         case "0.2.4": // SQL queries for v0.2.4
334                 $auto_type = "png"; // PNG image is the default
335                 if ((FILE_READABLE(PATH."theme/".GET_CURR_THEME()."/images/code_bg.jpg")) && function_exists('imagecreatefromjpeg')) {
336                         // Switch to JPEG format
337                         $auto_type = "jpg";
338                 }
339                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD img_type ENUM('jpg','png') NOT NULL DEFAULT '".$auto_type."'";
340
341                 // Update notes (these will be set as task text!)
342                 $UPDATE_NOTES = "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.";
343                 break;
344
345         case "0.2.5": // SQL queries for v0.2.5
346                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE receive_mails receive_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
347                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE max_mails max_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
348
349                 // Update notes (these will be set as task text!)
350                 $UPDATE_NOTES = "Spalten <U>max_mails</U> und <U>receive_mails</U> auf BIGINT(20) gesetzt.";
351                 break;
352
353         case "0.2.6": // SQL queries for v0.2.6
354                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','sub_points','{!POINTS!} abziehen','Allen oder einem Mitglied {!POINTS!} abziehen.', 8)";
355
356                 // Update notes (these will be set as task text!)
357                 $UPDATE_NOTES = "Abzug von {!POINTS!} nun m&ouml;glich.";
358                 break;
359
360         case "0.2.7": // SQL queries for v0.2.7
361                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','themes','Designs', 6,'Y','N')";
362                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD curr_theme VARCHAR(255) NOT NULL DEFAULT 'default'";
363                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD stats_limit BIGINT(20) UNSIGNED NOT NULL DEFAULT 10";
364                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET `what`='config_stats' WHERE `what`='stats' LIMIT 1";
365
366                 // Update notes (these will be set as task text!)
367                 $UPDATE_NOTES = "<OL>
368 <LI>Das Mitglied kann das derzeitige Design in sein Profil abspeichern.</LI>
369 <LI>Mitgliederstatistik mit Seitennavigation.</LI>
370 </OL>";
371                 break;
372
373         case "0.2.8": // SQL queries for v0.2.8
374                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD last_login VARCHAR(10) NOT NULL DEFAULT 0";
375
376                 // Update notes (these will be set as task text!)
377                 $UPDATE_NOTES = "Letzter Login wird gespeichert, Cache wird bei installierter Cache-Erweiterung bei Sprachen&auml;nderung aufgefrischt.";
378                 break;
379
380         case "0.2.9": // SQL queries for v0.2.9
381                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_word VARCHAR(255) NOT NULL DEFAULT 'Mailtausch'";
382                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_word2 VARCHAR(255) NOT NULL DEFAULT 'Mailtausches'";
383                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_word3 VARCHAR(255) NOT NULL DEFAULT 'Mailtauscher'";
384
385                 // Update notes (these will be set as task text!)
386                 $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
387                 break;
388
389         case "0.3.0": // SQL queries for v0.3.0
390                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='{!POINTS!}/Referal-Ebenen' WHERE `what`='config_points' LIMIT 1";
391                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='Mailverg&uuml;tungen...' WHERE `what`='payments' LIMIT 1";
392
393                 // Update notes (these will be set as task text!)
394                 $UPDATE_NOTES = "Zwei Men&uuml;punkte umbenannt.";
395                 break;
396
397         case "0.3.1": // SQL queries for v0.3.1
398                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD UNIQUE KEY (ext_name)";
399                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes ADD UNIQUE KEY (theme_path)";
400                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes ADD INDEX (theme_active)";
401                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins ADD UNIQUE KEY (login)";
402                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (status)";
403                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refbanner ADD INDEX (visible)";
404                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refdepths ADD UNIQUE KEY (level)";
405                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refsystem ADD INDEX (level)";
406                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool ADD INDEX (data_type)";
407                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg ADD UNIQUE KEY (module)";
408                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu ADD INDEX (action)";
409                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu ADD INDEX (what)";
410                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (task_type)";
411                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (status)";
412                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (task_created)";
413                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD FULLTEXT (subject)";
414                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (subject)";
415                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD INDEX (ext_active)";
416                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (status)";
417                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD FULLTEXT (family)";
418                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (max_mails)";
419                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (password)";
420                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (action)";
421                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (what)";
422                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (sort)";
423                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (visible)";
424                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (locked)";
425                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (what)";
426                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (sort)";
427                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (visible)";
428                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (locked)";
429                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats ADD INDEX (visible)";
430                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats ADD INDEX (sort)";
431
432                 // Update notes (these will be set as task text!)
433                 $UPDATE_NOTES = "Eindeutige Schl&uuml;ssel (UNIQUE KEY) und normale Schl&uuml;ssel (INDEX) gesetzt.";
434                 break;
435
436         case "0.3.2": // SQL queries for v0.3.2
437                 // Connection table between the menu system and the "logical area" system
438                 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las";
439                 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_las (
440 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
441 la_id VARCHAR(255) NOT NULL DEFAULT '',
442 la_action VARCHAR(255) NOT NULL DEFAULT '',
443 la_what VARCHAR(255) NOT NULL DEFAULT '',
444 INDEX (la_id),
445 INDEX (la_action),
446 INDEX (la_what),
447 PRIMARY KEY(id)
448 ) TYPE=MyISAM";
449                 // All "logical areas" together
450                 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las_data";
451                 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_las_data (
452 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
453 la_id VARCHAR(255) NOT NULL DEFAULT '',
454 la_title VARCHAR(255) NOT NULL DEFAULT '',
455 la_posx BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
456 la_posy BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
457 UNIQUE KEY (la_id),
458 INDEX (la_posx),
459 INDEX (la_posy),
460 PRIMARY KEY(id)
461 ) TYPE=MyISAM";
462                 // Which menu do you like?
463                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD admin_menu ENUM('NEW','OLD') NOT NULL DEFAULT 'OLD'";
464
465                 // Insert menus
466                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_admin','Adminmen&uuml;','Diverse Einstellungen am Adminmen&uuml; vornehmen.', 9)";
467
468                 // Update notes (these will be set as task text!)
469                 $UPDATE_NOTES = "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.";
470                 break;
471
472         case "0.3.3": // SQL queries for v0.3.3
473                 // Switch of the "intelligent menu sorter" when you want to have a fixed menu structure...
474                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD admin_menu_sorter ENUM('Y','N') NOT NULL DEFAULT 'Y'";
475
476                 // The statistics table
477                 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_stats";
478                 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_stats (
479 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
480 aid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
481 type ENUM('la','action','what') NOT NULL DEFAULT 'what',
482 clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
483 INDEX (aid),
484 PRIMARY KEY (id)
485 ) TYPE=MyISAM";
486
487                 // Update notes (these will be set as task text!)
488                 $UPDATE_NOTES = "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.";
489                 break;
490
491         case "0.3.4": // SQL queries for v0.3.4
492                 // Update notes (these will be set as task text!)
493                 $UPDATE_NOTES = "Veraltetes Update (what=list_user&amp;mode=noref)";
494                 break;
495
496         case "0.3.5": // SQL queries for v0.3.5
497                 // List accounts with no referal
498                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('stats',NULL,'Statistiken',4,'Y','N')";
499                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('stats','stats2','Framekiller-Mails',2,'Y','N')";
500                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('extras',NULL,'Extras',5,'Y','N')";
501                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('rals',NULL,'Rallyes',6,'Y','N')";
502                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('account',NULL,'Ihr Account',7,'Y','N')";
503                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET sort='8' WHERE action='themes' LIMIT 1";
504                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='stats', sort='1', title='Klick-Mails' WHERE `what`='stats' LIMIT 1";
505                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='account', sort='1', title='Designs' WHERE `what`='themes' LIMIT 1";
506                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='extras', sort='3' WHERE `what`='reflinks' LIMIT 1";
507
508                 // Update notes (these will be set as task text!)
509                 $UPDATE_NOTES = "Mitgliedsmen&uuml; komplett umgebaut.";
510                 break;
511
512         case "0.3.6": // SQL queries for v0.3.6
513                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD salt_length TINYINT(3) UNSIGNED NOT NULL DEFAULT '9'";
514                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD pass_scramble VARCHAR(255) NOT NULL DEFAULT ''";
515                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data MODIFY password VARCHAR(255) NOT NULL DEFAULT ''";
516                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data MODIFY user_hash VARCHAR(255) NOT NULL DEFAULT ''";
517                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins MODIFY password VARCHAR(255) NOT NULL DEFAULT ''";
518                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD rand_no BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
519                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD file_hash VARCHAR(255) NOT NULL DEFAULT ''";
520                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD master_salt VARCHAR(255) NOT NULL DEFAULT ''";
521                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_config SET rand_no=(ROUND(RAND() * 99999) + 100000) WHERE config=0 LIMIT 1";
522                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg ADD has_menu ENUM('Y','N') NOT NULL DEFAULT 'N'";
523                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET has_menu='Y' WHERE module='admin' OR module='index' OR module='login' LIMIT 3";
524
525                 // Update notes (these will be set as task text!)
526                 $UPDATE_NOTES = "Passwort-System mit Zufallshash erweitert (Schutzt gegen Dictionary-Attacks!)";
527                 break;
528
529         case "0.3.7": // SQL queries for v0.3.7
530                 $UPDATE_NOTES = "Problem w&auml;hrend des Installationsvorganges behoben.";
531                 break;
532
533         case "0.3.8": // SQL queries for v0.3.8
534                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu CHANGE descr descr MEDIUMTEXT NULL";
535                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool CHANGE `text` `text` LONGTEXT NOT NULL";
536
537                 // Update notes (these will be set as task text!)
538                 $UPDATE_NOTES = "Beschreibungstexte f&uuml;r Admin-Men&uuml;s k&ouml;nnen l&auml;nger sein. Diverse Fixes.";
539                 break;
540
541         case "0.3.9": // SQL queries for v0.3.9
542                 $SQLs[] = "UPDATE  "._MYSQL_PREFIX."_admin_menu SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
543                 $SQLs[] = "UPDATE  "._MYSQL_PREFIX."_admin_menu SET descr = REPLACE(descr, '--POINTS--','!POINTS!') WHERE descr LIKE '%--POINTS--%'";
544                 $SQLs[] = "UPDATE  "._MYSQL_PREFIX."_guest_menu SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
545                 $SQLs[] = "UPDATE  "._MYSQL_PREFIX."_member_menu SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
546
547                 // Update notes (these will be set as task text!)
548                 $UPDATE_NOTES = "Beschreibungstexte f&uuml;r Admin-Men&uuml;s k&ouml;nnen l&auml;nger sein. Diverse Fixes.";
549                 break;
550
551         case "0.4.0": // SQL queries for v0.4.0
552                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Email-Management' WHERE action = 'email' AND (`what`='' OR what IS NULL) LIMIT 1";
553
554                 // Update notes (these will be set as task text!)
555                 $UPDATE_NOTES = "Email-Verwaltung nach Email-Management umbenannt.";
556                 break;
557
558         case "0.4.1": // SQL queries for v0.4.1
559                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` DROP INDEX `status` , ADD INDEX `status` ( `status` , `max_mails` )";
560                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `show_timings` ENUM ('Y','N') NOT NULL DEFAULT 'Y'";
561
562                 // Update notes (these will be set as task text!)
563                 $UPDATE_NOTES = "Tabellen-Schl&uuml;ssel neu gesetzt und Parsing-Zeit im Footer eingeblendet.";
564                 break;
565
566         case "0.4.2": // SQL queries for v0.4.2
567                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_online` ADD INDEX `admin_member` (`is_admin`,`is_member`)";
568
569                 // Update notes (these will be set as task text!)
570                 $UPDATE_NOTES = "Neuen Schl&uuml;ssel zur Online-Tabelle hinzugef&uuml;gt.";
571                 break;
572
573         case "0.4.3": // SQL queries for v0.4.3
574                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_host` VARCHAR(255) NOT NULL DEFAULT ''";
575                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_port` INT(5) UNSIGNED NOT NULL DEFAULT 0";
576                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_username` VARCHAR(255) NOT NULL DEFAULT ''";
577                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_password` VARCHAR(255) NOT NULL DEFAULT ''";
578                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_proxy','Proxy-Einstellungen','Sollte Ihr Webserver sich hinter einem Proxy befinden, so k&ouml;nnen Sie hier MXChange so konfigurieren, dass es Updates durch diesen hindurch sucht!', 15)";
579
580                 // Update notes (these will be set as task text!)
581                 $UPDATE_NOTES = "Proxy-Einstellungen hinzugef&uuml;gt.";
582                 break;
583
584         case "0.4.4": // SQL queries for v0.4.4
585                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
586                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
587                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
588                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET `what`=NULL WHERE `what`=''";
589                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET `what`=NULL WHERE `what`=''";
590                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET `what`=NULL WHERE `what`=''";
591                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
592                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
593                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` ADD INDEX `action` (`action`)";
594                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
595
596                 // Update notes (these will be set as task text!)
597                 $UPDATE_NOTES = "Schl&uuml;ssel in Admin-, Gast- und Mitgliedsmen&uuml; verbessert.";
598                 break;
599
600         case "0.4.5": // SQL queries for v0.4.5
601                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD last_month CHAR(2) NOT NULL DEFAULT '00'";
602                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD last_week CHAR(2) NOT NULL DEFAULT '00'";
603
604                 // Update notes (these will be set as task text!)
605                 $UPDATE_NOTES = "T&auml;glichen/w&ouml;chentlichen/monatlichen Reset verbessert.";
606                 break;
607
608         case "0.4.6": // SQL queries for v0.4.6
609                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD gender ENUM ('M','F') NOT NULL DEFAULT 'M'";
610                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_data SET gender=sex WHERE sex != 'M'";
611                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP sex";
612
613                 // Update notes (these will be set as task text!)
614                 $UPDATE_NOTES = "Offensives Wort &quot;Sex&quot; gegen &quot;Gender&quot; ausgetauscht.";
615                 break;
616
617         case "0.4.7": // SQL queries for v0.4.7
618                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD login_failtures BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
619                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD last_failture TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'";
620
621                 // Update notes (these will be set as task text!)
622                 $UPDATE_NOTES = "Fehlgeschlagene Login-Versuche werden nun mitgez&auml;hlt und der letzte vermerkt.";
623                 break;
624
625         case "0.4.8": // SQL queries for v0.4.8
626                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (subject)";
627
628                 // Update notes (these will be set as task text!)
629                 $UPDATE_NOTES = "Index f&uuml;r Betreff eingef&uuml;gt.";
630                 break;
631
632         case "0.4.9": // SQL queries for v0.4.9
633                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE `user_hash` `user_hash` VARCHAR(255) NULL DEFAULT NULL";
634                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_data SET user_hash=NULL WHERE user_hash IS NOT NULL AND status='CONFIRMED'";
635                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD UNIQUE (`user_hash`)";
636
637                 // Update notes (these will be set as task text!)
638                 $UPDATE_NOTES = "User-Hash zum Best&auml;tigen wird auf NULL gesetzt, wenn Account best&auml;tigt wird.";
639                 break;
640
641         case "0.5.0": // SQL queries for v0.5.0
642                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `level`";
643                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `userid`, ADD UNIQUE `userid_level` (`userid`,`level`)";
644
645                 // Update notes (these will be set as task text!)
646                 $UPDATE_NOTES = "Referal-System unterst&uuml;tzt nun detailierte Referal-&Uuml;bersicht und vieles mehr.";
647                 break;
648
649         case "0.5.1": // SQL queries for v0.5.1
650                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP `descr`";
651
652                 // Update notes (these will be set as task text!)
653                 $UPDATE_NOTES = "Beschreibungsspalte von Mitgliedsmen&uuml; entfernt, welche ohnehin nicht genutzt wird.";
654                 break;
655
656         case "0.5.2": // SQL queries for v0.5.2
657                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refdepths` CHANGE `percents` `percents` FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000";
658
659                 // Update notes (these will be set as task text!)
660                 $UPDATE_NOTES = "Prozents&aum;tze k&ouml;nnen nun f&uuml;nf Stelle hinter dem Komma sein.";
661                 break;
662
663         case "0.5.3": // SQL queries for v0.5.3
664                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD session_save_path VARCHAR(255) NOT NULL DEFAULT ''";
665                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_session','Session-Einstellungen','&Auml;ndern Sie hier den Speicherpfad f&uuml;r Sessiondateien (Sitzungsdateien) ab, falls die Standart-Einstellung bei Ihrem Hoster zu Problem f&uuml;hren sollte.', 16)";
666
667                 // Update notes (these will be set as task text!)
668                 $UPDATE_NOTES = "Session-Speicherpfad konfigurierbar. Beispielsweise ist dies bei all-inkl.com n&ouml;tig.";
669                 break;
670
671         case "0.5.4": // SQL queries for v0.5.4
672                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','reflist','Ref-&Uuml;bersicht',5,'Y','N')";
673
674                 // Depends on refback extension
675                 $EXT_UPDATE_DEPENDS = "refback";
676
677                 // Update notes (these will be set as task text!)
678                 $UPDATE_NOTES = "Ref-&Uuml;bersicht eingebaut. Diese h&auml;ngt von der Erweiterung <strong>refback</strong> ab.";
679                 break;
680
681         case "0.5.5": // SQL queries for v0.5.5
682                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD show_points_unconfirmed ENUM('Y','N') NOT NULL DEFAULT 'Y'";
683
684                 // Update notes (these will be set as task text!)
685                 $UPDATE_NOTES = "Anzeige der {!POINTS!} unter den unbest&auml;tigten Mails kann nun optional abgeschaltet werden.";
686                 break;
687
688         case "0.5.6": // SQL queries for v0.5.6
689                 $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_stats_data`";
690                 $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_user_stats_data` (
691 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
692 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
693 `stats_type` VARCHAR(255) NOT NULL DEFAULT 'unknown',
694 `stats_data` VARCHAR(255) NOT NULL DEFAULT '',
695 `inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
696 PRIMARY KEY(`id`),
697 INDEX (`userid`),
698 INDEX (`stats_type`)
699 ) TYPE=MyISAM COMMENT='Member statistics data'";
700
701                 // Update notes (these will be set as task text!)
702                 $UPDATE_NOTES = "Mitglieder k&ouml;nnnen nun z.B. in den Mail-Details zu jeder Mail sehen, wann sie diese best&auml;tigt haben. Die neue Statistik-Tabelle ist aber universell einsetzbar.";
703                 break;
704
705         case "0.5.7": // SQL queries for v0.5.7
706                 $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='list_norefs' LIMIT 1";
707
708                 // Update notes (these will be set as task text!)
709                 $UPDATE_NOTES = "Auflistung der Mitglieder ohne Werber nach what=list_user&amp;mode=norefs verschoben.";
710                 break;
711         }
712         break;
713
714 default: // Do stuff when extension is loaded
715         // When the sql_patches is not installed we cannot load it's configuration... *sigh*
716         if (GET_EXT_VERSION("sql_patches") != '') {
717                 // Init key
718                 $_CONFIG['secret_key'] = "";
719
720                 // Read key from secret file
721                 if ((empty($_CONFIG['file_hash'])) || (empty($_CONFIG['master_salt'])) || (empty($_CONFIG['pass_scramble']))) {
722                         // Maybe need setup of secret key!
723                         require_once(PATH."inc/gen_sql_patches.php");
724
725                         if ((GET_EXT_VERSION("cache") >= "0.1.2") && (is_object($cacheInstance))) {
726                                 // Remove extensions and mod_reg cache file
727                                 require_once(PATH."inc/libs/cache_functions.php");
728                                 require_once(PATH."inc/extensions/ext-cache.php");
729                                 if ($cacheInstance->loadCacheFile("extensions", true)) $cacheInstance->destroyCacheFile();
730                                 if ($cacheInstance->loadCacheFile("mod_reg"))          $cacheInstance->destroyCacheFile();
731                         } // END - if
732                 } // END - if
733
734                 // Test again
735                 if ((!empty($_CONFIG['file_hash'])) && (!empty($_CONFIG['master_salt'])) && (!empty($_CONFIG['pass_scramble']))) {
736                         // File hash fas generated so we can also file the secret file... hopefully.
737                         $hashFile = sprintf("%sinc/.secret/.%s", PATH, $_CONFIG['file_hash']);
738                         if (FILE_READABLE($hashFile)) {
739                                 // Read file
740                                 $_CONFIG['secret_key'] = implode("", file($hashFile));
741                         } else {
742                                 // Remove it from database
743                                 UPDATE_CONFIG("file_hash", "");
744
745                                 // Cannot read secret file!
746                                 mxchange_die("Cannot read secret file! Please try to reload");
747                         }
748                 } // END - if
749
750                 // Transfer words/numbers to constants
751                 define('POINTS'  , $_CONFIG['points_word']);
752                 define('MT_WORD' , $_CONFIG['mt_word']);
753                 define('MT_WORD2', $_CONFIG['mt_word2']);
754                 define('MT_WORD3', $_CONFIG['mt_word3']);
755                 define('_MAX'    , $_CONFIG['rand_no']);
756         } else {
757                 // Set some lame ( ;-) ) default settings
758                 $_CONFIG['def_refid'] = 0;
759                 $_CONFIG['enable_title_deco'] = "N";
760                 $_CONFIG['title_mod_show']    = "Y";
761                 $_CONFIG['title_middle']      = "-";
762                 //$_CONFIG['verbose_sql']       = "N";
763                 define('MT_WORD' , DEFAULT_MT_WORD );
764                 define('MT_WORD2', DEFAULT_MT_WORD2);
765                 define('MT_WORD3', DEFAULT_MT_WORD3);
766                 define('POINTS'  , DEFAULT_POINTS);
767         }
768         break;
769 }
770
771 // Keep this extension always active!
772 $EXT_ALWAYS_ACTIVE = "Y";
773
774 //
775 ?>