Damn typo fixed... ;-)
[mailer.git] / inc / modules / admin / what-config_beg.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 01/09/2005 *
4  * ================                             Last change: 01/09/2005 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : what-config_beg.php                              *
8  * -------------------------------------------------------------------- *
9  * Short description : Setup beg link                                   *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Bettel-Link einstellen                           *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
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         // Translate german decimal commas to computer decimal dots
50         REQUEST_SET_POST('beg_points'      , REVERT_COMMA(REQUEST_POST('beg_points')      ));
51         REQUEST_SET_POST('beg_points_max'  , REVERT_COMMA(REQUEST_POST('beg_points_max')  ));
52         REQUEST_SET_POST('beg_notify_bonus', REVERT_COMMA(REQUEST_POST('beg_notify_bonus')));
53
54         // Save settings
55         ADMIN_SAVE_SETTINGS_POST();
56
57         // Remember new settings
58         setConfigEntry('beg_rallye'       , REQUEST_POST('beg_rallye'));
59         setConfigEntry('beg_ral_en_notify', REQUEST_POST('beg_ral_en_notify'));
60         setConfigEntry('beg_ral_di_notify', REQUEST_POST('beg_ral_di_notify'));
61 } else {
62         // Prepare constants for the template
63         define('__BEG_POINTS'           , TRANSLATE_COMMA(getConfig('beg_points')      , false));
64         define('__BEG_POINTS_MAX'       , TRANSLATE_COMMA(getConfig('beg_points_max')  , false));
65         define('__BEG_NOTIFY_BONUS'     , TRANSLATE_COMMA(getConfig('beg_notify_bonus'), false));
66         define('__BEG_TIMEOUT'          , CREATE_TIME_SELECTIONS(getConfig('beg_timeout')    , "beg_timeout"    , "Dhm"));
67         define('__BEG_UID_TIMEOUT'      , CREATE_TIME_SELECTIONS(getConfig('beg_uid_timeout'), "beg_uid_timeout", "Dhm"));
68         define('__BEG_REMOTE_IP_TIMEOUT', CREATE_TIME_SELECTIONS(getConfig('beg_ip_timeout') , "beg_ip_timeout" , "Dhm"));
69         define('__WAIT_SELECTION'       , CREATE_TIME_SELECTIONS(getConfig('beg_notify_wait'), "beg_notify_wait", "ms" ));
70         define('__BEG_RANKS'            , getConfig('beg_ranks'));
71
72         // Activate / Deactivate beg rallye (Y/N)
73         switch (getConfig('beg_rallye'))
74         {
75         case "Y":
76                 define('__BEG_RALLYE_Y', " checked=\"checked\"");
77                 define('__BEG_RALLYE_N', "");
78                 break;
79
80         case "N":
81                 define('__BEG_RALLYE_Y', "");
82                 define('__BEG_RALLYE_N', " checked=\"checked\"");
83                 break;
84         }
85
86         switch (getConfig('beg_active'))
87         {
88         case "Y":
89                 define('__BEG_ACTIVE_Y', " checked=\"checked\"");
90                 define('__BEG_ACTIVE_N', "");
91                 break;
92
93         case "N":
94                 define('__BEG_ACTIVE_Y', "");
95                 define('__BEG_ACTIVE_N', " checked=\"checked\"");
96                 break;
97         }
98
99         switch (getConfig('beg_mode'))
100         {
101         case "DIRECT":
102                 define('__BEG_MODE_DIRECT', " checked=\"checked\"");
103                 define('__BEG_MODE_REF'   , "");
104                 break;
105
106         case "REF":
107                 define('__BEG_MODE_DIRECT', "");
108                 define('__BEG_MODE_REF'   , " checked=\"checked\"");
109                 break;
110         }
111
112         switch (getConfig('beg_ral_en_notify'))
113         {
114         case "Y":
115                 define('__BEG_RAL_EN_NOTIFY_Y', " checked=\"checked\"");
116                 define('__BEG_RAL_EN_NOTIFY_N', "");
117                 break;
118
119         case "N":
120                 define('__BEG_RAL_EN_NOTIFY_Y', "");
121                 define('__BEG_RAL_EN_NOTIFY_N', " checked=\"checked\"");
122                 break;
123         }
124
125         switch (getConfig('beg_ral_di_notify'))
126         {
127         case "Y":
128                 define('__BEG_RAL_DI_NOTIFY_Y', " checked=\"checked\"");
129                 define('__BEG_RAL_DI_NOTIFY_N', "");
130                 break;
131
132         case "N":
133                 define('__BEG_RAL_DI_NOTIFY_Y', "");
134                 define('__BEG_RAL_DI_NOTIFY_N', " checked=\"checked\"");
135                 break;
136         }
137
138         switch (getConfig('beg_new_mem_notify'))
139         {
140         case "Y":
141                 define('__BEG_NEW_MEMBER_NOTIFY_Y', " checked=\"checked\"");
142                 define('__BEG_NEW_MEMBER_NOTIFY_N', "");
143                 break;
144
145         case "N":
146                 define('__BEG_NEW_MEMBER_NOTIFY_Y', "");
147                 define('__BEG_NEW_MEMBER_NOTIFY_N', " checked=\"checked\"");
148                 break;
149         }
150
151         switch (getConfig('beg_include_own'))
152         {
153         case "Y":
154                 define('__BEG_INCLUDE_OWN_Y', " checked=\"checked\"");
155                 define('__BEG_INCLUDE_OWN_N', "");
156                 break;
157
158         case "N":
159                 define('__BEG_INCLUDE_OWN_Y', "");
160                 define('__BEG_INCLUDE_OWN_N', " checked=\"checked\"");
161                 break;
162         }
163
164         switch (getConfig('beg_pay_mode')) {
165                 case "IMG":
166                         define('__BEG_PAY_MODE_IMG' , " selected=\"selected\"");
167                         define('__BEG_PAY_MODE_JS'  , "");
168                         define('__BEG_PAY_MODE_BOTH', "");
169                         define('__BEG_PAY_MODE_NONE', "");
170                         break;
171
172                 case "JS":
173                         define('__BEG_PAY_MODE_IMG' , "");
174                         define('__BEG_PAY_MODE_JS'  , " selected=\"selected\"");
175                         define('__BEG_PAY_MODE_BOTH', "");
176                         define('__BEG_PAY_MODE_NONE', "");
177                         break;
178
179                 case "BOTH":
180                         define('__BEG_PAY_MODE_IMG' , "");
181                         define('__BEG_PAY_MODE_JS'  , "");
182                         define('__BEG_PAY_MODE_BOTH', " selected=\"selected\"");
183                         define('__BEG_PAY_MODE_NONE', "");
184                         break;
185
186                 case "NONE":
187                         define('__BEG_PAY_MODE_IMG' , "");
188                         define('__BEG_PAY_MODE_JS'  , "");
189                         define('__BEG_PAY_MODE_BOTH', "");
190                         define('__BEG_PAY_MODE_NONE', " selected=\"selected\"");
191                         break;
192         }
193
194         // Add data to constant __MEMBER_SELECTION
195         define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('beg_uid'), false, true, true, "beg_uid"));
196
197         // Load form template
198         LOAD_TEMPLATE("admin_config_beg");
199 }
200
201 //
202 ?>