Refback extension in alpha phase finished, users can give refback to all refs in...
[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.2";
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");
48
49 switch ($EXT_LOAD_MODE)
50 {
51 case "register": // Do stuff when installtion 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         // SQL commands to run
58         $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE
59 (action='theme' AND (what='theme_import' OR what='theme_edit')) OR
60 what='config_extensions' OR
61 what='config_home' OR
62 what='list_unconfirmed' OR
63 what='config_refid' OR
64 what='config_title' OR
65 what='sub_points' OR
66 what='config_admin' OR
67 what='config_proxy' OR
68 what='list_norefs'
69 LIMIT 13";
70         $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_themes";
71         $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE action='themes' LIMIT 1";
72         $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE
73 action='themes' OR
74 what='themes' OR
75 what='stats2' OR
76 (action='stats' AND (what='' OR what IS NULL)) OR
77 (action='extras' AND (what='' OR what IS NULL)) OR
78 (action='rals' AND (what='' OR what IS NULL)) OR
79 (action='account' AND (what='' OR what IS NULL))
80 LIMIT 8";
81         $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='main' WHERE
82 action='stats' OR
83 action='extras' OR
84 action='rals' OR
85 action='account'";
86         $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las";
87         $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las_data";
88         $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_stats";
89
90         // Drop indexes
91         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP UNIQUE KEY (ext_name)";
92         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins DROP UNIQUE KEY (login)";
93         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (status)";
94         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refbanner DROP INDEX (visible)";
95         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refdepths DROP UNIQUE KEY (level)";
96         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refsystem DROP INDEX (level)";
97         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool DROP INDEX (data_type)";
98         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg DROP UNIQUE KEY (module)";
99         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu DROP INDEX (action)";
100         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu DROP INDEX (what)";
101         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (task_type)";
102         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (status)";
103         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (task_created)";
104         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP FULLTEXT (subject)";
105         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (subject)";
106         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP INDEX (ext_active)";
107         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (status)";
108         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP FULLTEXT (family)";
109         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (max_mails)";
110         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (password)";
111         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (action)";
112         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (what)";
113         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (sort)";
114         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (visible)";
115         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (locked)";
116         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (what)";
117         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (sort)";
118         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (visible)";
119         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (locked)";
120         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats DROP INDEX (visible)";
121         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats DROP INDEX (sort)";
122         break;
123
124 case "activate": // Do stuff when admin activates this extension
125         // SQL commands to run
126         $SQLs[] = "";
127         break;
128
129 case "deactivate": // Do stuff when admin deactivates this extension
130         // SQL commands to run
131         $SQLs[] = "";
132         break;
133
134 case "update": // Update an extension
135         switch ($EXT_VER)
136         {
137         case "0.0.1": // SQL queries for v0.0.1
138                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ext_autopurge ENUM('Y','N') NOT NULL DEFAULT 'Y'";
139                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_extensions','Erweitungsmanagement','Alle Einstellungen am Erweiterungsmanagement.', 10)";
140
141                 // Update notes (these will be set as task text!)
142                 $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.";
143                 break;
144
145         case "0.0.2": // SQL queries for v0.0.2
146                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config CHANGE auto_purge auto_purge BIGINT(20) UNSIGNED NOT NULL DEFAULT '1209600'";
147
148                 // Update notes (these will be set as task text!)
149                 $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 tiny(4) gesetzt.)";
150                 break;
151
152         case "0.0.3": // SQL queries for v0.0.3
153                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD points_word VARCHAR(255) NOT NULL DEFAULT 'Punkte'";
154
155                 // Update notes (these will be set as task text!)
156                 $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.";
157                 break;
158
159         case "0.0.4": // SQL queries for v0.0.4
160                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mails_page BIGINT(20) UNSIGNED NOT NULL DEFAULT '10'";
161
162                 // Update notes (these will be set as task text!)
163                 $UPDATE_NOTES = "Anzahl Mails pro Seite in <STRONG>EMail-Details ansehen</STRONG> und <STRONG>EMail-Archiv</STRONG> hinzugef&uuml;gt.";
164                 break;
165
166         case "0.0.5": // SQL queries for v0.0.5
167                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_home VARCHAR(255) NOT NULL DEFAULT 'welcome'";
168                 $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)";
169
170                 // Update notes (these will be set as task text!)
171                 $UPDATE_NOTES = "Die what-welcome.php ist derzeit die &quot;Home&quot;-Seite (Eingangsseite). Dies kann nun per Datenbank ge&auml;ndert werden.";
172                 break;
173
174         case "0.0.6": // SQL queries for v0.0.6
175                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD ext_has_css ENUM('Y','N') NOT NULL DEFAULT 'N'";
176
177                 // Update notes (these will be set as task text!)
178                 $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.";
179                 break;
180
181         case "0.0.7": // SQL queries for v0.0.7
182                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD verbose_sql ENUM('Y','N') NOT NULL DEFAULT 'Y'";
183
184                 // Update notes (these will be set as task text!)
185                 $UPDATE_NOTES = "Die SQL-Anweisungen werden bei eingeschalteter Verbose-Funktion detailiert angezeigt.";
186                 break;
187
188         case "0.0.8": // SQL queries for v0.0.8
189                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD menu_blur_spacer VARCHAR(255) NOT NULL DEFAULT '&nbsp;<STRONG><BIG>&middot;</BIG></STRONG>&nbsp;'";
190
191                 // Update notes (these will be set as task text!)
192                 $UPDATE_NOTES = "Nette Mouse-Hover-Effekte eingebaut (Anleitung <STRONG>MENUE_HOVER.txt</STRONG> zum Patchen der general.css bitte lesen!)";
193                 break;
194
195         case "0.0.9": // SQL queries for v0.0.9
196                 $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)";
197
198                 // Update notes (these will be set as task text!)
199                 $UPDATE_NOTES = "Unbest&auml;tigte Maillinks k&ouml;nnen unter Email-Management -&gt; Unbest. Mails auflisten aufgelistet werden.";
200                 break;
201
202         case "0.1.0": // SQL queries for v0.2.1
203                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD reg_points_mode ENUM('ref','direct') NOT NULL DEFAULT 'ref'";
204
205                 // Update notes (these will be set as task text!)
206                 $UPDATE_NOTES = "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?";
207                 break;
208
209         case "0.1.1": // SQL queries for v0.1.1
210                 $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";
211                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_delay TINYINT(3) UNSIGNED NOT NULL DEFAULT '-1'";
212                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT '31536000'";
213
214                 // Update notes (these will be set as task text!)
215                 $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.";
216                 break;
217
218         case "0.1.2": // SQL queries for v0.1.2
219                 $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 Referral-Link Ihren Mailtausch aufgerufen hat.', 7)";
220                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD def_refid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
221
222                 // Update notes (these will be set as task text!)
223                 $UPDATE_NOTES = "Standart Referral-ID kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)";
224                 break;
225
226         case "0.1.3": // SQL queries for v0.1.3
227                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD refid_target ENUM('register','index') NOT NULL DEFAULT 'register'";
228
229                 // Update notes (these will be set as task text!)
230                 $UPDATE_NOTES = "Auf welche Seite soll der Ref-Link zeigen? Eingangsseite oder Anmeldeformular?";
231                 break;
232
233         case "0.1.4": // SQL queries for v0.1.4
234                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD default_theme VARCHAR(255) NOT NULL DEFAULT '".GET_CURR_THEME()."'";
235                 $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='theme' LIMIT 3";
236                 $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)";
237                 $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)";
238                 $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)";
239                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',4,'Y','N')";
240                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',3,'Y','N')";
241                 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_themes";
242                 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_themes (
243 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
244 theme_path VARCHAR(255) NOT NULL DEFAULT '',
245 theme_active ENUM('Y','N') NOT NULL DEFAULT 'N',
246 theme_ver VARCHAR(255) NOT NULL DEFAULT '0.0',
247 PRIMARY KEY(id)
248 ) TYPE=MyISAM";
249
250                 // Update notes (these will be set as task text!)
251                 $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!";
252                 break;
253
254         case "0.1.5": // SQL queries for v0.1.5
255                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP ext_has_admin";
256
257                 // Update notes (these will be set as task text!)
258                 $UPDATE_NOTES = "Spalte <U>ext_has_admin</U> aus der Tabelle <U>"._MYSQL_PREFIX."_extensions</U> entfernt, da sie keinen Sinn mehr macht.";
259                 break;
260
261         case "0.1.6": // SQL queries for v0.1.6
262                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD enable_title_deco ENUM('Y','N') NOT NULL DEFAULT 'Y'";
263                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD title_left VARCHAR(10) NOT NULL DEFAULT '[--'";
264                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD title_middle VARCHAR(10) NOT NULL DEFAULT '-'";
265                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD title_right VARCHAR(10) NOT NULL DEFAULT '--]'";
266                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD enable_mod_title ENUM('Y','N') NOT NULL DEFAULT 'Y'";
267                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD enable_what_title ENUM('Y','N') NOT NULL DEFAULT 'Y'";
268                 $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)";
269
270                 // Update notes (these will be set as task text!)
271                 $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.";
272                 break;
273
274         case "0.1.7": // SQL queries for v0.1.7
275                 // Update notes (these will be set as task text!)
276                 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
277                 break;
278
279         case "0.1.8": // SQL queries for v0.1.8
280                 // Update notes (these will be set as task text!)
281                 $UPDATE_NOTES = "mad_count und last_mad werden nun aus der Datenbank geladen";
282                 break;
283
284         case "0.1.9": // SQL queries for v0.1.9
285                 // Update notes (these will be set as task text!)
286                 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
287                 break;
288
289         case "0.2.0": // SQL queries for v0.2.0
290                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_jackpot CHANGE points points DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
291
292                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payments CHANGE payment payment DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
293                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payments CHANGE price price DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
294
295                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE used_points used_points DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
296                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_points CHANGE points points DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
297                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_points CHANGE locked_points locked_points DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
298
299                 // Update notes (these will be set as task text!)
300                 $UPDATE_NOTES = "5 Nachkommastellen implementiert";
301                 break;
302
303         case "0.2.1": // SQL queries for v0.2.1
304                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD css_php ENUM('DIRECT','FILE') NOT NULL DEFAULT 'FILE'";
305
306                 // Update notes (these will be set as task text!)
307                 $UPDATE_NOTES = "Ausgabe der CSS-Dateien entweder per css.php oder sie sind direkt eingebunden.";
308                 break;
309
310         case "0.2.2": // SQL queries for v0.2.2
311                 // Update notes (these will be set as task text!)
312                 $UPDATE_NOTES = "Erweiterung bleibt wegen integrierten Schalters immer aktiv.";
313                 break;
314
315         case "0.2.3": // SQL queries for v0.2.3
316                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD guest_menu ENUM('Y','N') NOT NULL DEFAULT 'Y'";
317                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD member_menu ENUM('Y','N') NOT NULL DEFAULT 'Y'";
318                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD youre_here ENUM('Y','N') NOT NULL DEFAULT 'Y'";
319
320                 // Update notes (these will be set as task text!)
321                 $UPDATE_NOTES = "Gast- und Mitgliedsmen&uuml;s lassen sich getrennt voneinander abschalten.";
322                 break;
323
324         case "0.2.4": // SQL queries for v0.2.4
325                 $auto_type = "png"; // PNG image is the default
326                 if ((FILE_READABLE(PATH."theme/".GET_CURR_THEME()."/images/code_bg.jpg")) && function_exists('imagecreatefromjpeg')) {
327                         // Switch to JPEG format
328                         $auto_type = "jpg";
329                 }
330                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD img_type ENUM('jpg','png') NOT NULL DEFAULT '".$auto_type."'";
331
332                 // Update notes (these will be set as task text!)
333                 $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.";
334                 break;
335
336         case "0.2.5": // SQL queries for v0.2.5
337                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE receive_mails receive_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
338                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE max_mails max_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
339
340                 // Update notes (these will be set as task text!)
341                 $UPDATE_NOTES = "Spalten <U>max_mails</U> und <U>receive_mails</U> auf BIGINT(20) gesetzt.";
342                 break;
343
344         case "0.2.6": // SQL queries for v0.2.6
345                 $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)";
346
347                 // Update notes (these will be set as task text!)
348                 $UPDATE_NOTES = "Abzug von {!POINTS!} nun m&ouml;glich.";
349                 break;
350
351         case "0.2.7": // SQL queries for v0.2.7
352                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action,what,title,sort) VALUES ('main','themes','Designs', 6)";
353                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD curr_theme VARCHAR(255) NOT NULL DEFAULT 'default'";
354                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD stats_limit BIGINT(20) UNSIGNED NOT NULL DEFAULT '10'";
355                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='config_stats' WHERE what='stats' LIMIT 1";
356
357                 // Update notes (these will be set as task text!)
358                 $UPDATE_NOTES = "<OL>
359 <LI>Das Mitglied kann das derzeitige Design in sein Profil abspeichern.</LI>
360 <LI>Mitgliederstatistik mit Seitennavigation.</LI>
361 </OL>";
362                 break;
363
364         case "0.2.8": // SQL queries for v0.2.8
365                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD last_login VARCHAR(10) NOT NULL DEFAULT '0'";
366
367                 // Update notes (these will be set as task text!)
368                 $UPDATE_NOTES = "Letzter Login wird gespeichert, Cache wird bei installierter Cache-Erweiterung bei Sprachen&auml;nderung aufgefrischt.";
369                 break;
370
371         case "0.2.9": // SQL queries for v0.2.9
372                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_word VARCHAR(255) NOT NULL DEFAULT 'Mailtausch'";
373                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_word2 VARCHAR(255) NOT NULL DEFAULT 'Mailtausches'";
374                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_word3 VARCHAR(255) NOT NULL DEFAULT 'Mailtauscher'";
375
376                 // Update notes (these will be set as task text!)
377                 $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
378                 break;
379
380         case "0.3.0": // SQL queries for v0.3.0
381                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='{!POINTS!}/Referral-Ebenen' WHERE what='config_points' LIMIT 1";
382                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='Mailverg&uuml;tungen...' WHERE what='payments' LIMIT 1";
383
384                 // Update notes (these will be set as task text!)
385                 $UPDATE_NOTES = "Zwei Men&uuml;punkte umbenannt.";
386                 break;
387
388         case "0.3.1": // SQL queries for v0.3.1
389                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD UNIQUE KEY (ext_name)";
390                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes ADD UNIQUE KEY (theme_path)";
391                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes ADD INDEX (theme_active)";
392                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins ADD UNIQUE KEY (login)";
393                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (status)";
394                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refbanner ADD INDEX (visible)";
395                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refdepths ADD UNIQUE KEY (level)";
396                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refsystem ADD INDEX (level)";
397                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool ADD INDEX (data_type)";
398                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg ADD UNIQUE KEY (module)";
399                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu ADD INDEX (action)";
400                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu ADD INDEX (what)";
401                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (task_type)";
402                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (status)";
403                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (task_created)";
404                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD FULLTEXT (subject)";
405                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (subject)";
406                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD INDEX (ext_active)";
407                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (status)";
408                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD FULLTEXT (family)";
409                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (max_mails)";
410                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (password)";
411                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (action)";
412                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (what)";
413                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (sort)";
414                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (visible)";
415                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (locked)";
416                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (what)";
417                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (sort)";
418                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (visible)";
419                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (locked)";
420                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats ADD INDEX (visible)";
421                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats ADD INDEX (sort)";
422
423                 // Update notes (these will be set as task text!)
424                 $UPDATE_NOTES = "Eindeutige Schl&uuml;ssel (UNIQUE KEY) und normale Schl&uuml;ssel (INDEX) gesetzt.";
425                 break;
426
427         case "0.3.2": // SQL queries for v0.3.2
428                 // Connection table between the menu system and the "logical area" system
429                 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las";
430                 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_las (
431 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
432 la_id VARCHAR(255) NOT NULL DEFAULT '',
433 la_action VARCHAR(255) NOT NULL DEFAULT '',
434 la_what VARCHAR(255) NOT NULL DEFAULT '',
435 INDEX (la_id),
436 INDEX (la_action),
437 INDEX (la_what),
438 PRIMARY KEY(id)
439 ) TYPE=MyISAM";
440                 // All "logical areas" together
441                 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las_data";
442                 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_las_data (
443 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
444 la_id VARCHAR(255) NOT NULL DEFAULT '',
445 la_title VARCHAR(255) NOT NULL DEFAULT '',
446 la_posx BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
447 la_posy BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
448 UNIQUE KEY (la_id),
449 INDEX (la_posx),
450 INDEX (la_posy),
451 PRIMARY KEY(id)
452 ) TYPE=MyISAM";
453                 // Which menu do you like?
454                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD admin_menu ENUM('NEW','OLD') NOT NULL DEFAULT 'OLD'";
455
456                 // Insert menus
457                 $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)";
458
459                 // Update notes (these will be set as task text!)
460                 $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.";
461                 break;
462
463         case "0.3.3": // SQL queries for v0.3.3
464                 // Switch of the "intelligent menu sorter" when you want to have a fixed menu structure...
465                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD admin_menu_sorter ENUM('Y','N') NOT NULL DEFAULT 'Y'";
466
467                 // The statistics table
468                 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_stats";
469                 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_stats (
470 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
471 aid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
472 type ENUM('la','action','what') NOT NULL DEFAULT 'what',
473 clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
474 INDEX (aid),
475 PRIMARY KEY (id)
476 ) TYPE=MyISAM";
477
478                 // Update notes (these will be set as task text!)
479                 $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.";
480                 break;
481
482         case "0.3.4": // SQL queries for v0.3.4
483                 // List accounts with no referral
484                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_norefs','Mitglieder ohne Werber','Finden Sie hier alle Mitglieder-Accounts, die von niemandem ({--MAIN_TITLE--} wird in der Mail als Werber angegebenen) geworben wurden.', 7)";
485
486                 // Update notes (these will be set as task text!)
487                 $UPDATE_NOTES = "F&uuml;gt den Men&uuml;punkt &quot;Mitglieder ohne Werber&quot; in die Mitglieder-Management hinzu. Mit dieser neuen Funktion k&ouml;nnen Sie nach Mitglieder-Accounts ohne Werber suchen. TODO-ID #2 CLOSED";
488                 break;
489
490         case "0.3.5": // SQL queries for v0.3.5
491                 // List accounts with no referral
492                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('stats',NULL,'Statistiken',4,'Y','N')";
493                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('stats','stats2','Framekiller-Mails',2,'Y','N')";
494                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('extras',NULL,'Extras',5,'Y','N')";
495                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('rals',NULL,'Rallyes',6,'Y','N')";
496                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('account',NULL,'Ihr Account',7,'Y','N')";
497                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET sort='8' WHERE action='themes' LIMIT 1";
498                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='stats', sort='1', title='Klick-Mails' WHERE what='stats' LIMIT 1";
499                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='account', sort='1', title='Designs' WHERE what='themes' LIMIT 1";
500                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='extras', sort='3' WHERE what='reflinks' LIMIT 1";
501
502                 // Update notes (these will be set as task text!)
503                 $UPDATE_NOTES = "Mitgliedsmen&uuml; komplett umgebaut.";
504                 break;
505
506         case "0.3.6": // SQL queries for v0.3.6
507                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD salt_length TINYINT(3) UNSIGNED NOT NULL DEFAULT '9'";
508                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD pass_scramble VARCHAR(255) NOT NULL DEFAULT ''";
509                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data MODIFY password VARCHAR(255) NOT NULL DEFAULT ''";
510                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data MODIFY user_hash VARCHAR(255) NOT NULL DEFAULT ''";
511                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins MODIFY password VARCHAR(255) NOT NULL DEFAULT ''";
512                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD rand_no BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
513                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD file_hash VARCHAR(255) NOT NULL DEFAULT ''";
514                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD master_salt VARCHAR(255) NOT NULL DEFAULT ''";
515                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_config SET rand_no=(ROUND(RAND() * 99999) + 100000) WHERE config=0 LIMIT 1";
516                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg ADD has_menu ENUM('Y','N') NOT NULL DEFAULT 'N'";
517                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET has_menu='Y' WHERE module='admin' OR module='index' OR module='login' LIMIT 3";
518
519                 // Update notes (these will be set as task text!)
520                 $UPDATE_NOTES = "Passwort-System mit Zufallshash erweitert (Schutzt gegen Dictionary-Attacks!)";
521                 break;
522
523         case "0.3.7": // SQL queries for v0.3.7
524                 $UPDATE_NOTES = "Problem w&auml;hrend des Installationsvorganges behoben.";
525                 break;
526
527         case "0.3.8": // SQL queries for v0.3.8
528                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu CHANGE descr descr MEDIUMTEXT NULL";
529                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool CHANGE `text` `text` LONGTEXT NOT NULL";
530
531                 // Update notes (these will be set as task text!)
532                 $UPDATE_NOTES = "Beschreibungstexte f&uuml;r Admin-Men&uuml;s k&ouml;nnen l&auml;nger sein. Diverse Fixes.";
533                 break;
534
535         case "0.3.9": // SQL queries for v0.3.9
536                 $SQLs[] = "UPDATE  "._MYSQL_PREFIX."_admin_menu SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
537                 $SQLs[] = "UPDATE  "._MYSQL_PREFIX."_admin_menu SET descr = REPLACE(descr, '--POINTS--','!POINTS!') WHERE descr LIKE '%--POINTS--%'";
538                 $SQLs[] = "UPDATE  "._MYSQL_PREFIX."_guest_menu SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
539                 $SQLs[] = "UPDATE  "._MYSQL_PREFIX."_member_menu SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
540
541                 // Update notes (these will be set as task text!)
542                 $UPDATE_NOTES = "Beschreibungstexte f&uuml;r Admin-Men&uuml;s k&ouml;nnen l&auml;nger sein. Diverse Fixes.";
543                 break;
544
545         case "0.4.0": // SQL queries for v0.4.0
546                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Email-Management' WHERE action = 'email' AND (what='' OR what IS NULL) LIMIT 1";
547
548                 // Update notes (these will be set as task text!)
549                 $UPDATE_NOTES = "Email-Verwaltung nach Email-Management umbenannt.";
550                 break;
551
552         case "0.4.1": // SQL queries for v0.4.1
553                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` DROP INDEX `status` , ADD INDEX `status` ( `status` , `max_mails` )";
554                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `show_timings` ENUM ('Y','N') NOT NULL DEFAULT 'Y'";
555
556                 // Update notes (these will be set as task text!)
557                 $UPDATE_NOTES = "Tabellen-Schl&uuml;ssel neu gesetzt und Parsing-Zeit im Footer eingeblendet.";
558                 break;
559
560         case "0.4.2": // SQL queries for v0.4.2
561                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_online` ADD INDEX `admin_member` (`is_admin`,`is_member`)";
562
563                 // Update notes (these will be set as task text!)
564                 $UPDATE_NOTES = "Neuen Schl&uuml;ssel zur Online-Tabelle hinzugef&uuml;gt.";
565                 break;
566
567         case "0.4.3": // SQL queries for v0.4.3
568                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_host` VARCHAR(255) NOT NULL DEFAULT ''";
569                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_port` INT(5) UNSIGNED NOT NULL DEFAULT '0'";
570                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_username` VARCHAR(255) NOT NULL DEFAULT ''";
571                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_password` VARCHAR(255) NOT NULL DEFAULT ''";
572                 $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)";
573
574                 // Update notes (these will be set as task text!)
575                 $UPDATE_NOTES = "Proxy-Einstellungen hinzugef&uuml;gt.";
576                 break;
577
578         case "0.4.4": // SQL queries for v0.4.4
579                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
580                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
581                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
582                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what=NULL WHERE what=''";
583                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET what=NULL WHERE what=''";
584                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET what=NULL WHERE what=''";
585                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
586                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
587                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` ADD INDEX `action` (`action`)";
588                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
589
590                 // Update notes (these will be set as task text!)
591                 $UPDATE_NOTES = "Schl&uuml;ssel in Admin-, Gast- und Mitgliedsmen&uuml; verbessert.";
592                 break;
593
594         case "0.4.5": // SQL queries for v0.4.5
595                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD last_month CHAR(2) NOT NULL DEFAULT '00'";
596                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD last_week CHAR(2) NOT NULL DEFAULT '00'";
597
598                 // Update notes (these will be set as task text!)
599                 $UPDATE_NOTES = "T&auml;glichen/w&ouml;chentlichen/monatlichen Reset verbessert.";
600                 break;
601
602         case "0.4.6": // SQL queries for v0.4.6
603                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD gender ENUM ('M','F') NOT NULL DEFAULT 'M'";
604                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_data SET gender=sex WHERE sex != 'M'";
605                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP sex";
606
607                 // Update notes (these will be set as task text!)
608                 $UPDATE_NOTES = "Offensives Wort &quot;Sex&quot; gegen &quot;Gender&quot; ausgetauscht.";
609                 break;
610
611         case "0.4.7": // SQL queries for v0.4.7
612                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD login_failtures BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
613                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD last_failture TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'";
614
615                 // Update notes (these will be set as task text!)
616                 $UPDATE_NOTES = "Fehlgeschlagene Login-Versuche werden nun mitgez&auml;hlt und der letzte vermerkt.";
617                 break;
618
619         case "0.4.8": // SQL queries for v0.4.8
620                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (subject)";
621
622                 // Update notes (these will be set as task text!)
623                 $UPDATE_NOTES = "Index f&uuml;r Betreff eingef&uuml;gt.";
624                 break;
625
626         case "0.4.9": // SQL queries for v0.4.9
627                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE `user_hash` `user_hash` VARCHAR(255) NULL DEFAULT NULL";
628                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_data SET user_hash=NULL WHERE user_hash IS NOT NULL AND status='CONFIRMED'";
629                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD UNIQUE (`user_hash`)";
630
631                 // Update notes (these will be set as task text!)
632                 $UPDATE_NOTES = "User-Hash zum Best&auml;tigen wird auf NULL gesetzt, wenn Account best&auml;tigt wird.";
633                 break;
634
635         case "0.5.0": // SQL queries for v0.5.0
636                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `level`";
637                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `userid`, ADD UNIQUE `userid_level` (`userid`,`level`)";
638
639                 // Update notes (these will be set as task text!)
640                 $UPDATE_NOTES = "Referal-System unterst&uuml;tzt nun detailierte Referal-&Uuml;bersicht und vieles mehr.";
641                 break;
642
643         case "0.5.1": // SQL queries for v0.5.1
644                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP `descr`";
645
646                 // Update notes (these will be set as task text!)
647                 $UPDATE_NOTES = "Beschreibungsspalte von Mitgliedsmen&uuml; entfernt, welche ohnehin nicht genutzt wird.";
648                 break;
649
650         case "0.5.2": // SQL queries for v0.5.2
651                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refdepths` CHANGE `percents` `percents` FLOAT(8,5) NOT NULL DEFAULT '0.00000'";
652
653                 // Update notes (these will be set as task text!)
654                 $UPDATE_NOTES = "Prozents&aum;tze k&ouml;nnen nun f&uuml;nf Stelle hinter dem Komma sein.";
655                 break;
656         }
657         break;
658
659 default: // Do stuff when extension is loaded
660         // When the sql_patches is not installed we cannot load it's configuration... *sigh*
661         if (GET_EXT_VERSION("sql_patches") != '') {
662                 // Init key
663                 $_CONFIG['secret_key'] = "";
664
665                 // Read key from secret file
666                 if ((empty($_CONFIG['file_hash'])) || (empty($_CONFIG['master_salt'])) || (empty($_CONFIG['pass_scramble']))) {
667                         // Maybe need setup of secret key!
668                         require_once(PATH."inc/gen_sql_patches.php");
669
670                         if ((GET_EXT_VERSION("cache") >= "0.1.2") && (is_object($cacheInstance))) {
671                                 // Remove extensions and mod_reg cache file
672                                 require_once(PATH."inc/libs/cache_functions.php");
673                                 require_once(PATH."inc/extensions/ext-cache.php");
674                                 if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
675                                 if ($cacheInstance->cache_file("mod_reg", true)) $cacheInstance->cache_destroy();
676                         } // END - if
677                 } // END - if
678
679                 // Test again
680                 if ((!empty($_CONFIG['file_hash'])) && (!empty($_CONFIG['master_salt'])) && (!empty($_CONFIG['pass_scramble']))) {
681                         // File hash fas generated so we can also file the secret file... hopefully.
682                         $hashFile = sprintf("%sinc/.secret/.%s", PATH, $_CONFIG['file_hash']);
683                         if (FILE_READABLE($hashFile)) {
684                                 // Read file
685                                 $_CONFIG['secret_key'] = implode("", file($hashFile));
686                         } else {
687                                 // Remove it from database
688                                 UPDATE_CONFIG("file_hash", "");
689
690                                 // Cannot read secret file!
691                                 mxchange_die("Cannot read secret file! Please try to reload");
692                         }
693                 } // END - if
694
695                 // Transfer words/numbers to constants
696                 define('POINTS'  , $_CONFIG['points_word']);
697                 define('MT_WORD' , $_CONFIG['mt_word']);
698                 define('MT_WORD2', $_CONFIG['mt_word2']);
699                 define('MT_WORD3', $_CONFIG['mt_word3']);
700                 define('_MAX'    , $_CONFIG['rand_no']);
701         } else {
702                 // Set some lame ;-) default settings
703                 $_CONFIG['def_refid'] = 0;
704                 $_CONFIG['enable_title_deco'] = "N";
705                 $_CONFIG['title_mod_show']    = "Y";
706                 $_CONFIG['title_middle']      = "-";
707                 //$_CONFIG['verbose_sql']       = "N";
708                 define('MT_WORD' , DEFAULT_MT_WORD );
709                 define('MT_WORD2', DEFAULT_MT_WORD2);
710                 define('POINTS'  , DEFAULT_POINTS);
711         }
712         break;
713 }
714
715 // Language file prefix (hmmm, what shall I write with SQL fixes? ;-) )
716 $EXT_LANG_PREFIX = "sql_patches";
717
718 // Extension is always active?
719 $EXT_ALWAYS_ACTIVE = "Y";
720
721 //
722 ?>