2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 07/27/2011 *
4 * =================== Last change: 07/27/2011 *
6 * -------------------------------------------------------------------- *
7 * File : forced_filter.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Filters for ext-forced *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Filter fuer ext-forced *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2013 by Mailer Developer Team *
20 * For more information visit: http://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')) {
43 // Filter to add default forced-ad types
44 function FILTER_FORCED_AD_TYPE_DEFAULTS ($filterData) {
45 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
62 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
66 // Filter for collecting data for the member table
67 function FILTER_FORCED_POPUP_TABLE_DATA ($filterData) {
68 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
69 // Is this the right filter?
70 if ($filterData['earning_provider'] == 'FORCED_POPUP') {
72 $filterData['earning_group'] = 'POPUP';
74 // Get max/min/count of all popups
75 // @TODO This part is unfinished
76 die(__FUNCTION__ . ':filterData=<pre>' . print_r($filterData, TRUE) . '</pre>');
79 // Return filter data array
80 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
84 // Filter for changing URL status
85 function FILTER_FORCED_CHANGE_CAMPAIGN_STATUS ($filterData) {
86 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
88 // Do some dirty fixing here:
89 if (($filterData['data']['forced_campaign_status'] == 'STOPPED') && ($filterData['new_status'] == 'pending')) {
90 // Fix for template change
91 $filterData['new_status'] = 'continued';
95 // Send admin notification
96 doForcedNotifyAdmin('campaign_' . strtolower($filterData['data']['forced_campaign_status']) . '_' . $filterData['new_status'], $filterData['data']);
98 // Send user notification
99 doForcedNotifyMember('campaign_' . strtolower($filterData['data']['forced_campaign_status']) . '_' . $filterData['new_status'], $filterData['data']);
101 // Return filter data
102 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
106 // Filter for validating status
107 function FILTER_FORCED_CHANGE_CAMPAIGN_VALIDATE_DATA ($filterData) {
108 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
109 // Is the new status set?
110 if ((!is_string($filterData['new_status'])) || (empty($filterData['new_status']))) {
111 // Abort here, not fine
112 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'newStatus[' . gettype($filterData['new_status']) . ']=' . $filterData['new_status'] . ' - EXIT!');
113 interruptFilterChain();
114 } elseif ($filterData['data']['forced_campaign_status'] != $filterData['prev_status']) {
115 // Status is not like prevStatus
116 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $filterData['data']['forced_campaign_status'] . '!=' . $filterData['prev_status'] . ' - EXIT!');
117 continueFilterChain();
120 // Return filter data
121 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
125 // Filter for handling click on forced ad
126 function FILTER_HANDLE_FORCED_AD_CLICK ($filterData) {
127 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
128 // Are all required parameters set?
129 die(__FUNCTION__ . ': filterData=<pre>' . print_r($filterData, TRUE) . '</pre>');
131 // Return filter data
132 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
136 // Filter for handling viewing forced banner
137 function FILTER_HANDLE_FORCED_AD_VIEW ($filterData) {
138 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
139 // Are all required parameters set?
140 die(__FUNCTION__ . ': filterData=<pre>' . print_r($filterData, TRUE) . '</pre>');
142 // Return filter data
143 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');