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 * -------------------------------------------------------------------- *
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.0.9');
46 // Version history array (add more with , '0.1.0' and so on)
47 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'));
49 // Keep this extension always active!
50 setExtensionAlwaysActive('Y');
52 switch (getExtensionMode()) {
53 case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
54 // SQL commands to run
58 registerFilter('add_points', 'UPDATE_MEDIADATA_ENTRY', false, true, isExtensionDryRun());
59 registerFilter('sub_points', 'UPDATE_MEDIADATA_ENTRY', false, true, isExtensionDryRun());
62 case 'remove': // Do stuff when removing extension
63 // SQL commands to run
64 addDropTableSql('mediadata');
65 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_mediadata'");
66 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='mediadata'");
69 unregisterFilter(__FUNCTION__, __LINE__, 'add_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun());
70 unregisterFilter(__FUNCTION__, __LINE__, 'sub_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun());
73 case 'activate': // Do stuff when admin activates this extension
74 // SQL commands to run
75 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='Y', `locked`='N' WHERE `what`='mediadata' LIMIT 1");
78 case 'deactivate': // Do stuff when admin deactivates this extension
79 // SQL commands to run
80 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='N', `locked`='Y' WHERE `what`='mediadata' LIMIT 1");
83 case 'update': // Update an extension
84 switch (getCurrentExtensionVersion()) {
85 case '0.0.1': // SQL queries for v0.0.1
86 // Update notes (these will be set as task text!)
87 setExtensionUpdateNotes("Berechnung der Gesamt-{?POINTS?} korregiert.");
90 case '0.0.2': // SQL queries for v0.0.2
91 // Update notes (these will be set as task text!)
92 setExtensionUpdateNotes("Daten des Scriptes mit eingebunden.");
95 case '0.0.3': // SQL queries for v0.0.3
96 // Update notes (these will be set as task text!)
97 setExtensionUpdateNotes("Sicherheitsupdate: SQL-Anweisungen geschützt.");
100 case '0.0.4': // SQL queries for v0.0.4
101 // SQL commands to run
102 addDropTableSql('mediadata');
103 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_mediadata` (
104 `media_key` VARCHAR(255) NOT NULL DEFAULT '',
105 `media_value` VARCHAR(255) NOT NULL DEFAULT '',
106 PRIMARY KEY (`media_key`)
107 ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
109 // Add auto-check file
110 addIncludeToPool('extension', 'inc/gen_mediadata.php');
112 // Update notes (these will be set as task text!)
113 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.");
116 case '0.0.5': // SQL queries for v0.0.5
117 // Update notes (these will be set as task text!)
118 setExtensionUpdateNotes("if-Anweisungen auf Funktion <strong>empty()</strong> umgestellt.");
121 case '0.0.6': // SQL queries for v0.0.6
122 // Update notes (these will be set as task text!)
123 setExtensionUpdateNotes("Mediendaten mussten komplett regeneriert werden.");
126 case '0.0.7': // SQL queries for v0.0.7
127 addConfigAddSql('mt_start', "BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
128 addConfigAddSql('mt_stage', "BIGINT(20) UNSIGNED NOT NULL DEFAULT 500");
129 addAdminMenuSql('setup', 'config_mediadata', 'Mediendaten', 'Stellen Sie allgemeine Einstellungen zu den Mediendaten ein.', 10);
131 // Update notes (these will be set as task text!)
132 setExtensionUpdateNotes("Start des {?mt_word2?} und Anzahl Anmeldungen aufgenommen. (Task #13)<br />
133 Bitte stellen Sie diesen derzeit manuell unter <a href=\"%url=modules.php?module=admin&what=config_mediadata%}\">Einstellungen-Medidata</a> selber einstellen.");
136 case '0.0.8': // SQL queries for v0.0.8
137 // Update notes (these will be set as task text!)
138 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
141 case '0.0.9': // SQL queries for v0.0.9
142 addGuestMenuSql('main','mediadata','Mediendaten','N','N',3);
144 // Update notes (these will be set as task text!)
145 setExtensionUpdateNotes("Menüpunkt wird durch diese Erweiterung generiert.");
150 case 'modify': // When the extension got modified
153 case 'test': // For testing purposes
156 case 'init': // Do stuff when extension is initialized
159 default: // Unknown extension mode
160 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));