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 - 2012 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 // @TODO NOT NULL DEFAULT '' is bad practice, use NULL
53 addExtensionAddTableColumnSql('user_data', 'nickname', "VARCHAR(255) NOT NULL DEFAULT ''");
54 addExtensionAddTableColumnSql('user_data', 'nick_userid', "ENUM ('nick','userid') NOT NULL DEFAULT 'userid'");
57 addMemberMenuSql('extras', 'nickname', 'Nicknamen', 2);
60 case 'remove': // Do stuff when removing extension
61 // SQL commands to run
62 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='nickname' LIMIT 1");
63 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('config_nickname','list_nickname') LIMIT 2");
66 case 'activate': // Do stuff when admin activates this extension
67 // SQL commands to run
68 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y',`locked`='N' WHERE `what`='nickname' LIMIT 1");
71 case 'deactivate': // Do stuff when admin deactivates this extension
72 // SQL commands to run
73 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N',`locked`='Y' WHERE `what`='nickname' LIMIT 1");
76 case 'update': // Update an extension
77 switch (getCurrentExtensionVersion()) {
78 case '0.0.1': // SQL queries for v0.0.1
79 // This update depends on ext-sql_patches update!
80 addExtensionDependency('sql_patches');
82 // Update notes (these will be set as task text!)
83 setExtensionUpdateNotes("Veraltetes Update entfernt.");
86 case '0.0.3': // SQL queries for v0.0.3
87 // Update notes (these will be set as task text!)
88 setExtensionUpdateNotes("Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.");
91 case '0.0.4': // SQL queries for v0.0.4
92 // Update notes (these will be set as task text!)
93 setExtensionUpdateNotes("Wegen des Theme-Supportes hat sich die URL zur CSS-Datei geändert.");
96 case '0.0.5': // SQL queries for v0.0.5
97 // Update notes (these will be set as task text!)
98 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
101 case '0.0.6': // SQL queries for v0.0.6
102 addConfigAddSql('nickname_len', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 5');
103 addConfigAddSql('nickname_pattern', "VARCHAR(255) NOT NULL DEFAULT 'a-zA-Z0-9_'");
104 addConfigAddSql('nickname_chars', "VARCHAR(255) NOT NULL DEFAULT 'a-z, A-Z, 0-9, _'");
105 addAdminMenuSql('setup', 'config_nickname', 'Nicknamen', 'Stellen Sie minimale Nicknamenlänge, sowie erlaubte Zeichen hier ein.', 12);
107 // Update notes (these will be set as task text!)
108 setExtensionUpdateNotes("Minimale Länge, sowie erlaubte Zeichen sind per Adminbereich änderbar. Setzen Sie als erlaubte Zeichen nur URL-konforme Zeichen ein!");
111 case '0.0.7': // SQL queries for v0.0.7
112 // Update notes (these will be set as task text!)
113 setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
116 case '0.0.8': // SQL queries for v0.0.8
117 // Update notes (these will be set as task text!)
118 setExtensionUpdateNotes("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
121 case '0.0.9': // SQL queries for v0.0.9
122 // Update notes (these will be set as task text!)
123 setExtensionUpdateNotes("Design "Solid-Business" eingebaut.");
126 case '0.1.0': // SQL queries for v0.2.1
127 // Update notes (these will be set as task text!)
128 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
131 case '0.1.1': // SQL queries for v0.1.1
132 addExtensionDropTableColumnSql('user_data', 'nick_userid');
134 // Update notes (these will be set as task text!)
135 setExtensionUpdateNotes("Auswahlfür Mitglied ob mit Nickname oder Mitglieds-Id einloggen entfernt.");
138 case '0.1.2': // SQL queries for v0.1.2
139 // Update notes (these will be set as task text!)
140 setExtensionUpdateNotes("Zum Zusenden eines neuen Passwortes kann jetzt entweder der Nickname / Mitglieds-Id <u>ODER</u> die angemeldete EMail-Adresse eingegeben werden.");
143 case '0.1.3': // SQL queries for v0.1.3
144 // Update notes (these will be set as task text!)
145 setExtensionUpdateNotes("CSS-Datei in general.css verschmolzen (Patch 435!)");
148 case '0.1.4': // SQL queries for v0.1.4
149 // Update notes (these will be set as task text!)
150 setExtensionUpdateNotes("HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.");
153 case '0.1.5': // SQL queries for v0.1.5
154 // Update notes (these will be set as task text!)
155 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
158 case '0.1.6': // SQL queries for v0.1.6
159 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras',`sort`=2 WHERE `what`='nickname' LIMIT 1");
161 // Update notes (these will be set as task text!)
162 setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
165 case '0.1.7': // SQL queries for v0.1.7
166 // Update notes (these will be set as task text!)
167 setExtensionUpdateNotes("Mitglieder ohne Nickname sollten kein <strong>*failed*</strong> mehr sehen.");
170 case '0.1.8': // SQL queries for v0.1.8
171 // Update notes (these will be set as task text!)
172 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
175 case '0.1.9': // SQL queries for v0.1.9
176 addAdminMenuSql('user', 'list_nickname', 'Nickname-Historie', 'Listet alle verwendeten Nicknames der Mitglieder auf.', 12);
178 // Update notes (these will be set as task text!)
179 setExtensionUpdateNotes("Menuüpunkt für Nickname-History hinzugefügt.");
182 case '0.2.0': // SQL queries for v0.2.0
183 // Update notes (these will be set as task text!)
184 setExtensionUpdateNotes("Ungültiges Update (wegen Verallgemeinerung der <strong>nickname_history</strong>-Tabelle.");
187 case '0.2.1': // SQL queries for v0.2.1
188 // Remove this deprecated table
189 addDropTableSql('nickname_history');
191 // This update depends on ext-sql_patches update!
192 addExtensionDependency('sql_patches');
194 // Update notes (these will be set as task text!)
195 setExtensionUpdateNotes("Diese Tabelle kann in <strong>ext-sql_patches</strong> allgemeiner formuliert werden.");
200 case 'modify': // When the extension got modified
203 case 'test': // For testing purposes
206 case 'init': // Do stuff when extension is initialized
209 default: // Unknown extension mode
210 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));