]> git.mxchange.org Git - mailer.git/blob - inc/filter/forced_filter.php
Updated copyright notice as there are changes in this year
[mailer.git] / inc / filter / forced_filter.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 07/27/2011 *
4  * ===================                          Last change: 07/27/2011 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : forced_filter.php                                *
8  * -------------------------------------------------------------------- *
9  * Short description : Filters for ext-forced                           *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Filter fuer ext-forced                           *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
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                      *
21  *                                                                      *
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.                                  *
26  *                                                                      *
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.                         *
31  *                                                                      *
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,               *
35  * MA  02110-1301  USA                                                  *
36  ************************************************************************/
37
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
40         die();
41 } // END - if
42
43 // Filter to add default forced-ad types
44 function FILTER_FORCED_AD_TYPE_DEFAULTS ($data) {
45         // Forced-Banner
46         array_push(
47                 $data,
48                 array(
49                         // Forced-Banner
50                         'type' => 'BANNER',
51                 ), array(
52                         // Forced-Textlinks
53                         'type' => 'TEXTLINK',
54                 ), array(
55                         // Forced-PopUp
56                         'type' => 'POPUP',
57                 )
58         );
59
60         // Return data
61         return $data;
62 }
63
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') {
69                 // Set group
70                 $filterData['earning_group'] = 'POPUP';
71
72                 // Get max/min/count of all popups
73                 // @TODO This part is unfinished
74                 //die(__FUNCTION__.':OK!');
75         } // END - if
76
77         // Return filter data array
78         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
79         return $filterData;
80 }
81
82 // Filter for changing URL status
83 function FILTER_FORCED_CHANGE_CAMPAIGN_STATUS ($filterData) {
84         /*
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';
89         } // END - if
90         */
91
92         // Send admin notification
93         doForcedNotifyAdmin('campaign_' . strtolower($filterData['data']['forced_campaign_status']) . '_' . $filterData['new_status'], $filterData['data']);
94
95         // Send user notification
96         doForcedNotifyMember('campaign_' . strtolower($filterData['data']['forced_campaign_status']) . '_' . $filterData['new_status'], $filterData['data']);
97
98         // Return filter data
99         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
100         return $filterData;
101 }
102
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;
115         } // END - if
116
117         // Return filter data
118         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
119         return $filterData;
120 }
121
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!');
127
128         // Return filter data
129         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
130         return $filterData;
131 }
132
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!');
138
139         // Return filter data
140         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
141         return $filterData;
142 }
143
144 // [EOF]
145 ?>