2 /************************************************************************
3 * Mailer v0.2.1-FINAL 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 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2011 by Mailer Developer Team *
20 * For more information visit: http://mxchange.org *
22 * This program is free software; you can redistribute it and/or modify *
23 * it under the terms of the GNU General Public License as published by *
24 * the Free Software Foundation; either version 2 of the License, or *
25 * (at your option) any later version. *
27 * This program is distributed in the hope that it will be useful, *
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
30 * GNU General Public License for more details. *
32 * You should have received a copy of the GNU General Public License *
33 * along with this program; if not, write to the Free Software *
34 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
36 ************************************************************************/
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
44 setThisExtensionVersion('0.2.1');
46 // Version history array (add more with , '0.0.1' and so on)
47 setExtensionVersionHistory(array('0.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'));
49 switch (getExtensionMode()) {
50 case 'register': // Do stuff when installation is running
51 // SQL commands to run
52 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `nickname` VARCHAR(255) NOT NULL DEFAULT ''");
53 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `nick_userid` ENUM ('nick','userid') NOT NULL DEFAULT 'userid'");
56 addMemberMenuSql('extras', 'nickname', 'Nicknamen', 2);
59 case 'remove': // Do stuff when removing extension
60 // SQL commands to run
61 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='nickname' LIMIT 1");
62 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('config_nickname','list_nickname') LIMIT 2");
65 case 'activate': // Do stuff when admin activates this extension
66 // SQL commands to run
67 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y',`locked`='N' WHERE `what`='nickname' LIMIT 1");
70 case 'deactivate': // Do stuff when admin deactivates this extension
71 // SQL commands to run
72 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N',`locked`='Y' WHERE `what`='nickname' LIMIT 1");
75 case 'update': // Update an extension
76 switch (getCurrentExtensionVersion()) {
77 case '0.0.1': // SQL queries for v0.0.1
78 // This update depends on ext-sql_patches update!
79 addExtensionDependency('sql_patches');
81 // Update notes (these will be set as task text!)
82 setExtensionUpdateNotes("Veraltetes Update entfernt.");
85 case '0.0.3': // SQL queries for v0.0.3
86 // Update notes (these will be set as task text!)
87 setExtensionUpdateNotes("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 setExtensionUpdateNotes("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 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
100 case '0.0.6': // SQL queries for v0.0.6
101 addConfigAddSql('nickname_len', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 5');
102 addConfigAddSql('nickname_pattern', "VARCHAR(255) NOT NULL DEFAULT 'a-zA-Z0-9_'");
103 addConfigAddSql('nickname_chars', "VARCHAR(255) NOT NULL DEFAULT 'a-z, A-Z, 0-9, _'");
104 addAdminMenuSql('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 setExtensionUpdateNotes("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 setExtensionUpdateNotes("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 setExtensionUpdateNotes("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 setExtensionUpdateNotes("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 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
130 case '0.1.1': // SQL queries for v0.1.1
131 addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` DROP `nick_userid`');
133 // Update notes (these will be set as task text!)
134 setExtensionUpdateNotes("Auswahlfür Mitglied ob mit Nickname oder Mitglied-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 setExtensionUpdateNotes("Zum Zusenden eines neuen Passwortes kann jetzt entweder der Nickname / Mitglied-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 setExtensionUpdateNotes("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 setExtensionUpdateNotes("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 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
157 case '0.1.6': // SQL queries for v0.1.6
158 addExtensionSql("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 setExtensionUpdateNotes("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 setExtensionUpdateNotes("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 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
174 case '0.1.9': // SQL queries for v0.1.9
175 addAdminMenuSql('user', 'list_nickname', 'Nickname-Historie', 'Listet alle verwendeten Nicknames der Mitglieder auf.', 12);
177 // Update notes (these will be set as task text!)
178 setExtensionUpdateNotes("Menuüpunkt für Nickname-History hinzugefügt.");
181 case '0.2.0': // SQL queries for v0.2.0
182 // Update notes (these will be set as task text!)
183 setExtensionUpdateNotes("Ungütiges Update (wegen Verallgemeinerung der <strong>nickname_history</strong>-Tabelle.");
186 case '0.2.1': // SQL queries for v0.2.1
187 // Remove this deprecated table
188 addDropTableSql('nickname_history');
190 // This update depends on ext-sql_patches update!
191 addExtensionDependency('sql_patches');
193 // Update notes (these will be set as task text!)
194 setExtensionUpdateNotes("Diese Tabelle kann in <strong>ext-sql_patches</strong> allgemeiner formuliert werden.");
199 case 'modify': // When the extension got modified
202 case 'test': // For testing purposes
205 case 'init': // Do stuff when extension is initialized
208 default: // Unknown extension mode
209 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));