2 /************************************************************************
3 * MXChange v0.2.1 Start: 01/09/2005 *
4 * ================ Last change: 01/09/2005 *
6 * -------------------------------------------------------------------- *
7 * File : what-config_beg.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Setup beg link *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Bettel-Link einstellen *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
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. *
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. *
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, *
32 ************************************************************************/
34 // Some security stuff...
35 if ((!defined('__SECURITY')) || (!is_admin())) {
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
40 // Add description as navigation point
41 ADD_DESCR("admin", basename(__FILE__));
43 if (isset($_POST['ok']))
45 // Translate german decimal commas to computer decimal dots
46 $_POST['beg_points'] = str_replace(",", ".", $_POST['beg_points'] );
47 $_POST['beg_points_max'] = str_replace(",", ".", $_POST['beg_points_max'] );
48 $_POST['beg_notify_bonus'] = str_replace(",", ".", $_POST['beg_notify_bonus']);
51 ADMIN_SAVE_SETTINGS($_POST);
53 // Remember new settings
54 $_CONFIG['beg_rallye'] = $_POST['beg_rallye'];
55 $_CONFIG['beg_ral_en_notify'] = $_POST['beg_ral_en_notify'];
56 $_CONFIG['beg_ral_di_notify'] = $_POST['beg_ral_di_notify'];
58 // Include sending out mails
59 if ((($_CONFIG['beg_rallye'] == "Y") && ($_CONFIG['beg_ral_en_notify'] == "Y")) || (($_CONFIG['beg_rallye'] == "N") && ($_CONFIG['beg_ral_di_notify'] == "Y")))
61 include(PATH."inc/mails/beg_mails.php");
66 // Prepare constants for the template
67 define('__BEG_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points'] , false));
68 define('__BEG_POINTS_MAX' , TRANSLATE_COMMA($_CONFIG['beg_points_max'] , false));
69 define('__BEG_NOTIFY_BONUS' , TRANSLATE_COMMA($_CONFIG['beg_notify_bonus'], false));
70 define('__BEG_TIMEOUT' , CREATE_TIME_SELECTIONS($_CONFIG['beg_timeout'] , "beg_timeout" , "Dhm"));
71 define('__BEG_UID_TIMEOUT' , CREATE_TIME_SELECTIONS($_CONFIG['beg_uid_timeout'], "beg_uid_timeout", "Dhm"));
72 define('__BEG_REMOTE_IP_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['beg_ip_timeout'] , "beg_ip_timeout" , "Dhm"));
73 define('__WAIT_SELECTION' , CREATE_TIME_SELECTIONS($_CONFIG['beg_notify_wait'], "beg_notify_wait", "ms" ));
74 define('__BEG_RANKS', $_CONFIG['beg_ranks']);
76 // Activate / Deactivate beg rallye (Y/N)
77 switch ($_CONFIG['beg_rallye'])
80 define('__BEG_RALLYE_Y', " checked");
81 define('__BEG_RALLYE_N', "");
85 define('__BEG_RALLYE_Y', "");
86 define('__BEG_RALLYE_N', " checked");
89 switch ($_CONFIG['beg_active'])
92 define('__BEG_ACTIVE_Y', " checked");
93 define('__BEG_ACTIVE_N', "");
97 define('__BEG_ACTIVE_Y', "");
98 define('__BEG_ACTIVE_N', " checked");
101 switch ($_CONFIG['beg_mode'])
104 define('__BEG_MODE_DIRECT', " checked");
105 define('__BEG_MODE_REF' , "");
109 define('__BEG_MODE_DIRECT', "");
110 define('__BEG_MODE_REF' , " checked");
113 switch ($_CONFIG['beg_ral_en_notify'])
116 define('__BEG_RAL_EN_NOTIFY_Y', " checked");
117 define('__BEG_RAL_EN_NOTIFY_N', "");
121 define('__BEG_RAL_EN_NOTIFY_Y', "");
122 define('__BEG_RAL_EN_NOTIFY_N', " checked");
125 switch ($_CONFIG['beg_ral_di_notify'])
128 define('__BEG_RAL_DI_NOTIFY_Y', " checked");
129 define('__BEG_RAL_DI_NOTIFY_N', "");
133 define('__BEG_RAL_DI_NOTIFY_Y', "");
134 define('__BEG_RAL_DI_NOTIFY_N', " checked");
137 switch ($_CONFIG['beg_new_mem_notify'])
140 define('__BEG_NEW_MEMBER_NOTIFY_Y', " checked");
141 define('__BEG_NEW_MEMBER_NOTIFY_N', "");
145 define('__BEG_NEW_MEMBER_NOTIFY_Y', "");
146 define('__BEG_NEW_MEMBER_NOTIFY_N', " checked");
149 switch ($_CONFIG['beg_include_own'])
152 define('__BEG_INCLUDE_OWN_Y', " checked");
153 define('__BEG_INCLUDE_OWN_N', "");
157 define('__BEG_INCLUDE_OWN_Y', "");
158 define('__BEG_INCLUDE_OWN_N', " checked");
162 // Add data to constant __MEMBER_SELECTION
163 ADD_MEMBER_SELECTION_BOX($_CONFIG['beg_uid'], false, true, true);
165 // Load form template
166 LOAD_TEMPLATE("admin_config_beg");