]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-mediadata.php
Updated copyright notice as there are changes in this year
[mailer.git] / inc / extensions / ext-mediadata.php
index 9d41c9e9f8ff9f3eab1fa436aca744e8ccd224fc..1a2b99b5b3f467dab39c13ea6e9c4aa6bb14a9cf 100644 (file)
@@ -16,8 +16,8 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -50,13 +50,13 @@ setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0
 setExtensionAlwaysActive('Y');
 
 switch (getExtensionMode()) {
-       case 'register': // Do stuff when installation is running
+       case 'setup': // Do stuff when installation is running
                // SQL commands to run
                addExtensionSql('');
 
                // Add the filters
-               registerFilter('post_add_points', 'UPDATE_MEDIADATA_ENTRY', false, true, isExtensionDryRun());
-               registerFilter('sub_points', 'UPDATE_MEDIADATA_ENTRY', false, true, isExtensionDryRun());
+               registerFilter(__FILE__, __LINE__, 'post_add_points', 'UPDATE_MEDIADATA_ENTRY', FALSE, TRUE, isExtensionDryRun());
+               registerFilter(__FILE__, __LINE__, 'post_sub_points', 'UPDATE_MEDIADATA_ENTRY', FALSE, TRUE, isExtensionDryRun());
                break;
 
        case 'remove': // Do stuff when removing extension
@@ -66,18 +66,18 @@ switch (getExtensionMode()) {
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='mediadata'");
 
                // Remove the filters
-               unregisterFilter(__FUNCTION__, __LINE__, 'post_add_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun());
-               unregisterFilter(__FUNCTION__, __LINE__, 'sub_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'post_add_points', 'UPDATE_MEDIADATA_ENTRY', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'post_sub_points', 'UPDATE_MEDIADATA_ENTRY', TRUE, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
                // SQL commands to run
-               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='Y', `locked`='N' WHERE `what`='mediadata' LIMIT 1");
+               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='Y',`locked`='N' WHERE `what`='mediadata' LIMIT 1");
                break;
 
        case 'deactivate': // Do stuff when admin deactivates this extension
                // SQL commands to run
-               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='N', `locked`='Y' WHERE `what`='mediadata' LIMIT 1");
+               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='N',`locked`='Y' WHERE `what`='mediadata' LIMIT 1");
                break;
 
        case 'update': // Update an extension
@@ -100,11 +100,11 @@ switch (getExtensionMode()) {
                        case '0.0.4': // SQL queries for v0.0.4
                                // SQL commands to run
                                addDropTableSql('mediadata');
-                               addCreateTableSql('mediadata', "(
+                               addCreateTableSql('mediadata', "
 `media_key` VARCHAR(255) NOT NULL DEFAULT '',
 `media_value` VARCHAR(255) NOT NULL DEFAULT '',
-PRIMARY KEY (`media_key`)
-) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Media data key->value'");
+PRIMARY KEY (`media_key`)",
+                                       'Media data key->value');
 
                                // Add auto-check file
                                addIncludeToPool('extension', 'inc/gen_mediadata.php');
@@ -139,7 +139,7 @@ Bitte stellen Sie diesen derzeit manuell unter <a href=\"%url=modules.php?module
                                break;
 
                        case '0.0.9': // SQL queries for v0.0.9
-                               addGuestMenuSql('main','mediadata','Mediendaten','N','N',3);
+                               addGuestMenuSql('main', 'mediadata', 'Mediendaten', 3);
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Men&uuml;punkt wird durch diese Erweiterung generiert.");
@@ -157,7 +157,7 @@ Bitte stellen Sie diesen derzeit manuell unter <a href=\"%url=modules.php?module
                break;
 
        default: // Unknown extension mode
-               logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
+               reportBug(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
                break;
 } // END - switch