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 - 2012 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 ($data) {
64 // Filter for collecting data for the member table
65 function FILTER_FORCED_POPUP_TABLE_DATA ($filterData) {
66 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
67 // Is this the right filter?
68 if ($filterData['earning_provider'] == 'FORCED_POPUP') {
70 $filterData['earning_group'] = 'POPUP';
72 // Get max/min/count of all popups
73 // @TODO This part is unfinished
74 //die(__FUNCTION__.':OK!');
77 // Return filter data array
78 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
82 // Filter for changing URL status
83 function FILTER_FORCED_CHANGE_CAMPAIGN_STATUS ($filterData) {
85 // Do some dirty fixing here:
86 if (($filterData['data']['forced_campaign_status'] == 'STOPPED') && ($filterData['new_status'] == 'pending')) {
87 // Fix for template change
88 $filterData['new_status'] = 'continued';
92 // Send admin notification
93 doForcedNotifyAdmin('campaign_' . strtolower($filterData['data']['forced_campaign_status']) . '_' . $filterData['new_status'], $filterData['data']);
95 // Send user notification
96 doForcedNotifyMember('campaign_' . strtolower($filterData['data']['forced_campaign_status']) . '_' . $filterData['new_status'], $filterData['data']);
99 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
103 // Filter for validating status
104 function FILTER_FORCED_CHANGE_CAMPAIGN_VALIDATE_DATA ($filterData) {
105 // Is the new status set?
106 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
107 if ((!is_string($filterData['new_status'])) || (empty($filterData['new_status']))) {
108 // Abort here, not fine
109 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'newStatus[' . gettype($filterData['new_status']) . ']=' . $filterData['new_status'] . ' - EXIT!');
110 $filterData['abort'] = FALSE;
111 } elseif ($filterData['data']['forced_campaign_status'] != $filterData['prev_status']) {
112 // Status is not like prevStatus
113 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $filterData['data']['forced_campaign_status'] . '!=' . $filterData['prev_status'] . ' - EXIT!');
114 $filterData['abort'] = FALSE;
117 // Return filter data
118 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
122 // Filter for handling click on forced ad
123 function FILTER_HANDLE_FORCED_AD_CLICK ($filterData) {
124 // Are all required parameters set?
125 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
126 die(__FUNCTION__.': CALLED!');
128 // Return filter data
129 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
133 // Filter for handling viewing forced banner
134 function FILTER_HANDLE_FORCED_AD_VIEW ($filterData) {
135 // Are all required parameters set?
136 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
137 die(__FUNCTION__.': CALLED!');
139 // Return filter data
140 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');