X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffilter%2Fforced_filter.php;h=b731596c3e60affb68fb4b5376bc79574c2c79de;hb=e5dffd4249c97200cbad02f3f4eaf5c373fdb89a;hp=4b69b26547e749ec2690c3c078bde76cfc573050;hpb=2379934be6a196a54f4155bb8e24c49b20736969;p=mailer.git diff --git a/inc/filter/forced_filter.php b/inc/filter/forced_filter.php index 4b69b26547..b731596c3e 100644 --- a/inc/filter/forced_filter.php +++ b/inc/filter/forced_filter.php @@ -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 * @@ -41,40 +41,106 @@ if (!defined('__SECURITY')) { } // END - if // Filter to add default forced-ad types -function FILTER_FORCED_AD_TYPE_DEFAULTS ($data) { +function FILTER_FORCED_AD_TYPE_DEFAULTS ($filterData) { + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); // Forced-Banner - $data[] = array( - 'type' => 'BANNER', - ); - - // Forced-Textlinks - $data[] = array( - 'type' => 'TEXTLINK', - ); - - // Forced-Popups - $data[] = array( - 'type' => 'POPUP', + array_push( + $filterData, + array( + // Forced-Banner + 'type' => 'BANNER', + ), array( + // Forced-Textlinks + 'type' => 'TEXTLINK', + ), array( + // Forced-PopUp + 'type' => 'POPUP', + ) ); // Return data - return $data; + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $filterData; } // Filter for collecting data for the member table function FILTER_FORCED_POPUP_TABLE_DATA ($filterData) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); // Is this the right filter? - if ($filterData['earning_name'] == 'FORCED_POPUP') { + if ($filterData['earning_provider'] == 'FORCED_POPUP') { // Set group $filterData['earning_group'] = 'POPUP'; // Get max/min/count of all popups - //die(__FUNCTION__.':OK!'); + // @TODO This part is unfinished + die(__FUNCTION__ . ':filterData=
' . print_r($filterData, TRUE) . '
'); } // END - if - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); // Return filter data array + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $filterData; +} + +// Filter for changing URL status +function FILTER_FORCED_CHANGE_CAMPAIGN_STATUS ($filterData) { + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); + /* + // Do some dirty fixing here: + if (($filterData['data']['forced_campaign_status'] == 'STOPPED') && ($filterData['new_status'] == 'pending')) { + // Fix for template change + $filterData['new_status'] = 'continued'; + } // END - if + */ + + // Send admin notification + doForcedNotifyAdmin('campaign_' . strtolower($filterData['data']['forced_campaign_status']) . '_' . $filterData['new_status'], $filterData['data']); + + // Send user notification + doForcedNotifyMember('campaign_' . strtolower($filterData['data']['forced_campaign_status']) . '_' . $filterData['new_status'], $filterData['data']); + + // Return filter data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $filterData; +} + +// Filter for validating status +function FILTER_FORCED_CHANGE_CAMPAIGN_VALIDATE_DATA ($filterData) { + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); + // Is the new status set? + if ((!is_string($filterData['new_status'])) || (empty($filterData['new_status']))) { + // Abort here, not fine + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'newStatus[' . gettype($filterData['new_status']) . ']=' . $filterData['new_status'] . ' - EXIT!'); + $GLOBALS['filter_chain_aborted'] = FALSE; + } elseif ($filterData['data']['forced_campaign_status'] != $filterData['prev_status']) { + // Status is not like prevStatus + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $filterData['data']['forced_campaign_status'] . '!=' . $filterData['prev_status'] . ' - EXIT!'); + $GLOBALS['filter_chain_aborted'] = FALSE; + } // END - if + + // Return filter data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $filterData; +} + +// Filter for handling click on forced ad +function FILTER_HANDLE_FORCED_AD_CLICK ($filterData) { + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); + // Are all required parameters set? + die(__FUNCTION__ . ': filterData=
' . print_r($filterData, TRUE) . '
'); + + // Return filter data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $filterData; +} + +// Filter for handling viewing forced banner +function FILTER_HANDLE_FORCED_AD_VIEW ($filterData) { + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); + // Are all required parameters set? + die(__FUNCTION__ . ': filterData=
' . print_r($filterData, TRUE) . '
'); + + // Return filter data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); return $filterData; }