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.9";
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", "0.5.4", "0.5.5", "0.5.6", "0.5.7", "0.5.8", "0.5.9");
49 switch ($EXT_LOAD_MODE)
51 case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
52 // SQL commands to run
56 case "remove": // Do stuff when removing extension
58 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las";
59 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las_data";
60 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_stats";
61 $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_stats_data`";
62 $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_book`";
63 $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_filters`";
65 // Delete admin menu entries
66 $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE
67 `what`='config_extensions' OR
68 `what`='config_home' OR
69 `what`='list_unconfirmed' OR
70 `what`='config_refid' OR
71 `what`='config_title' OR
72 `what`='sub_points' OR
73 `what`='config_admin' OR
74 `what`='config_proxy' OR
75 `what`='config_session' OR
79 // Delete/update member menu entries
80 $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_member_menu` WHERE
83 (action='stats' AND (`what`='' OR what IS NULL)) OR
84 (action='extras' AND (`what`='' OR what IS NULL)) OR
85 (action='rals' AND (`what`='' OR what IS NULL)) OR
86 (action='account' AND (`what`='' OR what IS NULL))";
87 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET action='main' WHERE
94 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP UNIQUE KEY `ext_name`";
95 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins DROP UNIQUE KEY `login`";
96 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` DROP INDEX `status`";
97 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refbanner DROP INDEX `visible`";
98 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refdepths DROP UNIQUE KEY `level`";
99 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refsystem DROP INDEX `level`";
100 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool DROP INDEX `data_type`";
101 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg DROP UNIQUE KEY `module`";
102 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` DROP INDEX `action`";
103 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` DROP INDEX `what`";
104 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX `task_type`";
105 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX `status`";
106 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX `task_created`";
107 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP FULLTEXT `subject`";
108 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX `subject`";
109 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP INDEX `ext_active`";
110 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` DROP INDEX `status`";
111 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` DROP FULLTEXT `family`";
112 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` DROP INDEX `max_mails`";
113 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` DROP INDEX `password`";
114 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` DROP INDEX `action`";
115 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` DROP INDEX `what`";
116 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` DROP INDEX `sort`";
117 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` DROP INDEX `visible`";
118 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` DROP INDEX `locked`";
119 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` DROP INDEX `what`";
120 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` DROP INDEX `sort`";
121 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` DROP INDEX `visible`";
122 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` DROP INDEX `locked`";
123 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats DROP INDEX `visible`";
124 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats DROP INDEX `sort`";
127 case "activate": // Do stuff when admin activates this extension
128 // SQL commands to run
132 case "deactivate": // Do stuff when admin deactivates this extension
133 // SQL commands to run
137 case "update": // Update an extension
140 case "0.0.1": // SQL queries for v0.0.1
141 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD ext_autopurge ENUM('Y','N') NOT NULL DEFAULT 'Y'";
142 $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_extensions','Erweitungsmanagement','Alle Einstellungen am Erweiterungsmanagement.', 10)";
144 // Update notes (these will be set as task text!)
145 $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.";
148 case "0.0.2": // SQL queries for v0.0.2
149 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` CHANGE auto_purge auto_purge BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*14)."";
151 // Update notes (these will be set as task text!)
152 $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 TINYINT(4) gesetzt.)";
155 case "0.0.3": // SQL queries for v0.0.3
156 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD points_word VARCHAR(255) NOT NULL DEFAULT 'Punkte'";
158 // Update notes (these will be set as task text!)
159 $UPDATE_NOTES = "Das Wort "Punkte" kann nun per Datenbank geändert werden. Damit können Sie anstelle des Wortes Punkte auch Klammlose oder € schreiben.";
162 case "0.0.4": // SQL queries for v0.0.4
163 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD mails_page BIGINT(20) UNSIGNED NOT NULL DEFAULT 10";
165 // Update notes (these will be set as task text!)
166 $UPDATE_NOTES = "Anzahl Mails pro Seite in <STRONG>EMail-Details ansehen</STRONG> und <STRONG>EMail-Archiv</STRONG> hinzugefügt.";
169 case "0.0.5": // SQL queries for v0.0.5
170 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD index_home VARCHAR(255) NOT NULL DEFAULT 'welcome'";
171 $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)";
173 // Update notes (these will be set as task text!)
174 $UPDATE_NOTES = "Die what-welcome.php ist derzeit die "Home"-Seite (Eingangsseite). Dies kann nun per Datenbank geändert werden.";
177 case "0.0.6": // SQL queries for v0.0.6
178 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD ext_has_css ENUM('Y','N') NOT NULL DEFAULT 'N'";
180 // Update notes (these will be set as task text!)
181 $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.";
184 case "0.0.7": // SQL queries for v0.0.7
185 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD verbose_sql ENUM('Y','N') NOT NULL DEFAULT 'Y'";
187 // Update notes (these will be set as task text!)
188 $UPDATE_NOTES = "Die SQL-Anweisungen werden bei eingeschalteter Verbose-Funktion detailiert angezeigt.";
191 case "0.0.8": // SQL queries for v0.0.8
192 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD menu_blur_spacer VARCHAR(255) NOT NULL DEFAULT ' <STRONG><BIG>·</BIG></STRONG> '";
194 // Update notes (these will be set as task text!)
195 $UPDATE_NOTES = "Nette Mouse-Hover-Effekte eingebaut (Anleitung <STRONG>MENUE_HOVER.txt</STRONG> zum Patchen der general.css bitte lesen!)";
198 case "0.0.9": // SQL queries for v0.0.9
199 $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)";
201 // Update notes (these will be set as task text!)
202 $UPDATE_NOTES = "Unbestätigte Maillinks können unter Email-Management -> Unbest. Mails auflisten aufgelistet werden.";
205 case "0.1.0": // SQL queries for v0.2.1
206 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD reg_points_mode ENUM('ref','direct') NOT NULL DEFAULT 'ref'";
208 // Update notes (these will be set as task text!)
209 $UPDATE_NOTES = "Soll der einmalige Ref-Bonus über das Referal-System (also alle oberen Refs bekommen auch etwas davon ab) oder direkt dem Werber aufgebucht werden?";
212 case "0.1.1": // SQL queries for v0.1.1
213 $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";
214 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD index_delay TINYINT(3) UNSIGNED NOT NULL DEFAULT '-1'";
215 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*365)."";
217 // Update notes (these will be set as task text!)
218 $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.";
221 case "0.1.2": // SQL queries for v0.1.2
222 $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)";
223 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD def_refid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
225 // Update notes (these will be set as task text!)
226 $UPDATE_NOTES = "Standart Referal-ID kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)";
229 case "0.1.3": // SQL queries for v0.1.3
230 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD refid_target ENUM('register','index') NOT NULL DEFAULT 'register'";
232 // Update notes (these will be set as task text!)
233 $UPDATE_NOTES = "Auf welche Seite soll der Ref-Link zeigen? Eingangsseite oder Anmeldeformular?";
236 case "0.1.4": // SQL queries for v0.1.4
237 // Update notes (these will be set as task text!)
238 $UPDATE_NOTES = "Ungültiges Update (nach ext-theme.php verschoben!).";
241 case "0.1.5": // SQL queries for v0.1.5
242 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP ext_has_admin";
244 // Update notes (these will be set as task text!)
245 $UPDATE_NOTES = "Spalte <U>ext_has_admin</U> aus der Tabelle <U>"._MYSQL_PREFIX."_extensions</U> entfernt, da sie keinen Sinn mehr macht.";
248 case "0.1.6": // SQL queries for v0.1.6
249 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD enable_title_deco ENUM('Y','N') NOT NULL DEFAULT 'Y'";
250 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD title_left VARCHAR(10) NOT NULL DEFAULT '[--'";
251 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD title_middle VARCHAR(10) NOT NULL DEFAULT '-'";
252 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD title_right VARCHAR(10) NOT NULL DEFAULT '--]'";
253 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD enable_mod_title ENUM('Y','N') NOT NULL DEFAULT 'Y'";
254 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD enable_what_title ENUM('Y','N') NOT NULL DEFAULT 'Y'";
255 $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)";
257 // Update notes (these will be set as task text!)
258 $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.";
261 case "0.1.7": // SQL queries for v0.1.7
262 // Update notes (these will be set as task text!)
263 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
266 case "0.1.8": // SQL queries for v0.1.8
267 // Update notes (these will be set as task text!)
268 $UPDATE_NOTES = "mad_count und last_mad werden nun aus der Datenbank geladen";
271 case "0.1.9": // SQL queries for v0.1.9
272 // Update notes (these will be set as task text!)
273 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
276 case "0.2.0": // SQL queries for v0.2.0
277 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_jackpot CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
279 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payments CHANGE payment payment FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
280 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payments CHANGE price price FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
282 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` CHANGE used_points used_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
283 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_points CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
284 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_points CHANGE locked_points locked_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
286 // Update notes (these will be set as task text!)
287 $UPDATE_NOTES = "5 Nachkommastellen implementiert";
290 case "0.2.1": // SQL queries for v0.2.1
291 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD css_php ENUM('DIRECT','FILE') NOT NULL DEFAULT 'FILE'";
293 // Update notes (these will be set as task text!)
294 $UPDATE_NOTES = "Ausgabe der CSS-Dateien entweder per css.php oder sie sind direkt eingebunden.";
297 case "0.2.2": // SQL queries for v0.2.2
298 // Update notes (these will be set as task text!)
299 $UPDATE_NOTES = "Erweiterung bleibt wegen integrierten Schalters immer aktiv.";
302 case "0.2.3": // SQL queries for v0.2.3
303 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD guest_menu ENUM('Y','N') NOT NULL DEFAULT 'Y'";
304 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD member_menu ENUM('Y','N') NOT NULL DEFAULT 'Y'";
305 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD youre_here ENUM('Y','N') NOT NULL DEFAULT 'Y'";
307 // Update notes (these will be set as task text!)
308 $UPDATE_NOTES = "Gast- und Mitgliedsmenüs lassen sich getrennt voneinander abschalten.";
311 case "0.2.4": // SQL queries for v0.2.4
312 $auto_type = "png"; // PNG image is the default
313 if ((FILE_READABLE(PATH."theme/".GET_CURR_THEME()."/images/code_bg.jpg")) && function_exists('imagecreatefromjpeg')) {
314 // Switch to JPEG format
317 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD img_type ENUM('jpg','png') NOT NULL DEFAULT '".$auto_type."'";
319 // Update notes (these will be set as task text!)
320 $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.";
323 case "0.2.5": // SQL queries for v0.2.5
324 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` CHANGE receive_mails receive_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
325 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` CHANGE max_mails max_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
327 // Update notes (these will be set as task text!)
328 $UPDATE_NOTES = "Spalten <U>max_mails</U> und <U>receive_mails</U> auf BIGINT(20) gesetzt.";
331 case "0.2.6": // SQL queries for v0.2.6
332 $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)";
334 // Update notes (these will be set as task text!)
335 $UPDATE_NOTES = "Abzug von {!POINTS!} nun möglich.";
338 case "0.2.7": // SQL queries for v0.2.7
339 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD stats_limit BIGINT(20) UNSIGNED NOT NULL DEFAULT 10";
340 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_admin_menu` SET `what`='config_stats' WHERE `what`='stats' LIMIT 1";
342 // Update notes (these will be set as task text!)
343 $UPDATE_NOTES = "<OL>
344 <LI>Das Mitglied kann das derzeitige Design in sein Profil abspeichern.</LI>
345 <LI>Mitgliederstatistik mit Seitennavigation.</LI>
349 case "0.2.8": // SQL queries for v0.2.8
350 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD last_login VARCHAR(10) NOT NULL DEFAULT 0";
352 // Update notes (these will be set as task text!)
353 $UPDATE_NOTES = "Letzter Login wird gespeichert, Cache wird bei installierter Cache-Erweiterung bei Sprachenänderung aufgefrischt.";
356 case "0.2.9": // SQL queries for v0.2.9
357 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD mt_word VARCHAR(255) NOT NULL DEFAULT 'Mailtausch'";
358 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD mt_word2 VARCHAR(255) NOT NULL DEFAULT 'Mailtausches'";
359 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD mt_word3 VARCHAR(255) NOT NULL DEFAULT 'Mailtauscher'";
361 // Update notes (these will be set as task text!)
362 $UPDATE_NOTES = "Wörter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
365 case "0.3.0": // SQL queries for v0.3.0
366 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_admin_menu` SET title='{!POINTS!}/Referal-Ebenen' WHERE `what`='config_points' LIMIT 1";
367 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_admin_menu` SET title='Mailvergütungen...' WHERE `what`='payments' LIMIT 1";
369 // Update notes (these will be set as task text!)
370 $UPDATE_NOTES = "Zwei Menüpunkte umbenannt.";
373 case "0.3.1": // SQL queries for v0.3.1
374 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD UNIQUE KEY (ext_name)";
375 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins ADD UNIQUE KEY (login)";
376 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD INDEX (status)";
377 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refbanner ADD INDEX (visible)";
378 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refdepths ADD UNIQUE KEY (level)";
379 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refsystem ADD INDEX (level)";
380 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool ADD INDEX (data_type)";
381 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg ADD UNIQUE KEY (module)";
382 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` ADD INDEX (action)";
383 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` ADD INDEX (what)";
384 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (task_type)";
385 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (status)";
386 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (task_created)";
387 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD FULLTEXT (subject)";
388 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (subject)";
389 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD INDEX (ext_active)";
390 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD INDEX (status)";
391 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD FULLTEXT (family)";
392 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD INDEX (max_mails)";
393 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD INDEX (password)";
394 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` ADD INDEX (action)";
395 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` ADD INDEX (what)";
396 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` ADD INDEX (sort)";
397 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` ADD INDEX (visible)";
398 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` ADD INDEX (locked)";
399 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` ADD INDEX (what)";
400 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` ADD INDEX (sort)";
401 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` ADD INDEX (visible)";
402 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` ADD INDEX (locked)";
403 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats ADD INDEX (visible)";
404 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats ADD INDEX (sort)";
406 // Update notes (these will be set as task text!)
407 $UPDATE_NOTES = "Eindeutige Schlüssel (UNIQUE KEY) und normale Schlüssel (INDEX) gesetzt.";
410 case "0.3.2": // SQL queries for v0.3.2
411 // Connection table between the menu system and the "logical area" system
412 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las";
413 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_las (
414 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
415 la_id VARCHAR(255) NOT NULL DEFAULT '',
416 la_action VARCHAR(255) NOT NULL DEFAULT '',
417 la_what VARCHAR(255) NOT NULL DEFAULT '',
423 // All "logical areas" together
424 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las_data";
425 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_las_data (
426 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
427 la_id VARCHAR(255) NOT NULL DEFAULT '',
428 la_title VARCHAR(255) NOT NULL DEFAULT '',
429 la_posx BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
430 la_posy BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
436 // Which menu do you like?
437 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD admin_menu ENUM('NEW','OLD') NOT NULL DEFAULT 'OLD'";
440 $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_admin','Adminmenü','Diverse Einstellungen am Adminmenü vornehmen.', 9)";
442 // Update notes (these will be set as task text!)
443 $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.";
446 case "0.3.3": // SQL queries for v0.3.3
447 // Switch of the "intelligent menu sorter" when you want to have a fixed menu structure...
448 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD admin_menu_sorter ENUM('Y','N') NOT NULL DEFAULT 'Y'";
450 // The statistics table
451 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_stats";
452 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_stats (
453 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
454 aid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
455 type ENUM('la','action','what') NOT NULL DEFAULT 'what',
456 clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
461 // Update notes (these will be set as task text!)
462 $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.";
465 case "0.3.4": // SQL queries for v0.3.4
466 // Update notes (these will be set as task text!)
467 $UPDATE_NOTES = "Veraltetes Update (what=list_user&mode=noref)";
470 case "0.3.5": // SQL queries for v0.3.5
471 // List accounts with no referal
472 $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('stats',NULL,'Statistiken',4,'Y','N')";
473 $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('stats','stats2','Framekiller-Mails',2,'Y','N')";
474 $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('extras',NULL,'Extras',5,'Y','N')";
475 $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('rals',NULL,'Rallyes',6,'Y','N')";
476 $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('account',NULL,'Ihr Account',7,'Y','N')";
477 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET action='stats', sort='1', title='Klick-Mails' WHERE `what`='stats' LIMIT 1";
478 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET action='extras', sort='3' WHERE `what`='reflinks' LIMIT 1";
480 // Update notes (these will be set as task text!)
481 $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut.";
484 case "0.3.6": // SQL queries for v0.3.6
485 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD salt_length TINYINT(3) UNSIGNED NOT NULL DEFAULT '9'";
486 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD pass_scramble VARCHAR(255) NOT NULL DEFAULT ''";
487 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` MODIFY password VARCHAR(255) NOT NULL DEFAULT ''";
488 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` MODIFY user_hash VARCHAR(255) NOT NULL DEFAULT ''";
489 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins MODIFY password VARCHAR(255) NOT NULL DEFAULT ''";
490 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD rand_no BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
491 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD file_hash VARCHAR(255) NOT NULL DEFAULT ''";
492 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD master_salt VARCHAR(255) NOT NULL DEFAULT ''";
493 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_config` SET rand_no=(ROUND(RAND() * 99999) + 100000) WHERE config=0 LIMIT 1";
494 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg ADD has_menu ENUM('Y','N') NOT NULL DEFAULT 'N'";
495 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET has_menu='Y' WHERE module='admin' OR module='index' OR module='login' LIMIT 3";
497 // Update notes (these will be set as task text!)
498 $UPDATE_NOTES = "Passwort-System mit Zufallshash erweitert (Schutzt gegen Dictionary-Attacks!)";
501 case "0.3.7": // SQL queries for v0.3.7
502 $UPDATE_NOTES = "Problem während des Installationsvorganges behoben.";
505 case "0.3.8": // SQL queries for v0.3.8
506 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` CHANGE descr descr MEDIUMTEXT NULL";
507 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool CHANGE `text` `text` LONGTEXT NOT NULL";
509 // Update notes (these will be set as task text!)
510 $UPDATE_NOTES = "Beschreibungstexte für Admin-Menüs können länger sein. Diverse Fixes.";
513 case "0.3.9": // SQL queries for v0.3.9
514 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_admin_menu` SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
515 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_admin_menu` SET descr = REPLACE(descr, '--POINTS--','!POINTS!') WHERE descr LIKE '%--POINTS--%'";
516 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_guest_menu` SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
517 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
519 // Update notes (these will be set as task text!)
520 $UPDATE_NOTES = "Beschreibungstexte für Admin-Menüs können länger sein. Diverse Fixes.";
523 case "0.4.0": // SQL queries for v0.4.0
524 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_admin_menu` SET title = 'Email-Management' WHERE action = 'email' AND (`what`='' OR what IS NULL) LIMIT 1";
526 // Update notes (these will be set as task text!)
527 $UPDATE_NOTES = "Email-Verwaltung nach Email-Management umbenannt.";
530 case "0.4.1": // SQL queries for v0.4.1
531 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` DROP INDEX `status` , ADD INDEX `status` ( `status` , `max_mails` )";
532 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `show_timings` ENUM ('Y','N') NOT NULL DEFAULT 'Y'";
534 // Update notes (these will be set as task text!)
535 $UPDATE_NOTES = "Tabellen-Schlüssel neu gesetzt und Parsing-Zeit im Footer eingeblendet.";
538 case "0.4.2": // SQL queries for v0.4.2
539 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_online` ADD INDEX `admin_member` (`is_admin`,`is_member`)";
541 // Update notes (these will be set as task text!)
542 $UPDATE_NOTES = "Neuen Schlüssel zur Online-Tabelle hinzugefügt.";
545 case "0.4.3": // SQL queries for v0.4.3
546 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_host` VARCHAR(255) NOT NULL DEFAULT ''";
547 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_port` INT(5) UNSIGNED NOT NULL DEFAULT 0";
548 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_username` VARCHAR(255) NOT NULL DEFAULT ''";
549 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_password` VARCHAR(255) NOT NULL DEFAULT ''";
550 $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)";
552 // Update notes (these will be set as task text!)
553 $UPDATE_NOTES = "Proxy-Einstellungen hinzugefügt.";
556 case "0.4.4": // SQL queries for v0.4.4
557 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
558 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
559 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
560 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_admin_menu` SET `what`=NULL WHERE `what`=''";
561 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_guest_menu` SET `what`=NULL WHERE `what`=''";
562 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET `what`=NULL WHERE `what`=''";
563 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
564 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
565 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` ADD INDEX `action` (`action`)";
566 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
568 // Update notes (these will be set as task text!)
569 $UPDATE_NOTES = "Schlüssel in Admin-, Gast- und Mitgliedsmenü verbessert.";
572 case "0.4.5": // SQL queries for v0.4.5
573 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD last_month CHAR(2) NOT NULL DEFAULT '00'";
574 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD last_week CHAR(2) NOT NULL DEFAULT '00'";
576 // Update notes (these will be set as task text!)
577 $UPDATE_NOTES = "Täglichen/wöchentlichen/monatlichen Reset verbessert.";
580 case "0.4.6": // SQL queries for v0.4.6
581 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD gender ENUM ('M','F') NOT NULL DEFAULT 'M'";
582 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_user_data` SET gender=sex WHERE sex != 'M'";
583 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` DROP sex";
585 // Update notes (these will be set as task text!)
586 $UPDATE_NOTES = "Offensives Wort "Sex" gegen "Gender" ausgetauscht.";
589 case "0.4.7": // SQL queries for v0.4.7
590 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD login_failtures BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
591 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD last_failture TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'";
593 // Update notes (these will be set as task text!)
594 $UPDATE_NOTES = "Fehlgeschlagene Login-Versuche werden nun mitgezählt und der letzte vermerkt.";
597 case "0.4.8": // SQL queries for v0.4.8
598 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (subject)";
600 // Update notes (these will be set as task text!)
601 $UPDATE_NOTES = "Index für Betreff eingefügt.";
604 case "0.4.9": // SQL queries for v0.4.9
605 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` CHANGE `user_hash` `user_hash` VARCHAR(255) NULL DEFAULT NULL";
606 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_user_data` SET user_hash=NULL WHERE user_hash IS NOT NULL AND status='CONFIRMED'";
607 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD UNIQUE (`user_hash`)";
609 // Update notes (these will be set as task text!)
610 $UPDATE_NOTES = "User-Hash zum Bestätigen wird auf NULL gesetzt, wenn Account bestätigt wird.";
613 case "0.5.0": // SQL queries for v0.5.0
614 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `level`";
615 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `userid`, ADD UNIQUE `userid_level` (`userid`,`level`)";
617 // Update notes (these will be set as task text!)
618 $UPDATE_NOTES = "Referal-System unterstützt nun detailierte Referal-Übersicht und vieles mehr.";
621 case "0.5.1": // SQL queries for v0.5.1
622 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` DROP `descr`";
624 // Update notes (these will be set as task text!)
625 $UPDATE_NOTES = "Beschreibungsspalte von Mitgliedsmenü entfernt, welche ohnehin nicht genutzt wird.";
628 case "0.5.2": // SQL queries for v0.5.2
629 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refdepths` CHANGE `percents` `percents` FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000";
631 // Update notes (these will be set as task text!)
632 $UPDATE_NOTES = "Prozents&aum;tze können nun fünf Stelle hinter dem Komma sein.";
635 case "0.5.3": // SQL queries for v0.5.3
636 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD session_save_path VARCHAR(255) NOT NULL DEFAULT ''";
637 $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)";
639 // Update notes (these will be set as task text!)
640 $UPDATE_NOTES = "Session-Speicherpfad konfigurierbar. Beispielsweise ist dies bei all-inkl.com nötig.";
643 case "0.5.4": // SQL queries for v0.5.4
644 $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','reflist','Ref-Übersicht',5,'Y','N')";
646 // Depends on refback extension
647 $EXT_UPDATE_DEPENDS = "refback";
649 // Update notes (these will be set as task text!)
650 $UPDATE_NOTES = "Ref-Übersicht eingebaut. Diese hängt von der Erweiterung <strong>refback</strong> ab.";
653 case "0.5.5": // SQL queries for v0.5.5
654 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD show_points_unconfirmed ENUM('Y','N') NOT NULL DEFAULT 'Y'";
656 // Update notes (these will be set as task text!)
657 $UPDATE_NOTES = "Anzeige der {!POINTS!} unter den unbestätigten Mails kann nun optional abgeschaltet werden.";
660 case "0.5.6": // SQL queries for v0.5.6
661 $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_stats_data`";
662 $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_user_stats_data` (
663 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
664 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
665 `stats_type` VARCHAR(255) NOT NULL DEFAULT 'unknown',
666 `stats_data` VARCHAR(255) NOT NULL DEFAULT '',
667 `inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
671 ) TYPE=MyISAM COMMENT='Member statistics data'";
673 // Update notes (these will be set as task text!)
674 $UPDATE_NOTES = "Mitglieder könnnen nun z.B. in den Mail-Details zu jeder Mail sehen, wann sie diese bestätigt haben. Die neue Statistik-Tabelle ist aber universell einsetzbar.";
677 case "0.5.7": // SQL queries for v0.5.7
678 $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE what='list_norefs' LIMIT 1";
680 // Update notes (these will be set as task text!)
681 $UPDATE_NOTES = "Auflistung der Mitglieder ohne Werber nach what=list_user&mode=norefs verschoben.";
684 case "0.5.8": // SQL queries for v0.5.8
685 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_extensions` DROP `ext_lang_file`";
687 // Update notes (these will be set as task text!)
688 $UPDATE_NOTES = "Sprachdateinamen werden nicht mehr in der Datenbank behalten.";
691 case "0.5.9": // SQL queries for v0.5.9
692 $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_filters`";
693 $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_filters` (
694 `filter_id` BIGINT(20) UNSIGNED AUTO_INCREMENT,
695 `filter_name` VARCHAR(255) NOT NULL DEFAULT '',
696 `filter_function` VARCHAR(255) NOT NULL DEFAULT '',
697 `filter_active` ENUM('N','Y') NOT NULL DEFAULT 'Y',
698 PRIMARY KEY (`filter_id`)
699 ) TYPE=MyISAM COMMENT='Filter system'";
700 $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','list_filter','Filter-Management', 'Zeigt alle im System registrierten Filter an und lässt diese de- bzw. wieder aktivieren.', 17)";
702 // Update notes (these will be set as task text!)
703 $UPDATE_NOTES = "Tabellen für Filter-System hinzugefügt.";
708 case "test": // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
711 default: // Do stuff when extension is loaded
712 // When the sql_patches is not installed we cannot load it's configuration... *sigh*
713 if (GET_EXT_VERSION("sql_patches") != '') {
715 $_CONFIG['secret_key'] = "";
717 // Read key from secret file
718 if ((getConfig('file_hash') == "") || (getConfig('master_salt') == "") || (getConfig('pass_scramble') == "")) {
719 // Maybe need setup of secret key!
720 require_once(PATH."inc/gen_sql_patches.php");
722 if ((GET_EXT_VERSION("cache") >= "0.1.2") && (is_object($cacheInstance))) {
723 // Remove extensions and mod_reg cache file
724 require_once(PATH."inc/libs/cache_functions.php");
725 require_once(PATH."inc/extensions/ext-cache.php");
726 if ($cacheInstance->loadCacheFile("extensions", true)) $cacheInstance->destroyCacheFile();
727 if ($cacheInstance->loadCacheFile("mod_reg")) $cacheInstance->destroyCacheFile();
732 if ((getConfig('file_hash') != "") && (getConfig('master_salt') != "") && (getConfig('pass_scramble') != "")) {
733 // File hash fas generated so we can also file the secret file... hopefully.
734 $hashFile = sprintf("%sinc/.secret/.%s", PATH, getConfig('file_hash'));
735 if (FILE_READABLE($hashFile)) {
737 $_CONFIG['secret_key'] = implode("", file($hashFile));
739 // Remove it from database
740 UPDATE_CONFIG("file_hash", "");
742 // Cannot read secret file!
743 mxchange_die("Cannot read secret file! Please try to reload");
747 // Transfer words/numbers to constants
748 define('POINTS' , getConfig('points_word'));
749 define('MT_WORD' , getConfig('mt_word'));
750 define('MT_WORD2', getConfig('mt_word2'));
751 define('MT_WORD3', getConfig('mt_word3'));
752 define('_MAX' , getConfig('rand_no'));
754 // Set some lame ( ;-) ) default settings
755 $_CONFIG['def_refid'] = 0;
756 $_CONFIG['enable_title_deco'] = "N";
757 $_CONFIG['title_mod_show'] = "Y";
758 $_CONFIG['title_middle'] = "-";
759 // @TODO Can we remove this? $_CONFIG['verbose_sql'] = "N";
760 define('MT_WORD' , DEFAULT_MT_WORD );
761 define('MT_WORD2', DEFAULT_MT_WORD2);
762 define('MT_WORD3', DEFAULT_MT_WORD3);
763 define('POINTS' , DEFAULT_POINTS);
768 // Keep this extension always active!
769 $EXT_ALWAYS_ACTIVE = "Y";