2 /************************************************************************
3 * MXChange v0.2.1 Start: 08/21/2004 *
4 * ================ Last change: 12/04/2004 *
6 * -------------------------------------------------------------------- *
7 * File : ext-sql_patches.php *
8 * -------------------------------------------------------------------- *
9 * Short description : SQL fixes for pro versions *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Ausgelagertes "Profildaten aendern" *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
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. *
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. *
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, *
32 ************************************************************************/
34 // Some security stuff...
35 if (!defined('__SECURITY')) {
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
41 $EXT_VERSION = "0.5.3";
43 // Auto-set extension version
44 if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION;
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");
49 switch ($EXT_LOAD_MODE)
51 case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
52 // SQL commands to run
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 what='theme_import' OR
61 what='config_extensions' OR
63 what='list_unconfirmed' OR
64 what='config_refid' OR
65 what='config_title' OR
67 what='config_admin' OR
68 what='config_proxy' OR
69 what='config_session' OR
72 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_themes";
73 $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE action='themes' LIMIT 1";
74 $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE
78 (action='stats' AND (what='' OR what IS NULL)) OR
79 (action='extras' AND (what='' OR what IS NULL)) OR
80 (action='rals' AND (what='' OR what IS NULL)) OR
81 (action='account' AND (what='' OR what IS NULL))";
82 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='main' WHERE
87 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las";
88 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las_data";
89 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_stats";
92 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP UNIQUE KEY (ext_name)";
93 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins DROP UNIQUE KEY (login)";
94 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (status)";
95 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refbanner DROP INDEX (visible)";
96 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refdepths DROP UNIQUE KEY (level)";
97 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refsystem DROP INDEX (level)";
98 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool DROP INDEX (data_type)";
99 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg DROP UNIQUE KEY (module)";
100 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu DROP INDEX (action)";
101 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu DROP INDEX (what)";
102 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (task_type)";
103 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (status)";
104 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (task_created)";
105 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP FULLTEXT (subject)";
106 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (subject)";
107 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP INDEX (ext_active)";
108 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (status)";
109 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP FULLTEXT (family)";
110 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (max_mails)";
111 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (password)";
112 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (action)";
113 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (what)";
114 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (sort)";
115 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (visible)";
116 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (locked)";
117 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (what)";
118 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (sort)";
119 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (visible)";
120 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (locked)";
121 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats DROP INDEX (visible)";
122 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats DROP INDEX (sort)";
125 case "activate": // Do stuff when admin activates this extension
126 // SQL commands to run
130 case "deactivate": // Do stuff when admin deactivates this extension
131 // SQL commands to run
135 case "update": // Update an extension
138 case "0.0.1": // SQL queries for v0.0.1
139 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ext_autopurge ENUM('Y','N') NOT NULL DEFAULT 'Y'";
140 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_extensions','Erweitungsmanagement','Alle Einstellungen am Erweiterungsmanagement.', 10)";
142 // Update notes (these will be set as task text!)
143 $UPDATE_NOTES = "Es kann nun bestimmt werden, ob vom Server gelöschte ext-xxx.php erkannt werden sollen und die verknüpften Daten auch aus der Datenbank entfernt werden sollen.";
146 case "0.0.2": // SQL queries for v0.0.2
147 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config CHANGE auto_purge auto_purge BIGINT(20) UNSIGNED NOT NULL DEFAULT '1209600'";
149 // Update notes (these will be set as task text!)
150 $UPDATE_NOTES = "In der Tabelle <STRONG>"._MYSQL_PREFIX."_config</STRONG> musste die Spalte <STRONG>auto_purge</STRONG> (autom. Löschen von Bestätigungsmails angepasst werden (war auf dem Testsystem auf tiny(4) gesetzt.)";
153 case "0.0.3": // SQL queries for v0.0.3
154 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD points_word VARCHAR(255) NOT NULL DEFAULT 'Punkte'";
156 // Update notes (these will be set as task text!)
157 $UPDATE_NOTES = "Das Wort "Punkte" kann nun per Datenbank geändert werden. Damit können Sie anstelle des Wortes Punkte auch Klammlose oder € schreiben.";
160 case "0.0.4": // SQL queries for v0.0.4
161 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mails_page BIGINT(20) UNSIGNED NOT NULL DEFAULT '10'";
163 // Update notes (these will be set as task text!)
164 $UPDATE_NOTES = "Anzahl Mails pro Seite in <STRONG>EMail-Details ansehen</STRONG> und <STRONG>EMail-Archiv</STRONG> hinzugefügt.";
167 case "0.0.5": // SQL queries for v0.0.5
168 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_home VARCHAR(255) NOT NULL DEFAULT 'welcome'";
169 $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üpunkt (what-welcome ist Standart) als Einstiegspunkt in das Menüsystem genutzt werden soll.', 5)";
171 // Update notes (these will be set as task text!)
172 $UPDATE_NOTES = "Die what-welcome.php ist derzeit die "Home"-Seite (Eingangsseite). Dies kann nun per Datenbank geändert werden.";
175 case "0.0.6": // SQL queries for v0.0.6
176 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD ext_has_css ENUM('Y','N') NOT NULL DEFAULT 'N'";
178 // Update notes (these will be set as task text!)
179 $UPDATE_NOTES = "Es können nun SQL-Updates von einander abhängig gemacht werden und die CSS-Datei kann per Admin-Bereich (wegen Debuggings) ein- bzw. ausgeschaltet werden.";
182 case "0.0.7": // SQL queries for v0.0.7
183 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD verbose_sql ENUM('Y','N') NOT NULL DEFAULT 'Y'";
185 // Update notes (these will be set as task text!)
186 $UPDATE_NOTES = "Die SQL-Anweisungen werden bei eingeschalteter Verbose-Funktion detailiert angezeigt.";
189 case "0.0.8": // SQL queries for v0.0.8
190 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD menu_blur_spacer VARCHAR(255) NOT NULL DEFAULT ' <STRONG><BIG>·</BIG></STRONG> '";
192 // Update notes (these will be set as task text!)
193 $UPDATE_NOTES = "Nette Mouse-Hover-Effekte eingebaut (Anleitung <STRONG>MENUE_HOVER.txt</STRONG> zum Patchen der general.css bitte lesen!)";
196 case "0.0.9": // SQL queries for v0.0.9
197 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','list_unconfirmed','Unbest. Mails auflisten','Schauen Sie sich hier unbestätigte Maillinks an. Bitte diesen Link nur über dem EMail-Archiv oder EMail-Details aufrufen, direkt aufgerufen bekommen Sie eine Fehlermeldung.', 8)";
199 // Update notes (these will be set as task text!)
200 $UPDATE_NOTES = "Unbestätigte Maillinks können unter Email-Management -> Unbest. Mails auflisten aufgelistet werden.";
203 case "0.1.0": // SQL queries for v0.2.1
204 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD reg_points_mode ENUM('ref','direct') NOT NULL DEFAULT 'ref'";
206 // Update notes (these will be set as task text!)
207 $UPDATE_NOTES = "Soll der einmalige Ref-Bonus über das Referral-System (also alle oberen Refs bekommen auch etwas davon ab) oder direkt dem Werber aufgebucht werden?";
210 case "0.1.1": // SQL queries for v0.1.1
211 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Menüpunkt (what-welcome ist Standart) als Einstiegspunkt in das Menüsystem genutzt werden soll und wie die automatische Weiterleitung in der Eingangsseite funktionieren soll.' WHERE what='config_home' LIMIT 1";
212 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_delay TINYINT(3) UNSIGNED NOT NULL DEFAULT '-1'";
213 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT '31536000'";
215 // Update notes (these will be set as task text!)
216 $UPDATE_NOTES = "Sie können nun <A href=\"".URL."/modules.php?module=admin&what=config_home\">hier</A> die Verzögerungszeit in der <A href=\"".URL."/index.php\">Eingangsseite</A> einstellen.";
219 case "0.1.2": // SQL queries for v0.1.2
220 $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)";
221 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD def_refid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
223 // Update notes (these will be set as task text!)
224 $UPDATE_NOTES = "Standart Referral-ID kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)";
227 case "0.1.3": // SQL queries for v0.1.3
228 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD refid_target ENUM('register','index') NOT NULL DEFAULT 'register'";
230 // Update notes (these will be set as task text!)
231 $UPDATE_NOTES = "Auf welche Seite soll der Ref-Link zeigen? Eingangsseite oder Anmeldeformular?";
234 case "0.1.4": // SQL queries for v0.1.4
235 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD default_theme VARCHAR(255) NOT NULL DEFAULT '".GET_CURR_THEME()."'";
236 $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='theme' LIMIT 3";
237 $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)";
238 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_import','Importieren','Es wird das Verzeichnis "theme" nach neuen Ordnern durchsucht und anschliessend in die Datenbank gesperrt aufgenommen.', 1)";
239 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_edit','Modifizieren','Ändern Sie Titel, Freigaben usw. an den Themes. Sie können bis auf das Standart-Theme "default" auch Themes aus der Datenbank entfernen. Vorher sollten Sie es jedoch vom Server löschen, damit es niht erneut importiert werden kann.', 2)";
240 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',4,'Y','N')";
241 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',3,'Y','N')";
242 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_themes";
243 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_themes (
244 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
245 theme_path VARCHAR(255) NOT NULL DEFAULT '',
246 theme_active ENUM('Y','N') NOT NULL DEFAULT 'N',
247 theme_ver VARCHAR(255) NOT NULL DEFAULT '0.0',
251 // Update notes (these will be set as task text!)
252 $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!";
255 case "0.1.5": // SQL queries for v0.1.5
256 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP ext_has_admin";
258 // Update notes (these will be set as task text!)
259 $UPDATE_NOTES = "Spalte <U>ext_has_admin</U> aus der Tabelle <U>"._MYSQL_PREFIX."_extensions</U> entfernt, da sie keinen Sinn mehr macht.";
262 case "0.1.6": // SQL queries for v0.1.6
263 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD enable_title_deco ENUM('Y','N') NOT NULL DEFAULT 'Y'";
264 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD title_left VARCHAR(10) NOT NULL DEFAULT '[--'";
265 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD title_middle VARCHAR(10) NOT NULL DEFAULT '-'";
266 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD title_right VARCHAR(10) NOT NULL DEFAULT '--]'";
267 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD enable_mod_title ENUM('Y','N') NOT NULL DEFAULT 'Y'";
268 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD enable_what_title ENUM('Y','N') NOT NULL DEFAULT 'Y'";
269 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_title','Seitentitel ändern','De-/aktivieren Sie hier die Dekorationen, sowie Modul-Titel und what-Titel im Seitentitel.', 8)";
271 // Update notes (these will be set as task text!)
272 $UPDATE_NOTES = "Dekorationen des Seitentiteles lassen sich ein- und ausschalten und selber definieren; Modul-Titel und Titel der <STRONG>what</STRONG>-Dateien kann hinzugefügt werden.";
275 case "0.1.7": // SQL queries for v0.1.7
276 // Update notes (these will be set as task text!)
277 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
280 case "0.1.8": // SQL queries for v0.1.8
281 // Update notes (these will be set as task text!)
282 $UPDATE_NOTES = "mad_count und last_mad werden nun aus der Datenbank geladen";
285 case "0.1.9": // SQL queries for v0.1.9
286 // Update notes (these will be set as task text!)
287 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
290 case "0.2.0": // SQL queries for v0.2.0
291 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_jackpot CHANGE points points DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
293 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payments CHANGE payment payment DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
294 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payments CHANGE price price DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
296 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE used_points used_points DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
297 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_points CHANGE points points DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
298 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_points CHANGE locked_points locked_points DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
300 // Update notes (these will be set as task text!)
301 $UPDATE_NOTES = "5 Nachkommastellen implementiert";
304 case "0.2.1": // SQL queries for v0.2.1
305 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD css_php ENUM('DIRECT','FILE') NOT NULL DEFAULT 'FILE'";
307 // Update notes (these will be set as task text!)
308 $UPDATE_NOTES = "Ausgabe der CSS-Dateien entweder per css.php oder sie sind direkt eingebunden.";
311 case "0.2.2": // SQL queries for v0.2.2
312 // Update notes (these will be set as task text!)
313 $UPDATE_NOTES = "Erweiterung bleibt wegen integrierten Schalters immer aktiv.";
316 case "0.2.3": // SQL queries for v0.2.3
317 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD guest_menu ENUM('Y','N') NOT NULL DEFAULT 'Y'";
318 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD member_menu ENUM('Y','N') NOT NULL DEFAULT 'Y'";
319 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD youre_here ENUM('Y','N') NOT NULL DEFAULT 'Y'";
321 // Update notes (these will be set as task text!)
322 $UPDATE_NOTES = "Gast- und Mitgliedsmenüs lassen sich getrennt voneinander abschalten.";
325 case "0.2.4": // SQL queries for v0.2.4
326 $auto_type = "png"; // PNG image is the default
327 if ((FILE_READABLE(PATH."theme/".GET_CURR_THEME()."/images/code_bg.jpg")) && function_exists('imagecreatefromjpeg')) {
328 // Switch to JPEG format
331 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD img_type ENUM('jpg','png') NOT NULL DEFAULT '".$auto_type."'";
333 // Update notes (these will be set as task text!)
334 $UPDATE_NOTES = "Generierung des Mailbestätigungscodes hängt davon ab, ob die PHP-Funktion <U>imagecreatefromjpeg()</U> und das JPEG-Bild vorhanden sind oder nicht.";
337 case "0.2.5": // SQL queries for v0.2.5
338 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE receive_mails receive_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
339 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE max_mails max_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
341 // Update notes (these will be set as task text!)
342 $UPDATE_NOTES = "Spalten <U>max_mails</U> und <U>receive_mails</U> auf BIGINT(20) gesetzt.";
345 case "0.2.6": // SQL queries for v0.2.6
346 $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)";
348 // Update notes (these will be set as task text!)
349 $UPDATE_NOTES = "Abzug von {!POINTS!} nun möglich.";
352 case "0.2.7": // SQL queries for v0.2.7
353 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action,what,title,sort) VALUES ('main','themes','Designs', 6)";
354 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD curr_theme VARCHAR(255) NOT NULL DEFAULT 'default'";
355 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD stats_limit BIGINT(20) UNSIGNED NOT NULL DEFAULT '10'";
356 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='config_stats' WHERE what='stats' LIMIT 1";
358 // Update notes (these will be set as task text!)
359 $UPDATE_NOTES = "<OL>
360 <LI>Das Mitglied kann das derzeitige Design in sein Profil abspeichern.</LI>
361 <LI>Mitgliederstatistik mit Seitennavigation.</LI>
365 case "0.2.8": // SQL queries for v0.2.8
366 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD last_login VARCHAR(10) NOT NULL DEFAULT '0'";
368 // Update notes (these will be set as task text!)
369 $UPDATE_NOTES = "Letzter Login wird gespeichert, Cache wird bei installierter Cache-Erweiterung bei Sprachenänderung aufgefrischt.";
372 case "0.2.9": // SQL queries for v0.2.9
373 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_word VARCHAR(255) NOT NULL DEFAULT 'Mailtausch'";
374 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_word2 VARCHAR(255) NOT NULL DEFAULT 'Mailtausches'";
375 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_word3 VARCHAR(255) NOT NULL DEFAULT 'Mailtauscher'";
377 // Update notes (these will be set as task text!)
378 $UPDATE_NOTES = "Wörter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
381 case "0.3.0": // SQL queries for v0.3.0
382 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='{!POINTS!}/Referral-Ebenen' WHERE what='config_points' LIMIT 1";
383 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='Mailvergütungen...' WHERE what='payments' LIMIT 1";
385 // Update notes (these will be set as task text!)
386 $UPDATE_NOTES = "Zwei Menüpunkte umbenannt.";
389 case "0.3.1": // SQL queries for v0.3.1
390 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD UNIQUE KEY (ext_name)";
391 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes ADD UNIQUE KEY (theme_path)";
392 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes ADD INDEX (theme_active)";
393 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins ADD UNIQUE KEY (login)";
394 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (status)";
395 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refbanner ADD INDEX (visible)";
396 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refdepths ADD UNIQUE KEY (level)";
397 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refsystem ADD INDEX (level)";
398 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool ADD INDEX (data_type)";
399 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg ADD UNIQUE KEY (module)";
400 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu ADD INDEX (action)";
401 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu ADD INDEX (what)";
402 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (task_type)";
403 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (status)";
404 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (task_created)";
405 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD FULLTEXT (subject)";
406 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (subject)";
407 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD INDEX (ext_active)";
408 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (status)";
409 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD FULLTEXT (family)";
410 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (max_mails)";
411 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (password)";
412 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (action)";
413 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (what)";
414 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (sort)";
415 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (visible)";
416 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (locked)";
417 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (what)";
418 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (sort)";
419 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (visible)";
420 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (locked)";
421 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats ADD INDEX (visible)";
422 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats ADD INDEX (sort)";
424 // Update notes (these will be set as task text!)
425 $UPDATE_NOTES = "Eindeutige Schlüssel (UNIQUE KEY) und normale Schlüssel (INDEX) gesetzt.";
428 case "0.3.2": // SQL queries for v0.3.2
429 // Connection table between the menu system and the "logical area" system
430 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las";
431 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_las (
432 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
433 la_id VARCHAR(255) NOT NULL DEFAULT '',
434 la_action VARCHAR(255) NOT NULL DEFAULT '',
435 la_what VARCHAR(255) NOT NULL DEFAULT '',
441 // All "logical areas" together
442 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las_data";
443 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_las_data (
444 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
445 la_id VARCHAR(255) NOT NULL DEFAULT '',
446 la_title VARCHAR(255) NOT NULL DEFAULT '',
447 la_posx BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
448 la_posy BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
454 // Which menu do you like?
455 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD admin_menu ENUM('NEW','OLD') NOT NULL DEFAULT 'OLD'";
458 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_admin','Adminmenü','Diverse Einstellungen am Adminmenü vornehmen.', 9)";
460 // Update notes (these will be set as task text!)
461 $UPDATE_NOTES = "Logische Bereiche (Logical Areas = LAs) eingeführt. Dadurch wird das immer stärker anwachsende Admin-Menü in grosse Hauptgruppen unterteilt, wodurch ein Auffinden von Menüpunkten verbessert wird.";
464 case "0.3.3": // SQL queries for v0.3.3
465 // Switch of the "intelligent menu sorter" when you want to have a fixed menu structure...
466 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD admin_menu_sorter ENUM('Y','N') NOT NULL DEFAULT 'Y'";
468 // The statistics table
469 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_stats";
470 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_stats (
471 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
472 aid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
473 type ENUM('la','action','what') NOT NULL DEFAULT 'what',
474 clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
479 // Update notes (these will be set as task text!)
480 $UPDATE_NOTES = "Admin-abhängig werden nun Klicks im Admin-Menü gezählt, die zur automatischen Anpassung des Menüs in den logischen Bereichen diennen. Dieses "intelligente Unbauen" können Sie auch ganz abschalten.";
483 case "0.3.4": // SQL queries for v0.3.4
484 // List accounts with no referral
485 $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)";
487 // Update notes (these will be set as task text!)
488 $UPDATE_NOTES = "Fügt den Menüpunkt "Mitglieder ohne Werber" in die Mitglieder-Management hinzu. Mit dieser neuen Funktion können Sie nach Mitglieder-Accounts ohne Werber suchen. TODO-ID #2 CLOSED";
491 case "0.3.5": // SQL queries for v0.3.5
492 // List accounts with no referral
493 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('stats',NULL,'Statistiken',4,'Y','N')";
494 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('stats','stats2','Framekiller-Mails',2,'Y','N')";
495 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('extras',NULL,'Extras',5,'Y','N')";
496 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('rals',NULL,'Rallyes',6,'Y','N')";
497 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('account',NULL,'Ihr Account',7,'Y','N')";
498 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET sort='8' WHERE action='themes' LIMIT 1";
499 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='stats', sort='1', title='Klick-Mails' WHERE what='stats' LIMIT 1";
500 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='account', sort='1', title='Designs' WHERE what='themes' LIMIT 1";
501 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='extras', sort='3' WHERE what='reflinks' LIMIT 1";
503 // Update notes (these will be set as task text!)
504 $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut.";
507 case "0.3.6": // SQL queries for v0.3.6
508 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD salt_length TINYINT(3) UNSIGNED NOT NULL DEFAULT '9'";
509 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD pass_scramble VARCHAR(255) NOT NULL DEFAULT ''";
510 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data MODIFY password VARCHAR(255) NOT NULL DEFAULT ''";
511 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data MODIFY user_hash VARCHAR(255) NOT NULL DEFAULT ''";
512 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins MODIFY password VARCHAR(255) NOT NULL DEFAULT ''";
513 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD rand_no BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
514 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD file_hash VARCHAR(255) NOT NULL DEFAULT ''";
515 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD master_salt VARCHAR(255) NOT NULL DEFAULT ''";
516 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_config SET rand_no=(ROUND(RAND() * 99999) + 100000) WHERE config=0 LIMIT 1";
517 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg ADD has_menu ENUM('Y','N') NOT NULL DEFAULT 'N'";
518 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET has_menu='Y' WHERE module='admin' OR module='index' OR module='login' LIMIT 3";
520 // Update notes (these will be set as task text!)
521 $UPDATE_NOTES = "Passwort-System mit Zufallshash erweitert (Schutzt gegen Dictionary-Attacks!)";
524 case "0.3.7": // SQL queries for v0.3.7
525 $UPDATE_NOTES = "Problem während des Installationsvorganges behoben.";
528 case "0.3.8": // SQL queries for v0.3.8
529 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu CHANGE descr descr MEDIUMTEXT NULL";
530 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool CHANGE `text` `text` LONGTEXT NOT NULL";
532 // Update notes (these will be set as task text!)
533 $UPDATE_NOTES = "Beschreibungstexte für Admin-Menüs können länger sein. Diverse Fixes.";
536 case "0.3.9": // SQL queries for v0.3.9
537 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
538 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET descr = REPLACE(descr, '--POINTS--','!POINTS!') WHERE descr LIKE '%--POINTS--%'";
539 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
540 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
542 // Update notes (these will be set as task text!)
543 $UPDATE_NOTES = "Beschreibungstexte für Admin-Menüs können länger sein. Diverse Fixes.";
546 case "0.4.0": // SQL queries for v0.4.0
547 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Email-Management' WHERE action = 'email' AND (what='' OR what IS NULL) LIMIT 1";
549 // Update notes (these will be set as task text!)
550 $UPDATE_NOTES = "Email-Verwaltung nach Email-Management umbenannt.";
553 case "0.4.1": // SQL queries for v0.4.1
554 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` DROP INDEX `status` , ADD INDEX `status` ( `status` , `max_mails` )";
555 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `show_timings` ENUM ('Y','N') NOT NULL DEFAULT 'Y'";
557 // Update notes (these will be set as task text!)
558 $UPDATE_NOTES = "Tabellen-Schlüssel neu gesetzt und Parsing-Zeit im Footer eingeblendet.";
561 case "0.4.2": // SQL queries for v0.4.2
562 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_online` ADD INDEX `admin_member` (`is_admin`,`is_member`)";
564 // Update notes (these will be set as task text!)
565 $UPDATE_NOTES = "Neuen Schlüssel zur Online-Tabelle hinzugefügt.";
568 case "0.4.3": // SQL queries for v0.4.3
569 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_host` VARCHAR(255) NOT NULL DEFAULT ''";
570 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_port` INT(5) UNSIGNED NOT NULL DEFAULT '0'";
571 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_username` VARCHAR(255) NOT NULL DEFAULT ''";
572 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_password` VARCHAR(255) NOT NULL DEFAULT ''";
573 $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önnen Sie hier MXChange so konfigurieren, dass es Updates durch diesen hindurch sucht!', 15)";
575 // Update notes (these will be set as task text!)
576 $UPDATE_NOTES = "Proxy-Einstellungen hinzugefügt.";
579 case "0.4.4": // SQL queries for v0.4.4
580 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
581 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
582 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
583 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what=NULL WHERE what=''";
584 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET what=NULL WHERE what=''";
585 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET what=NULL WHERE what=''";
586 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
587 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
588 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` ADD INDEX `action` (`action`)";
589 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
591 // Update notes (these will be set as task text!)
592 $UPDATE_NOTES = "Schlüssel in Admin-, Gast- und Mitgliedsmenü verbessert.";
595 case "0.4.5": // SQL queries for v0.4.5
596 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD last_month CHAR(2) NOT NULL DEFAULT '00'";
597 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD last_week CHAR(2) NOT NULL DEFAULT '00'";
599 // Update notes (these will be set as task text!)
600 $UPDATE_NOTES = "Täglichen/wöchentlichen/monatlichen Reset verbessert.";
603 case "0.4.6": // SQL queries for v0.4.6
604 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD gender ENUM ('M','F') NOT NULL DEFAULT 'M'";
605 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_data SET gender=sex WHERE sex != 'M'";
606 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP sex";
608 // Update notes (these will be set as task text!)
609 $UPDATE_NOTES = "Offensives Wort "Sex" gegen "Gender" ausgetauscht.";
612 case "0.4.7": // SQL queries for v0.4.7
613 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD login_failtures BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
614 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD last_failture TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'";
616 // Update notes (these will be set as task text!)
617 $UPDATE_NOTES = "Fehlgeschlagene Login-Versuche werden nun mitgezählt und der letzte vermerkt.";
620 case "0.4.8": // SQL queries for v0.4.8
621 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (subject)";
623 // Update notes (these will be set as task text!)
624 $UPDATE_NOTES = "Index für Betreff eingefügt.";
627 case "0.4.9": // SQL queries for v0.4.9
628 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE `user_hash` `user_hash` VARCHAR(255) NULL DEFAULT NULL";
629 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_data SET user_hash=NULL WHERE user_hash IS NOT NULL AND status='CONFIRMED'";
630 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD UNIQUE (`user_hash`)";
632 // Update notes (these will be set as task text!)
633 $UPDATE_NOTES = "User-Hash zum Bestätigen wird auf NULL gesetzt, wenn Account bestätigt wird.";
636 case "0.5.0": // SQL queries for v0.5.0
637 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `level`";
638 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `userid`, ADD UNIQUE `userid_level` (`userid`,`level`)";
640 // Update notes (these will be set as task text!)
641 $UPDATE_NOTES = "Referal-System unterstützt nun detailierte Referal-Übersicht und vieles mehr.";
644 case "0.5.1": // SQL queries for v0.5.1
645 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP `descr`";
647 // Update notes (these will be set as task text!)
648 $UPDATE_NOTES = "Beschreibungsspalte von Mitgliedsmenü entfernt, welche ohnehin nicht genutzt wird.";
651 case "0.5.2": // SQL queries for v0.5.2
652 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refdepths` CHANGE `percents` `percents` FLOAT(8,5) NOT NULL DEFAULT '0.00000'";
654 // Update notes (these will be set as task text!)
655 $UPDATE_NOTES = "Prozents&aum;tze können nun fünf Stelle hinter dem Komma sein.";
658 case "0.5.3": // SQL queries for v0.5.3
659 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD session_save_path varchar(255) NOT NULL DEFAULT ''";
660 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_session','Session-Einstellungen','Ändern Sie hier den Speicherpfad für Sessiondateien (Sitzungsdateien) ab, falls die Standart-Einstellung bei Ihrem Hoster zu Problem führen sollte.', 16)";
662 // Update notes (these will be set as task text!)
663 $UPDATE_NOTES = "Session-Speicherpfad konfigurierbar. Beispielsweise ist dies bei all-inkl.com nötig.";
668 default: // Do stuff when extension is loaded
669 // When the sql_patches is not installed we cannot load it's configuration... *sigh*
670 if (GET_EXT_VERSION("sql_patches") != '') {
672 $_CONFIG['secret_key'] = "";
674 // Read key from secret file
675 if ((empty($_CONFIG['file_hash'])) || (empty($_CONFIG['master_salt'])) || (empty($_CONFIG['pass_scramble']))) {
676 // Maybe need setup of secret key!
677 require_once(PATH."inc/gen_sql_patches.php");
679 if ((GET_EXT_VERSION("cache") >= "0.1.2") && (is_object($cacheInstance))) {
680 // Remove extensions and mod_reg cache file
681 require_once(PATH."inc/libs/cache_functions.php");
682 require_once(PATH."inc/extensions/ext-cache.php");
683 if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
684 if ($cacheInstance->cache_file("mod_reg", true)) $cacheInstance->cache_destroy();
689 if ((!empty($_CONFIG['file_hash'])) && (!empty($_CONFIG['master_salt'])) && (!empty($_CONFIG['pass_scramble']))) {
690 // File hash fas generated so we can also file the secret file... hopefully.
691 $hashFile = sprintf("%sinc/.secret/.%s", PATH, $_CONFIG['file_hash']);
692 if (FILE_READABLE($hashFile)) {
694 $_CONFIG['secret_key'] = implode("", file($hashFile));
696 // Remove it from database
697 UPDATE_CONFIG("file_hash", "");
699 // Cannot read secret file!
700 mxchange_die("Cannot read secret file! Please try to reload");
704 // Transfer words/numbers to constants
705 define('POINTS' , $_CONFIG['points_word']);
706 define('MT_WORD' , $_CONFIG['mt_word']);
707 define('MT_WORD2', $_CONFIG['mt_word2']);
708 define('MT_WORD3', $_CONFIG['mt_word3']);
709 define('_MAX' , $_CONFIG['rand_no']);
711 // Set some lame ;-) default settings
712 $_CONFIG['def_refid'] = 0;
713 $_CONFIG['enable_title_deco'] = "N";
714 $_CONFIG['title_mod_show'] = "Y";
715 $_CONFIG['title_middle'] = "-";
716 //$_CONFIG['verbose_sql'] = "N";
717 define('MT_WORD' , DEFAULT_MT_WORD );
718 define('MT_WORD2', DEFAULT_MT_WORD2);
719 define('MT_WORD3', DEFAULT_MT_WORD3);
720 define('POINTS' , DEFAULT_POINTS);
725 // Language file prefix (hmmm, what shall I write with SQL fixes? ;-) )
726 $EXT_LANG_PREFIX = "sql_patches";
728 // Extension is always active?
729 $EXT_ALWAYS_ACTIVE = "Y";