RevBomb patch applied (thanks to profi-concept)
[mailer.git] / inc / modules / admin / what-config_doubler.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 02/12/2005 *
4  * ================                             Last change: 02/12/2005 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : what-config_doubler.php                          *
8  * -------------------------------------------------------------------- *
9  * Short description : Points doubler                                   *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Punkte verdoppeln                                *
12  * -------------------------------------------------------------------- *
13  * $Revision:: 856                                                    $ *
14  * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. Mär 2009)              $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author:: stelzi                                                   $ *
17  * Needs to be in all Files and every File needs "svn propset           *
18  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
19  * -------------------------------------------------------------------- *
20  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
21  * For more information visit: http://www.mxchange.org                  *
22  *                                                                      *
23  * This program is free software; you can redistribute it and/or modify *
24  * it under the terms of the GNU General Public License as published by *
25  * the Free Software Foundation; either version 2 of the License, or    *
26  * (at your option) any later version.                                  *
27  *                                                                      *
28  * This program is distributed in the hope that it will be useful,      *
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
31  * GNU General Public License for more details.                         *
32  *                                                                      *
33  * You should have received a copy of the GNU General Public License    *
34  * along with this program; if not, write to the Free Software          *
35  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
36  * MA  02110-1301  USA                                                  *
37  ************************************************************************/
38
39 // Some security stuff...
40 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
41         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
42         require($INC);
43 }
44
45 // Add description as navigation point
46 ADD_DESCR("admin", __FILE__);
47
48 if (IS_FORM_SENT()) {
49         // Replace commata with decimal dot
50         REQUEST_SET_POST('doubler_charge', REVERT_COMMA((REQUEST_POST('doubler_charge') / 100)));
51         REQUEST_SET_POST('doubler_ref'   , REVERT_COMMA((REQUEST_POST('doubler_ref') / 100)));
52         REQUEST_SET_POST('doubler_min'   , REVERT_COMMA(REQUEST_POST('doubler_min')));
53         REQUEST_SET_POST('doubler_max'   , REVERT_COMMA(REQUEST_POST('doubler_max')));
54         REQUEST_SET_POST('doubler_left'  , REVERT_COMMA(REQUEST_POST('doubler_left')));
55
56         // Save settings
57         ADMIN_SAVE_SETTINGS_POST();
58 } else {
59         // Prepare data for the template
60         // - Charge rate
61         define('__DOUBLER_CHARGE', TRANSLATE_COMMA((getConfig('doubler_charge') * 100), false));
62         // - Referal rate
63         define('__DOUBLER_REFERRAL', TRANSLATE_COMMA((getConfig('doubler_ref') * 100), false));
64         // - Minimum points to double
65         define('__DOUBLER_MINIMUM', TRANSLATE_COMMA(getConfig('doubler_min'), false));
66         // - Maximum points to double
67         define('__DOUBLER_MAXIMUM', TRANSLATE_COMMA(getConfig('doubler_max'), false));
68         // - Points left on users account after doubling
69         define('__DOUBLER_LEFT', TRANSLATE_COMMA(getConfig('doubler_left'), false));
70         // - Max payouts to check per click/reset
71         define('__DOUBLER_MAX_SENT', getConfig('doubler_max_sent'));
72         // - Group sending
73         define('__DOUBLER_GROUP_SENT', getConfig('doubler_group_sent'));
74
75         // Take points from jackpot (Y/N)
76         switch (getConfig('doubler_jackpot'))
77         {
78         case "Y":
79                 define('__DOUBLER_JACKPOT_Y', " checked=\"checked\"");
80                 define('__DOUBLER_JACKPOT_N', "");
81                 break;
82
83         case "N":
84                 define('__DOUBLER_JACKPOT_Y', "");
85                 define('__DOUBLER_JACKPOT_N', " checked=\"checked\"");
86                 break;
87         }
88
89         // Take points from own account (Y/N)
90         switch (getConfig('doubler_own'))
91         {
92         case "Y":
93                 define('__DOUBLER_OWN_Y', " checked=\"checked\"");
94                 define('__DOUBLER_OWN_N', "");
95                 break;
96
97         case "N":
98                 define('__DOUBLER_OWN_Y', "");
99                 define('__DOUBLER_OWN_N', " checked=\"checked\"");
100                 break;
101         }
102
103         // Mail send mode
104         switch (getConfig('doubler_send_mode'))
105         {
106         case "DIRECT":
107                 define('__DOUBLER_SEND_DIRECT', " checked=\"checked\"");
108                 define('__DOUBLER_SEND_RESET' , "");
109                 break;
110
111         case "RESET":
112                 define('__DOUBLER_SEND_DIRECT', "");
113                 define('__DOUBLER_SEND_RESET' , " checked=\"checked\"");
114                 break;
115         }
116
117         // Take points from own account (Y/N)
118         switch (getConfig('doubler_sent_all'))
119         {
120         case "Y":
121                 define('__DOUBLER_SENT_ALL_Y', " checked=\"checked\"");
122                 define('__DOUBLER_SENT_ALL_N', "");
123                 break;
124
125         case "N":
126                 define('__DOUBLER_SENT_ALL_Y', "");
127                 define('__DOUBLER_SENT_ALL_N', " checked=\"checked\"");
128                 break;
129         }
130
131         // Transfer options (!!!) to __MEMBER_SELECTION
132         define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('doubler_uid'), false, true, true, "doubler_uid"));
133
134         // Number of rows to display (option lines!!!)
135         define('__DOUBLER_DISPLAY_NEW', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_new')));
136         define('__DOUBLER_DISPLAY_PAY', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_pay')));
137         define('__DOUBLER_DISPLAY_OLD', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_old')));
138
139         // Timeout selection box or input box?
140         define('__DOUBLER_TIMEOUT', CREATE_TIME_SELECTIONS(getConfig('doubler_timeout')  , "doubler_timeout"  , "WDh"));
141
142         // Load template
143         LOAD_TEMPLATE("admin_config_doubler");
144 }
145 //
146 ?>