2 /************************************************************************
3 * MXChange v0.2.1 Start: 03/05/2005 *
4 * ================ Last change: 03/05/2005 *
6 * -------------------------------------------------------------------- *
7 * File : ext-mediadata.php *
8 * -------------------------------------------------------------------- *
9 * Short description : More details media data *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Mehr detailiertere Mediendaten *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * Needs to be in all Files and every File needs "svn propset *
18 * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
19 * -------------------------------------------------------------------- *
20 * Copyright (c) 2003 - 2009 by Roland Haeder *
21 * For more information visit: http://www.mxchange.org *
23 * This program is free software; you can redistribute it and/or modify *
24 * it under the terms of the GNU General Public License as published by *
25 * the Free Software Foundation; either version 2 of the License, or *
26 * (at your option) any later version. *
28 * This program is distributed in the hope that it will be useful, *
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
31 * GNU General Public License for more details. *
33 * You should have received a copy of the GNU General Public License *
34 * along with this program; if not, write to the Free Software *
35 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
37 ************************************************************************/
39 // Some security stuff...
40 if (!defined('__SECURITY')) {
45 setThisExtensionVersion('0.0.9');
47 // Version history array (add more with , '0.1.0' and so on)
48 setExtensionVersionHistory(array('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'));
50 // Keep this extension always active!
51 setExtensionAlwaysActive('Y');
53 switch (getExtensionMode()) {
54 case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
55 // SQL commands to run
59 registerFilter('add_points', 'UPDATE_MEDIADATA_ENTRY', false, true, getExtensionDryRun());
60 registerFilter('sub_points', 'UPDATE_MEDIADATA_ENTRY', false, true, getExtensionDryRun());
63 case 'remove': // Do stuff when removing extension
64 // SQL commands to run
65 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_mediadata`");
66 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_mediadata'");
67 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='mediadata'");
70 unregisterFilter('add_points', 'UPDATE_MEDIADATA_ENTRY', false, true, getExtensionDryRun());
71 unregisterFilter('sub_points', 'UPDATE_MEDIADATA_ENTRY', false, true, getExtensionDryRun());
74 case 'activate': // Do stuff when admin activates this extension
75 // SQL commands to run
79 case 'deactivate': // Do stuff when admin deactivates this extension
80 // SQL commands to run
84 case 'update': // Update an extension
85 switch (getCurrentExtensionVersion()) {
86 case '0.0.1': // SQL queries for v0.0.1
87 // Update notes (these will be set as task text!)
88 setExtensionUpdateNotes("Berechnung der Gesamt-{?POINTS?} korregiert.");
91 case '0.0.2': // SQL queries for v0.0.2
92 // Update notes (these will be set as task text!)
93 setExtensionUpdateNotes("Daten des Scriptes mit eingebunden.");
96 case '0.0.3': // SQL queries for v0.0.3
97 // Update notes (these will be set as task text!)
98 setExtensionUpdateNotes("Sicherheitsupdate: SQL-Anweisungen geschützt.");
101 case '0.0.4': // SQL queries for v0.0.4
102 // SQL commands to run
103 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_mediadata`");
104 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_mediadata` (
105 `media_key` VARCHAR(255) NOT NULL DEFAULT '',
106 `media_value` VARCHAR(255) NOT NULL DEFAULT '',
107 PRIMARY KEY (media_key)
108 ) TYPE={?_TABLE_TYPE?}");
110 // Add auto-check file
111 addIncludeToPool('extension', 'inc/gen_mediadata.php');
113 // Update notes (these will be set as task text!)
114 setExtensionUpdateNotes("Teile der Mediendaten werden in seperater Tabelle gesichert. Bitte beachten Sie, dass dieses Update nur Daten des <strong>aktuellen</strong> Zustandes berücksichtigen kann und <strong>nicht</strong> bereits gelöschter Mitglieder.");
117 case '0.0.5': // SQL queries for v0.0.5
118 // Update notes (these will be set as task text!)
119 setExtensionUpdateNotes("if-Anweisungen auf Funktion <strong>empty()</strong> umgestellt.");
122 case '0.0.6': // SQL queries for v0.0.6
123 // Update notes (these will be set as task text!)
124 setExtensionUpdateNotes("Mediendaten mussten komplett regeneriert werden.");
127 case '0.0.7': // SQL queries for v0.0.7
128 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `mt_start` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
129 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `mt_stage` BIGINT(20) UNSIGNED NOT NULL DEFAULT '500'");
130 addAdminMenuSql('setup','config_mediadata','Mediendaten','Stellen Sie allgemeine Einstellungen zu den Mediendaten ein.', 10);
132 // Update notes (these will be set as task text!)
133 setExtensionUpdateNotes("Start des {?mt_word2?} und Anzahl Anmeldungen aufgenommen. (Task #13)<br />
134 Bitte stellen Sie diesen derzeit manuell unter <a href=\"{?URL?}/modules.php?module=admin&what=config_mediadata\">Einstellungen-Medidata</a> selber einstellen.");
137 case '0.0.8': // SQL queries for v0.0.8
138 // Update notes (these will be set as task text!)
139 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
142 case '0.0.9': // SQL queries for v0.0.9
143 addGuestMenuSql('main','mediadata','Mediendaten','N','N',3);
145 // Update notes (these will be set as task text!)
146 setExtensionUpdateNotes("Menüpunkt wird durch diese Erweiterung generiert.");
151 case 'modify': // When the extension got modified
154 case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
157 case 'init': // Do stuff when extension is initialized
160 default: // Unknown extension mode
161 DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));