89541f5506a554ef5e6b86e843e036815b4c7c6b
[mailer.git] / inc / extensions / ext-active.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 10/03/2004 *
4  * ===================                          Last change: 11/26/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : ext-active.php                                   *
8  * -------------------------------------------------------------------- *
9  * Short description : "Last active users"                              *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : "Zuletzt aktiv gewesenen Mitglieder              *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
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                      *
21  *                                                                      *
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.                                  *
26  *                                                                      *
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.                         *
31  *                                                                      *
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,               *
35  * MA  02110-1301  USA                                                  *
36  ************************************************************************/
37
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
40         die();
41 } // END - if
42
43 // Version number
44 setThisExtensionVersion('0.0.9');
45
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'));
48
49 switch (getExtensionMode()) {
50         case 'register': // Do stuff when installation is running
51                 // SQL commands to run
52                 addGuestMenuSql('main', 'active', 'Heute Online', 10);
53                 break;
54
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'");
59
60                 // Unregister filter
61                 unregisterFilter(__FILE__, __LINE__, 'online_extra_links', 'ADD_LINK_ACTIVE_LIST', TRUE, isExtensionDryRun());
62                 break;
63
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");
67                 break;
68
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");
72                 break;
73
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&auml;ndert.");
79                                 break;
80
81                         case '0.0.2': // SQL queries for v0.0.2
82                                 // Update notes (these will be set as task text!)
83                                 setExtensionUpdateNotes("Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
84                                 break;
85
86                         case '0.0.3': // SQL queries for v0.0.3
87                                 // Update notes (these will be set as task text!)
88                                 setExtensionUpdateNotes("Design &quot;Solid-Business&quot; eingebaut.");
89                                 break;
90
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> &uuml;berfl&uuml;ssige HTML-Tags entfernt.");
94                                 break;
95
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);
99
100                                 // Update notes (these will be set as task text!)
101                                 setExtensionUpdateNotes("Aktiven-Liste im Gastbereich ist nun einschr&auml;nkbar.");
102                                 break;
103
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&uuml;tzt.");
107                                 break;
108
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.");
112                                 break;
113
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.");
117                                 break;
118
119                         case '0.0.9': // SQL queries for v0.0.9
120                                 // Make update depending on ext-online
121                                 addExtensionDependency('online');
122
123                                 // Register filter
124                                 registerFilter(__FILE__, __LINE__, 'online_extra_links', 'ADD_LINK_ACTIVE_LIST', FALSE, TRUE, isExtensionDryRun());
125
126                                 // Update notes (these will be set as task text!)
127                                 setExtensionUpdateNotes("Filter f&uuml;r den &quot;Wer ist Online&quot; Block hinzugef&uuml;gt und ist von <strong>online</strong> abh&auml;ngig.");
128                                 break;
129                 } // END - switch
130                 break;
131
132         case 'modify': // When the extension got modified
133                 break;
134
135         case 'test': // For testing purposes
136                 break;
137
138         case 'init': // Do stuff when extension is initialized
139                 break;
140
141         default: // Unknown extension mode
142                 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
143                 break;
144 } // END - switch
145
146 // [EOF]
147 ?>