X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fextensions%2Fext-forced.php;h=3a2aae3141bb7f9e35c39935b8094c1e009ad142;hb=6dcb879ba3abb21843503cacc65d1fe0848eb90f;hp=090eeb094523be84471d27c23de454fe4ce5909e;hpb=2893f02bfa15bfcedda7310109e929ac7486d3be;p=mailer.git diff --git a/inc/extensions/ext-forced.php b/inc/extensions/ext-forced.php index 090eeb0945..3a2aae3141 100644 --- a/inc/extensions/ext-forced.php +++ b/inc/extensions/ext-forced.php @@ -8,18 +8,16 @@ * -------------------------------------------------------------------- * * Short description : Clickable forced banner or text links * * -------------------------------------------------------------------- * - * Kurzbeschreibung : * + * Kurzbeschreibung : Klickbare Forced-Banner oder -Textlinks * * -------------------------------------------------------------------- * * $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 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2016 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 * @@ -43,21 +41,43 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.0'); +setThisExtensionVersion('0.0.0'); -// Version history array (add more with , '0.1.0' and so on) -setExtensionVersionHistory(array('0.0')); +// Version history array (add more with , '0.0.1' and so on) +setExtensionVersionHistory(array('0.0.0')); // This extension is in development (non-productive) -enableExtensionProductive(false); +enableExtensionProductive(FALSE); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) - // SQL commands to run + case 'setup': // Do stuff when installation is running break; case 'remove': // Do stuff when removing extension // SQL commands to run + addDropTableSql('forced_ads'); + addDropTableSql('forced_network'); + addDropTableSql('forced_campaigns'); + addDropTableSql('forced_costs'); + addDropTableSql('forced_stats'); + + // Menu systems + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='forced'"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what` LIKE '%forced%'"); + + // Is ext-earning there? + if (isExtensionInstalled('earning')) { + // Unregister Forced-PopUps from ext-earning + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_earning_data` WHERE `earning_provider`='FORCED_POPUP' LIMIT 1"); + } // END - if + + // Remove filter + unregisterFilter(__FILE__, __LINE__, 'add_forced_ads_types', 'FORCED_AD_TYPE_DEFAULTS', TRUE, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'member_earning_table_data', 'FORCED_POPUP_TABLE_DATA', TRUE, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'post_change_forced_campaign_status', 'FORCED_CHANGE_CAMPAIGN_STATUS', TRUE, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'pre_change_forced_campaign_status', 'FORCED_CHANGE_CAMPAIGN_VALIDATE_DATA', TRUE, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'handle_click_php', 'HANDLE_FORCED_AD_CLICK', TRUE, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'handle_view_php', 'HANDLE_FORCED_AD_VIEW', TRUE, isExtensionDryRun()); break; case 'activate': // Do stuff when admin activates this extension @@ -82,14 +102,14 @@ switch (getExtensionMode()) { case 'modify': // When the extension got modified break; - case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305. + case 'test': // For testing purposes break; case 'init': // Do stuff when extension is initialized 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