Mahor rewrite:
[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  *                                                                      *
14  * -------------------------------------------------------------------- *
15  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
16  * For more information visit: http://www.mxchange.org                  *
17  *                                                                      *
18  * This program is free software; you can redistribute it and/or modify *
19  * it under the terms of the GNU General Public License as published by *
20  * the Free Software Foundation; either version 2 of the License, or    *
21  * (at your option) any later version.                                  *
22  *                                                                      *
23  * This program is distributed in the hope that it will be useful,      *
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
26  * GNU General Public License for more details.                         *
27  *                                                                      *
28  * You should have received a copy of the GNU General Public License    *
29  * along with this program; if not, write to the Free Software          *
30  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
31  * MA  02110-1301  USA                                                  *
32  ************************************************************************/
33
34 // Some security stuff...
35 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
36         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
37         require($INC);
38 }
39
40 // Add description as navigation point
41 ADD_DESCR("admin", __FILE__);
42
43 if (isset($_POST['ok'])) {
44         // Translate german decimal commas to computer decimal dots
45         $_POST['beg_points']       = REVERT_COMMA($_POST['beg_points']      );
46         $_POST['beg_points_max']   = REVERT_COMMA($_POST['beg_points_max']  );
47         $_POST['beg_notify_bonus'] = REVERT_COMMA($_POST['beg_notify_bonus']);
48
49         // Save settings
50         ADMIN_SAVE_SETTINGS($_POST);
51
52         // Remember new settings
53         $_CONFIG['beg_rallye']        = $_POST['beg_rallye'];
54         $_CONFIG['beg_ral_en_notify'] = $_POST['beg_ral_en_notify'];
55         $_CONFIG['beg_ral_di_notify'] = $_POST['beg_ral_di_notify'];
56 } else {
57         // Prepare constants for the template
58         define('__BEG_POINTS'           , TRANSLATE_COMMA(getConfig('beg_points')      , false));
59         define('__BEG_POINTS_MAX'       , TRANSLATE_COMMA(getConfig('beg_points_max')  , false));
60         define('__BEG_NOTIFY_BONUS'     , TRANSLATE_COMMA(getConfig('beg_notify_bonus'), false));
61         define('__BEG_TIMEOUT'          , CREATE_TIME_SELECTIONS(getConfig('beg_timeout')    , "beg_timeout"    , "Dhm"));
62         define('__BEG_UID_TIMEOUT'      , CREATE_TIME_SELECTIONS(getConfig('beg_uid_timeout'), "beg_uid_timeout", "Dhm"));
63         define('__BEG_REMOTE_IP_TIMEOUT', CREATE_TIME_SELECTIONS(getConfig('beg_ip_timeout') , "beg_ip_timeout" , "Dhm"));
64         define('__WAIT_SELECTION'       , CREATE_TIME_SELECTIONS(getConfig('beg_notify_wait'), "beg_notify_wait", "ms" ));
65         define('__BEG_RANKS'            , getConfig('beg_ranks'));
66
67         // Activate / Deactivate beg rallye (Y/N)
68         switch (getConfig('beg_rallye'))
69         {
70         case "Y":
71                 define('__BEG_RALLYE_Y', " checked=\"checked\"");
72                 define('__BEG_RALLYE_N', "");
73                 break;
74
75         case "N":
76                 define('__BEG_RALLYE_Y', "");
77                 define('__BEG_RALLYE_N', " checked=\"checked\"");
78                 break;
79         }
80
81         switch (getConfig('beg_active'))
82         {
83         case "Y":
84                 define('__BEG_ACTIVE_Y', " checked=\"checked\"");
85                 define('__BEG_ACTIVE_N', "");
86                 break;
87
88         case "N":
89                 define('__BEG_ACTIVE_Y', "");
90                 define('__BEG_ACTIVE_N', " checked=\"checked\"");
91                 break;
92         }
93
94         switch (getConfig('beg_mode'))
95         {
96         case "DIRECT":
97                 define('__BEG_MODE_DIRECT', " checked=\"checked\"");
98                 define('__BEG_MODE_REF'   , "");
99                 break;
100
101         case "REF":
102                 define('__BEG_MODE_DIRECT', "");
103                 define('__BEG_MODE_REF'   , " checked=\"checked\"");
104                 break;
105         }
106
107         switch (getConfig('beg_ral_en_notify'))
108         {
109         case "Y":
110                 define('__BEG_RAL_EN_NOTIFY_Y', " checked=\"checked\"");
111                 define('__BEG_RAL_EN_NOTIFY_N', "");
112                 break;
113
114         case "N":
115                 define('__BEG_RAL_EN_NOTIFY_Y', "");
116                 define('__BEG_RAL_EN_NOTIFY_N', " checked=\"checked\"");
117                 break;
118         }
119
120         switch (getConfig('beg_ral_di_notify'))
121         {
122         case "Y":
123                 define('__BEG_RAL_DI_NOTIFY_Y', " checked=\"checked\"");
124                 define('__BEG_RAL_DI_NOTIFY_N', "");
125                 break;
126
127         case "N":
128                 define('__BEG_RAL_DI_NOTIFY_Y', "");
129                 define('__BEG_RAL_DI_NOTIFY_N', " checked=\"checked\"");
130                 break;
131         }
132
133         switch (getConfig('beg_new_mem_notify'))
134         {
135         case "Y":
136                 define('__BEG_NEW_MEMBER_NOTIFY_Y', " checked=\"checked\"");
137                 define('__BEG_NEW_MEMBER_NOTIFY_N', "");
138                 break;
139
140         case "N":
141                 define('__BEG_NEW_MEMBER_NOTIFY_Y', "");
142                 define('__BEG_NEW_MEMBER_NOTIFY_N', " checked=\"checked\"");
143                 break;
144         }
145
146         switch (getConfig('beg_include_own'))
147         {
148         case "Y":
149                 define('__BEG_INCLUDE_OWN_Y', " checked=\"checked\"");
150                 define('__BEG_INCLUDE_OWN_N', "");
151                 break;
152
153         case "N":
154                 define('__BEG_INCLUDE_OWN_Y', "");
155                 define('__BEG_INCLUDE_OWN_N', " checked=\"checked\"");
156                 break;
157         }
158
159         switch (getConfig('beg_pay_mode')) {
160                 case "IMG":
161                         define('__BEG_PAY_MODE_IMG' , " selected=\"selected\"");
162                         define('__BEG_PAY_MODE_JS'  , "");
163                         define('__BEG_PAY_MODE_BOTH', "");
164                         define('__BEG_PAY_MODE_NONE', "");
165                         break;
166
167                 case "JS":
168                         define('__BEG_PAY_MODE_IMG' , "");
169                         define('__BEG_PAY_MODE_JS'  , " selected=\"selected\"");
170                         define('__BEG_PAY_MODE_BOTH', "");
171                         define('__BEG_PAY_MODE_NONE', "");
172                         break;
173
174                 case "BOTH":
175                         define('__BEG_PAY_MODE_IMG' , "");
176                         define('__BEG_PAY_MODE_JS'  , "");
177                         define('__BEG_PAY_MODE_BOTH', " selected=\"selected\"");
178                         define('__BEG_PAY_MODE_NONE', "");
179                         break;
180
181                 case "NONE":
182                         define('__BEG_PAY_MODE_IMG' , "");
183                         define('__BEG_PAY_MODE_JS'  , "");
184                         define('__BEG_PAY_MODE_BOTH', "");
185                         define('__BEG_PAY_MODE_NONE', " selected=\"selected\"");
186                         break;
187         }
188
189         // Add data to constant __MEMBER_SELECTION
190         define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('beg_uid'), false, true, true, "beg_uid"));
191
192         // Load form template
193         LOAD_TEMPLATE("admin_config_beg");
194 }
195
196 //
197 ?>