2 /************************************************************************
3 * MXChange v0.2.1 Start: 06/17/2004 *
4 * ================ Last change: 06/17/2004 *
6 * -------------------------------------------------------------------- *
7 * File : ext-nickname.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Nickname login and display in register form *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Nickname-Login und Anzeige im Anmeldeformular *
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_SET_VERSION("0.1.9");
43 // Version history array (add more with , "0.1" and so on)
44 EXT_SET_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"));
46 switch ($EXT_LOAD_MODE)
48 case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
49 // SQL commands to run
50 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD nickname VARCHAR(255) NOT NULL DEFAULT ''");
51 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD nick_uid ENUM ('nick','uid') NOT NULL DEFAULT 'uid'");
52 ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','nickname','Nicknamen','5','Y','Y')");
55 case "remove": // Do stuff when removing extension
56 // SQL commands to run
57 ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='nickname' LIMIT 1");
58 ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN ('config_nickname','list_nickname') LIMIT 2");
59 ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_nickname_history`");
62 case "activate": // Do stuff when admin activates this extension
63 // SQL commands to run
64 ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='nickname' LIMIT 1");
67 case "deactivate": // Do stuff when admin deactivates this extension
68 // SQL commands to run
69 ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='nickname' LIMIT 1");
72 case "update": // Update an extension
75 case "0.0.1": // SQL queries for v0.0.1
76 ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE ext_name='nickname' AND ext_has_css='N' LIMIT 1");
78 // This update depends on sql_patches update!
79 EXT_SET_UPDATE_DEPENDS("sql_patches");
81 // Update notes (these will be set as task text!)
82 EXT_SET_UPDATE_NOTES("CSS-Datei kann per Adminbereich ein- und ausgeschaltet werden.");
85 case "0.0.3": // SQL queries for v0.0.3
86 // Update notes (these will be set as task text!)
87 EXT_SET_UPDATE_NOTES("Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.");
90 case "0.0.4": // SQL queries for v0.0.4
91 // Update notes (these will be set as task text!)
92 EXT_SET_UPDATE_NOTES("Wegen des Theme-Supportes hat sich die URL zur CSS-Datei geändert.");
95 case "0.0.5": // SQL queries for v0.0.5
96 // Update notes (these will be set as task text!)
97 EXT_SET_UPDATE_NOTES("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
100 case "0.0.6": // SQL queries for v0.0.6
101 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD nickname_len TINYINT(3) UNSIGNED NOT NULL DEFAULT '5'");
102 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD nickname_pattern VARCHAR(255) NOT NULL DEFAULT 'a-zA-Z0-9_'");
103 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD nickname_chars VARCHAR(255) NOT NULL DEFAULT 'a-z, A-Z, 0-9, _'");
104 ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_nickname','Nicknamen','Stellen Sie minimale Nicknamenlänge, sowie erlaubte Zeichen hier ein.', 12)");
106 // Update notes (these will be set as task text!)
107 EXT_SET_UPDATE_NOTES("Minimale Länge, sowie erlaubte Zeichen sind per Adminbereich änderbar. Setzen Sie als erlaubte Zeichen nur URL-konforme Zeichen ein!");
110 case "0.0.7": // SQL queries for v0.0.7
111 // Update notes (these will be set as task text!)
112 EXT_SET_UPDATE_NOTES("Problem mit Speicherung der Einstellungen beseitigt.");
115 case "0.0.8": // SQL queries for v0.0.8
116 // Update notes (these will be set as task text!)
117 EXT_SET_UPDATE_NOTES("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
120 case "0.0.9": // SQL queries for v0.0.9
121 // Update notes (these will be set as task text!)
122 EXT_SET_UPDATE_NOTES("Design "Solid-Business" eingebaut.");
125 case "0.1.0": // SQL queries for v0.2.1
126 // Update notes (these will be set as task text!)
127 EXT_SET_UPDATE_NOTES("Seit <a href=\"#\">Patch 340</a> überflüssige HTML-Tags entfernt.");
130 case "0.1.1": // SQL queries for v0.1.1
131 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP nick_uid");
133 // Update notes (these will be set as task text!)
134 EXT_SET_UPDATE_NOTES("Auswahlfür Mitglied ob mit Nickname oder User-ID einloggen entfernt.");
137 case "0.1.2": // SQL queries for v0.1.2
138 // Update notes (these will be set as task text!)
139 EXT_SET_UPDATE_NOTES("Zum Zusenden eines neuen Passwortes kann jetzt entweder der Nickname / User-ID <u>ODER</u> die angemeldete EMail-Adresse eingegeben werden.");
142 case "0.1.3": // SQL queries for v0.1.3
143 // Update notes (these will be set as task text!)
144 EXT_SET_UPDATE_NOTES("CSS-Datei in general.css verschmolzen (Patch 435!)");
147 case "0.1.4": // SQL queries for v0.1.4
148 // Update notes (these will be set as task text!)
149 EXT_SET_UPDATE_NOTES("HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.");
152 case "0.1.5": // SQL queries for v0.1.5
153 // Update notes (these will be set as task text!)
154 EXT_SET_UPDATE_NOTES("Abspeichern von Einstellungen repariert.");
157 case "0.1.6": // SQL queries for v0.1.6
158 ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='extras', `sort`='2' WHERE `what`='nickname' LIMIT 1");
160 // Update notes (these will be set as task text!)
161 EXT_SET_UPDATE_NOTES("Mitgliedsmenü komplett umgebaut.");
164 case "0.1.7": // SQL queries for v0.1.7
165 // Update notes (these will be set as task text!)
166 EXT_SET_UPDATE_NOTES("Mitglieder ohne Nickname sollten kein <strong>*failed*</strong> mehr sehen.");
169 case "0.1.8": // SQL queries for v0.1.8
170 // Update notes (these will be set as task text!)
171 EXT_SET_UPDATE_NOTES("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
174 case "0.1.9": // SQL queries for v0.1.9
175 ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_nickname','Nickname-Historie','Listet alle verwendeten Nicknames der Mitglieder auf.', 12)");
176 ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_nickname_history`");
177 ADD_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_nickname_history` (
178 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
179 userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
180 nickname VARCHAR(255) NOT NULL DEFAULT '',
181 added TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
182 last_used TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
183 INDEX userid (userid),
184 INDEX (last_used DESC),
186 ) TYPE={!_TABLE_TYPE!} COMMENT='History of used nicknames'");
188 // Update notes (these will be set as task text!)
189 EXT_SET_UPDATE_NOTES("Historie eingegebener Nicknames hinzugefügt. Mitglied kann auf bereits verwendeter zurückgreifen und Liste selbst löschen.");
194 case "modify": // When the extension got modified
197 case "test": // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
200 default: // Do stuff when extension is loaded