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 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * Needs to be in all Files and every File needs "svn propset *
18 * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
19 * -------------------------------------------------------------------- *
20 * Copyright (c) 2003 - 2008 by Roland Haeder *
21 * For more information visit: http://www.mxchange.org *
23 * This program is free software; you can redistribute it and/or modify *
24 * it under the terms of the GNU General Public License as published by *
25 * the Free Software Foundation; either version 2 of the License, or *
26 * (at your option) any later version. *
28 * This program is distributed in the hope that it will be useful, *
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
31 * GNU General Public License for more details. *
33 * You should have received a copy of the GNU General Public License *
34 * along with this program; if not, write to the Free Software *
35 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
37 ************************************************************************/
39 // Some security stuff...
40 if (!defined('__SECURITY')) {
41 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
46 EXT_SET_VERSION("0.1.9");
48 // Version history array (add more with , "0.1" and so on)
49 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"));
51 switch ($EXT_LOAD_MODE)
53 case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
54 // SQL commands to run
55 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD nickname VARCHAR(255) NOT NULL DEFAULT ''");
56 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD nick_uid ENUM ('nick','uid') NOT NULL DEFAULT 'uid'");
57 ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','nickname','Nicknamen','5','Y','Y')");
60 case "remove": // Do stuff when removing extension
61 // SQL commands to run
62 ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='nickname' LIMIT 1");
63 ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN ('config_nickname','list_nickname') LIMIT 2");
64 ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_nickname_history`");
67 case "activate": // Do stuff when admin activates this extension
68 // SQL commands to run
69 ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='nickname' LIMIT 1");
72 case "deactivate": // Do stuff when admin deactivates this extension
73 // SQL commands to run
74 ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='nickname' LIMIT 1");
77 case "update": // Update an extension
80 case "0.0.1": // SQL queries for v0.0.1
81 ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE ext_name='nickname' AND ext_has_css='N' LIMIT 1");
83 // This update depends on sql_patches update!
84 EXT_SET_UPDATE_DEPENDS("sql_patches");
86 // Update notes (these will be set as task text!)
87 EXT_SET_UPDATE_NOTES("CSS-Datei kann per Adminbereich ein- und ausgeschaltet werden.");
90 case "0.0.3": // SQL queries for v0.0.3
91 // Update notes (these will be set as task text!)
92 EXT_SET_UPDATE_NOTES("Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.");
95 case "0.0.4": // SQL queries for v0.0.4
96 // Update notes (these will be set as task text!)
97 EXT_SET_UPDATE_NOTES("Wegen des Theme-Supportes hat sich die URL zur CSS-Datei geändert.");
100 case "0.0.5": // SQL queries for v0.0.5
101 // Update notes (these will be set as task text!)
102 EXT_SET_UPDATE_NOTES("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
105 case "0.0.6": // SQL queries for v0.0.6
106 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD nickname_len TINYINT(3) UNSIGNED NOT NULL DEFAULT '5'");
107 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD nickname_pattern VARCHAR(255) NOT NULL DEFAULT 'a-zA-Z0-9_'");
108 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD nickname_chars VARCHAR(255) NOT NULL DEFAULT 'a-z, A-Z, 0-9, _'");
109 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)");
111 // Update notes (these will be set as task text!)
112 EXT_SET_UPDATE_NOTES("Minimale Länge, sowie erlaubte Zeichen sind per Adminbereich änderbar. Setzen Sie als erlaubte Zeichen nur URL-konforme Zeichen ein!");
115 case "0.0.7": // SQL queries for v0.0.7
116 // Update notes (these will be set as task text!)
117 EXT_SET_UPDATE_NOTES("Problem mit Speicherung der Einstellungen beseitigt.");
120 case "0.0.8": // SQL queries for v0.0.8
121 // Update notes (these will be set as task text!)
122 EXT_SET_UPDATE_NOTES("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
125 case "0.0.9": // SQL queries for v0.0.9
126 // Update notes (these will be set as task text!)
127 EXT_SET_UPDATE_NOTES("Design "Solid-Business" eingebaut.");
130 case "0.1.0": // SQL queries for v0.2.1
131 // Update notes (these will be set as task text!)
132 EXT_SET_UPDATE_NOTES("Seit <a href=\"#\">Patch 340</a> überflüssige HTML-Tags entfernt.");
135 case "0.1.1": // SQL queries for v0.1.1
136 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP nick_uid");
138 // Update notes (these will be set as task text!)
139 EXT_SET_UPDATE_NOTES("Auswahlfür Mitglied ob mit Nickname oder User-ID einloggen entfernt.");
142 case "0.1.2": // SQL queries for v0.1.2
143 // Update notes (these will be set as task text!)
144 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.");
147 case "0.1.3": // SQL queries for v0.1.3
148 // Update notes (these will be set as task text!)
149 EXT_SET_UPDATE_NOTES("CSS-Datei in general.css verschmolzen (Patch 435!)");
152 case "0.1.4": // SQL queries for v0.1.4
153 // Update notes (these will be set as task text!)
154 EXT_SET_UPDATE_NOTES("HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.");
157 case "0.1.5": // SQL queries for v0.1.5
158 // Update notes (these will be set as task text!)
159 EXT_SET_UPDATE_NOTES("Abspeichern von Einstellungen repariert.");
162 case "0.1.6": // SQL queries for v0.1.6
163 ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='extras', `sort`='2' WHERE `what`='nickname' LIMIT 1");
165 // Update notes (these will be set as task text!)
166 EXT_SET_UPDATE_NOTES("Mitgliedsmenü komplett umgebaut.");
169 case "0.1.7": // SQL queries for v0.1.7
170 // Update notes (these will be set as task text!)
171 EXT_SET_UPDATE_NOTES("Mitglieder ohne Nickname sollten kein <strong>*failed*</strong> mehr sehen.");
174 case "0.1.8": // SQL queries for v0.1.8
175 // Update notes (these will be set as task text!)
176 EXT_SET_UPDATE_NOTES("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
179 case "0.1.9": // SQL queries for v0.1.9
180 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)");
181 ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_nickname_history`");
182 ADD_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_nickname_history` (
183 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
184 userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
185 nickname VARCHAR(255) NOT NULL DEFAULT '',
186 added TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
187 last_used TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
188 INDEX userid (userid),
189 INDEX (last_used DESC),
191 ) TYPE={!_TABLE_TYPE!} COMMENT='History of used nicknames'");
193 // Update notes (these will be set as task text!)
194 EXT_SET_UPDATE_NOTES("Historie eingegebener Nicknames hinzugefügt. Mitglied kann auf bereits verwendeter zurückgreifen und Liste selbst löschen.");
199 case "modify": // When the extension got modified
202 case "test": // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
205 default: // Do stuff when extension is loaded