X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fextensions%2Fext-mediadata.php;h=110e297e995cd7ec3e268f8c50dc058ac1cd86e6;hb=de5ae633b5cafff852eb6d58505d609c87c5a803;hp=072650affa477d047b662a54a10d79d2adab5e39;hpb=307a4e11763f0914e73dc756b219356e1c29ab25;p=mailer.git
diff --git a/inc/extensions/ext-mediadata.php b/inc/extensions/ext-mediadata.php
index 072650affa..110e297e99 100644
--- a/inc/extensions/ext-mediadata.php
+++ b/inc/extensions/ext-mediadata.php
@@ -10,7 +10,12 @@
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Mehr detailiertere Mediendaten *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2008 by Roland Haeder *
* For more information visit: http://www.mxchange.org *
@@ -32,123 +37,125 @@
************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])))
-{
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+if (!defined('__SECURITY')) {
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
}
// Version number
-$EXT_VERSION = "0.0.8";
+EXT_SET_VERSION('0.0.9');
-// Auto-set extension version
-if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
-
-// Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = 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");
+// Version history array (add more with , '0.1.0' and so on)
+EXT_SET_VER_HISTORY(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'));
switch ($EXT_LOAD_MODE)
{
-case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
- // SQL commands to run
- $SQLs[] = "";
- break;
-
-case "remove": // Do stuff when removing extension
- // SQL commands to run
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_mediadata";
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_mediadata' LIMIT 1";
- break;
-
-case "activate": // Do stuff when admin activates this extension
- // SQL commands to run
- $SQLs[] = "";
- break;
-
-case "deactivate": // Do stuff when admin deactivates this extension
- // SQL commands to run
- $SQLs[] = "";
- break;
-
-case "update": // Update an extension
- switch ($EXT_VER)
- {
- case "0.0.1": // SQL queries for v0.0.1
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Berechnung der Gesamt-{!POINTS!} korregiert.";
- break;
-
- case "0.0.2": // SQL queries for v0.0.2
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Daten des Scriptes mit eingebunden.";
+ case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
+ // SQL commands to run
+ ADD_EXT_SQL('');
break;
- case "0.0.3": // SQL queries for v0.0.3
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Sicherheitsupdate: SQL-Anweisungen geschützt.";
+ case 'remove': // Do stuff when removing extension
+ // SQL commands to run
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_mediadata`");
+ ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_mediadata'");
+ ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='mediadata'");
break;
- case "0.0.4": // SQL queries for v0.0.4
+ case 'activate': // Do stuff when admin activates this extension
// SQL commands to run
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_mediadata";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_mediadata (
-media_key varchar(255) not null default '',
-media_value varchar(255) not null default '',
-PRIMARY KEY(media_key)
-) TYPE=MyISAM";
-
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Teile der Mediendaten werden in seperater Tabelle gesichert. Bitte beachten Sie, dass dieses Update nur Daten des aktuellen Zustandes berücksichtigen kann und nicht bereits gelöschter Mitglieder.";
+ ADD_EXT_SQL('');
break;
- case "0.0.5": // SQL queries for v0.0.5
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "if-Anweisungen auf Funktion empty() umgestellt.";
+ case 'deactivate': // Do stuff when admin deactivates this extension
+ // SQL commands to run
+ ADD_EXT_SQL('');
break;
- case "0.0.6": // SQL queries for v0.0.6
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Mediendaten mussten komplett regeneriert werden.";
+ case 'update': // Update an extension
+ switch ($EXT_VER)
+ {
+ case '0.0.1': // SQL queries for v0.0.1
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Berechnung der Gesamt-{!POINTS!} korregiert.");
+ break;
+
+ case '0.0.2': // SQL queries for v0.0.2
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Daten des Scriptes mit eingebunden.");
+ break;
+
+ case '0.0.3': // SQL queries for v0.0.3
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Sicherheitsupdate: SQL-Anweisungen geschützt.");
+ break;
+
+ case '0.0.4': // SQL queries for v0.0.4
+ // SQL commands to run
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_mediadata`");
+ ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_mediadata` (
+media_key VARCHAR(255) NOT NULL DEFAULT '',
+media_value VARCHAR(255) NOT NULL DEFAULT '',
+PRIMARY KEY(media_key)
+) TYPE={!_TABLE_TYPE!}");
+
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Teile der Mediendaten werden in seperater Tabelle gesichert. Bitte beachten Sie, dass dieses Update nur Daten des aktuellen Zustandes berücksichtigen kann und nicht bereits gelöschter Mitglieder.");
+ break;
+
+ case '0.0.5': // SQL queries for v0.0.5
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("if-Anweisungen auf Funktion empty() umgestellt.");
+ break;
+
+ case '0.0.6': // SQL queries for v0.0.6
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Mediendaten mussten komplett regeneriert werden.");
+ break;
+
+ case '0.0.7': // SQL queries for v0.0.7
+ ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD mt_start BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD mt_stage BIGINT(20) UNSIGNED NOT NULL DEFAULT '500'");
+ ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_mediadata','Mediendaten','Stellen Sie allgemeine Einstellungen zu den Mediendaten ein.', 10)");
+
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Start des {!MT_WORD2!} und Anzahl Anmeldungen aufgenommen. (Task #13)
+Bitte stellen Sie diesen derzeit manuell unter Einstellungen-Medidata selber einstellen.");
+ break;
+
+ case '0.0.8': // SQL queries for v0.0.8
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
+ break;
+
+ case '0.0.9': // SQL queries for v0.0.9
+ ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','mediadata','Mediendaten',3,'Y','N')");
+
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Menüpunkt wird durch diese Erweiterung generiert.");
+ break;
+ }
break;
- case "0.0.7": // SQL queries for v0.0.7
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_start bigint(20) not null default '0'";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_stage bigint(20) not null default '500'";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES('setup', 'config_mediadata', 'Mediendaten', 'Stellen Sie allgemeine Einstellungen zu den Mediendaten ein.', 10)";
+ case 'modify': // When the extension got modified
+ break;
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Start des ".MT_WORD2." und Anzahl Anmeldungen aufgenommen. (Task #13)
-Bitte stellen Sie diesen derzeit manuell unter Einstellungen-Medidata selber einstellen.";
- break;
+ case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+ break;
- case "0.0.8": // SQL queries for v0.0.8
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
- break;
- }
- break;
-
-default: // Do stuff when extension is loaded
- $dummy = LOAD_CONFIG();
- $_CONFIG = array_merge($_CONFIG, $dummy);
- unset($dummy);
- break;
+ default: // Do stuff when extension is loaded
+ break;
}
-if ((isset($dry_run)) && (isset($EXT_LOAD_MODE)))
-{
- if ((!$dry_run) && ($EXT_LOAD_MODE == "update") && ($EXT_VER == "0.0.4"))
- {
+if ((isset($dry_run)) && (isset($EXT_LOAD_MODE))) {
+ if ((!$dry_run) && ($EXT_LOAD_MODE == 'update') && ($EXT_VER == '0.0.4')) {
// Add auto-check file
- $INC_POOL[] = PATH."inc/gen_mediadata.php";
- }
-}
-
-// Language file prefix
-$EXT_LANG_PREFIX = "mediadata";
+ ADD_INC_TO_POOL(sprintf("%sinc/gen_mediadata.php", constant('PATH')));
+ } // END - if
+} // END - if
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "Y";
+// Keep this extension always active!
+EXT_SET_ALWAYS_ACTIVE('Y');
//
?>