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://www.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.0');
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'));
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'");
54 addMemberMenuSql('main','nickname','Nicknamen',5);
57 case 'remove': // Do stuff when removing extension
58 // SQL commands to run
59 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='nickname'");
60 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('config_nickname','list_nickname')");
61 addDropTableSql('nickname_history');
64 case 'activate': // Do stuff when admin activates this extension
65 // SQL commands to run
66 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='nickname' LIMIT 1");
69 case 'deactivate': // Do stuff when admin deactivates this extension
70 // SQL commands to run
71 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='nickname' LIMIT 1");
74 case 'update': // Update an extension
75 switch (getCurrentExtensionVersion()) {
76 case '0.0.1': // SQL queries for v0.0.1
77 // This update depends on sql_patches update!
78 addExtensionDependency('sql_patches');
80 // Update notes (these will be set as task text!)
81 setExtensionUpdateNotes("Veraltetes Update entfernt.");
84 case '0.0.3': // SQL queries for v0.0.3
85 // Update notes (these will be set as task text!)
86 setExtensionUpdateNotes("Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.");
89 case '0.0.4': // SQL queries for v0.0.4
90 // Update notes (these will be set as task text!)
91 setExtensionUpdateNotes("Wegen des Theme-Supportes hat sich die URL zur CSS-Datei geändert.");
94 case '0.0.5': // SQL queries for v0.0.5
95 // Update notes (these will be set as task text!)
96 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
99 case '0.0.6': // SQL queries for v0.0.6
100 addConfigAddSql('nickname_len', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 5');
101 addConfigAddSql('nickname_pattern', "VARCHAR(255) NOT NULL DEFAULT 'a-zA-Z0-9_'");
102 addConfigAddSql('nickname_chars', "VARCHAR(255) NOT NULL DEFAULT 'a-z, A-Z, 0-9, _'");
103 addAdminMenuSql('setup','config_nickname','Nicknamen','Stellen Sie minimale Nicknamenlänge, sowie erlaubte Zeichen hier ein.', 12);
105 // Update notes (these will be set as task text!)
106 setExtensionUpdateNotes("Minimale Länge, sowie erlaubte Zeichen sind per Adminbereich änderbar. Setzen Sie als erlaubte Zeichen nur URL-konforme Zeichen ein!");
109 case '0.0.7': // SQL queries for v0.0.7
110 // Update notes (these will be set as task text!)
111 setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
114 case '0.0.8': // SQL queries for v0.0.8
115 // Update notes (these will be set as task text!)
116 setExtensionUpdateNotes("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
119 case '0.0.9': // SQL queries for v0.0.9
120 // Update notes (these will be set as task text!)
121 setExtensionUpdateNotes("Design "Solid-Business" eingebaut.");
124 case '0.1.0': // SQL queries for v0.2.1
125 // Update notes (these will be set as task text!)
126 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
129 case '0.1.1': // SQL queries for v0.1.1
130 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` DROP nick_userid");
132 // Update notes (these will be set as task text!)
133 setExtensionUpdateNotes("Auswahlfür Mitglied ob mit Nickname oder Mitglieder-Id einloggen entfernt.");
136 case '0.1.2': // SQL queries for v0.1.2
137 // Update notes (these will be set as task text!)
138 setExtensionUpdateNotes("Zum Zusenden eines neuen Passwortes kann jetzt entweder der Nickname / Mitglieder-Id <u>ODER</u> die angemeldete EMail-Adresse eingegeben werden.");
141 case '0.1.3': // SQL queries for v0.1.3
142 // Update notes (these will be set as task text!)
143 setExtensionUpdateNotes("CSS-Datei in general.css verschmolzen (Patch 435!)");
146 case '0.1.4': // SQL queries for v0.1.4
147 // Update notes (these will be set as task text!)
148 setExtensionUpdateNotes("HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.");
151 case '0.1.5': // SQL queries for v0.1.5
152 // Update notes (these will be set as task text!)
153 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
156 case '0.1.6': // SQL queries for v0.1.6
157 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras', `sort`=2 WHERE `what`='nickname' LIMIT 1");
159 // Update notes (these will be set as task text!)
160 setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
163 case '0.1.7': // SQL queries for v0.1.7
164 // Update notes (these will be set as task text!)
165 setExtensionUpdateNotes("Mitglieder ohne Nickname sollten kein <strong>*failed*</strong> mehr sehen.");
168 case '0.1.8': // SQL queries for v0.1.8
169 // Update notes (these will be set as task text!)
170 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
173 case '0.1.9': // SQL queries for v0.1.9
174 addAdminMenuSql('user','list_nickname','Nickname-Historie','Listet alle verwendeten Nicknames der Mitglieder auf.', 12);
175 addDropTableSql('nickname_history');
176 addCreateTableSql('nickname_history', "
177 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
178 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
179 `nickname` VARCHAR(255) NOT NULL DEFAULT '',
180 `added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
181 `last_used` TIMESTAMP NULL DEFAULT NULL,
183 INDEX `userid` (`userid`),
184 INDEX (`last_used` DESC)",
185 'History of used nicknames');
187 // Update notes (these will be set as task text!)
188 setExtensionUpdateNotes("Historie eingegebener Nicknames hinzugefügt. Mitglied kann auf bereits verwendeter zurückgreifen und Liste selbst löschen.");
191 case '0.2.0': // SQL queries for v0.2.0
192 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_nickname_history` CHANGE `last_used` `last_used` TIMESTAMP NULL DEFAULT NULL");
194 // Update notes (these will be set as task text!)
195 setExtensionUpdateNotes("Ausgangswert ist nicht mehr 0000-00-00 00:00:00, sondern NULL.");
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()));