2 /************************************************************************
3 * Mailer v0.2.1-FINAL 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 * Copyright (c) 2009, 2010 by Mailer Developer Team *
22 * For more information visit: http://www.mxchange.org *
24 * This program is free software; you can redistribute it and/or modify *
25 * it under the terms of the GNU General Public License as published by *
26 * the Free Software Foundation; either version 2 of the License, or *
27 * (at your option) any later version. *
29 * This program is distributed in the hope that it will be useful, *
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
32 * GNU General Public License for more details. *
34 * You should have received a copy of the GNU General Public License *
35 * along with this program; if not, write to the Free Software *
36 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
38 ************************************************************************/
40 // Some security stuff...
41 if (!defined('__SECURITY')) {
46 setThisExtensionVersion('0.0.9');
48 // Version history array (add more with , '0.1.0' and so on)
49 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'));
51 // Keep this extension always active!
52 setExtensionAlwaysActive('Y');
54 switch (getExtensionMode()) {
55 case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
56 // SQL commands to run
60 registerFilter('add_points', 'UPDATE_MEDIADATA_ENTRY', false, true, getExtensionDryRun());
61 registerFilter('sub_points', 'UPDATE_MEDIADATA_ENTRY', false, true, getExtensionDryRun());
64 case 'remove': // Do stuff when removing extension
65 // SQL commands to run
66 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_mediadata`");
67 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_mediadata'");
68 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='mediadata'");
71 unregisterFilter('add_points', 'UPDATE_MEDIADATA_ENTRY', true, getExtensionDryRun());
72 unregisterFilter('sub_points', 'UPDATE_MEDIADATA_ENTRY', true, getExtensionDryRun());
75 case 'activate': // Do stuff when admin activates this extension
76 // SQL commands to run
80 case 'deactivate': // Do stuff when admin deactivates this extension
81 // SQL commands to run
85 case 'update': // Update an extension
86 switch (getCurrentExtensionVersion()) {
87 case '0.0.1': // SQL queries for v0.0.1
88 // Update notes (these will be set as task text!)
89 setExtensionUpdateNotes("Berechnung der Gesamt-{?POINTS?} korregiert.");
92 case '0.0.2': // SQL queries for v0.0.2
93 // Update notes (these will be set as task text!)
94 setExtensionUpdateNotes("Daten des Scriptes mit eingebunden.");
97 case '0.0.3': // SQL queries for v0.0.3
98 // Update notes (these will be set as task text!)
99 setExtensionUpdateNotes("Sicherheitsupdate: SQL-Anweisungen geschützt.");
102 case '0.0.4': // SQL queries for v0.0.4
103 // SQL commands to run
104 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_mediadata`");
105 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_mediadata` (
106 `media_key` VARCHAR(255) NOT NULL DEFAULT '',
107 `media_value` VARCHAR(255) NOT NULL DEFAULT '',
108 PRIMARY KEY (media_key)
109 ) TYPE={?_TABLE_TYPE?}");
111 // Add auto-check file
112 addIncludeToPool('extension', 'inc/gen_mediadata.php');
114 // Update notes (these will be set as task text!)
115 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.");
118 case '0.0.5': // SQL queries for v0.0.5
119 // Update notes (these will be set as task text!)
120 setExtensionUpdateNotes("if-Anweisungen auf Funktion <strong>empty()</strong> umgestellt.");
123 case '0.0.6': // SQL queries for v0.0.6
124 // Update notes (these will be set as task text!)
125 setExtensionUpdateNotes("Mediendaten mussten komplett regeneriert werden.");
128 case '0.0.7': // SQL queries for v0.0.7
129 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `mt_start` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
130 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `mt_stage` BIGINT(20) UNSIGNED NOT NULL DEFAULT '500'");
131 addAdminMenuSql('setup','config_mediadata','Mediendaten','Stellen Sie allgemeine Einstellungen zu den Mediendaten ein.', 10);
133 // Update notes (these will be set as task text!)
134 setExtensionUpdateNotes("Start des {?mt_word2?} und Anzahl Anmeldungen aufgenommen. (Task #13)<br />
135 Bitte stellen Sie diesen derzeit manuell unter <a href=\"%url=modules.php?module=admin&what=config_mediadata%}\">Einstellungen-Medidata</a> selber einstellen.");
138 case '0.0.8': // SQL queries for v0.0.8
139 // Update notes (these will be set as task text!)
140 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
143 case '0.0.9': // SQL queries for v0.0.9
144 addGuestMenuSql('main','mediadata','Mediendaten','N','N',3);
146 // Update notes (these will be set as task text!)
147 setExtensionUpdateNotes("Menüpunkt wird durch diese Erweiterung generiert.");
152 case 'modify': // When the extension got modified
155 case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
158 case 'init': // Do stuff when extension is initialized
161 default: // Unknown extension mode
162 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));