2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 10/03/2004 *
4 * =================== Last change: 11/26/2004 *
6 * -------------------------------------------------------------------- *
7 * File : ext-active.php *
8 * -------------------------------------------------------------------- *
9 * Short description : "Last active users" *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : "Zuletzt aktiv gewesenen Mitglieder *
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.0.9');
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'));
49 switch (getExtensionMode()) {
50 case 'register': // Do stuff when installation is running
51 // SQL commands to run
52 addGuestMenuSql('main', 'active', 'Heute Online', 10);
55 case 'remove': // Do stuff when removing extension
56 // SQL commands to run
57 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='active'");
58 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_active'");
61 unregisterFilter(__FUNCTION__, __LINE__, 'online_extra_links', 'ADD_LINK_ACTIVE_LIST', true, isExtensionDryRun());
64 case 'activate': // Do stuff when admin activates this extension
65 // SQL commands to run
66 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='N',`locked`='N' WHERE `what`='active' LIMIT 1");
69 case 'deactivate': // Do stuff when admin deactivates this extension
70 // SQL commands to run
71 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='N',`locked`='Y' WHERE `what`='active' LIMIT 1");
74 case 'update': // Update an extension
75 switch (getCurrentExtensionVersion()) {
76 case '0.0.1': // SQL queries for v0.0.1
77 // Update notes (these will be set as task text!)
78 setExtensionUpdateNotes("Wegen des Theme-Supportes hat sich die URL zur CSS-Datei geändert.");
81 case '0.0.2': // SQL queries for v0.0.2
82 // Update notes (these will be set as task text!)
83 setExtensionUpdateNotes("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
86 case '0.0.3': // SQL queries for v0.0.3
87 // Update notes (these will be set as task text!)
88 setExtensionUpdateNotes("Design "Solid-Business" eingebaut.");
91 case '0.0.4': // SQL queries for v0.0.4
92 // Update notes (these will be set as task text!)
93 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
96 case '0.0.5': // SQL queries for v0.0.5
97 addConfigAddSql('active_limit', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 10');
98 addAdminMenuSql('setup', 'config_active', 'Aktiv-Liste', 'Einstellungen an der Aktiv-Liste (<strong>Heute Online</strong> im Gastbereich) vornehmen.', 8);
100 // Update notes (these will be set as task text!)
101 setExtensionUpdateNotes("Aktiven-Liste im Gastbereich ist nun einschränkbar.");
104 case '0.0.6': // SQL queries for v0.0.6
105 // Update notes (these will be set as task text!)
106 setExtensionUpdateNotes("Sicherheitsupdate: SQL-Anweisungen geschützt.");
109 case '0.0.7': // SQL queries for v0.0.7
110 // Update notes (these will be set as task text!)
111 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
114 case '0.0.8': // SQL queries for v0.0.8
115 // Update notes (these will be set as task text!)
116 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
119 case '0.0.9': // SQL queries for v0.0.9
120 // Make update depending on 'online'
121 addExtensionDependency('online');
124 registerFilter('online_extra_links', 'ADD_LINK_ACTIVE_LIST', false, true, isExtensionDryRun());
126 // Update notes (these will be set as task text!)
127 setExtensionUpdateNotes("Filter für den "Wer ist Online" Block hinzugefügt und ist von <strong>online</strong> abhängig.");
132 case 'modify': // When the extension got modified
135 case 'test': // For testing purposes
138 case 'init': // Do stuff when extension is initialized
141 default: // Unknown extension mode
142 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));