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 ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin()))
37 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
41 // Add description as navigation point
42 ADD_DESCR("admin", basename(__FILE__));
44 if (isset($_POST['ok']))
46 // Translate german decimal commas to computer decimal dots
47 $_POST['beg_points'] = str_replace(",", ".", $_POST['beg_points'] );
48 $_POST['beg_points_max'] = str_replace(",", ".", $_POST['beg_points_max'] );
49 $_POST['beg_notify_bonus'] = str_replace(",", ".", $_POST['beg_notify_bonus']);
52 ADMIN_SAVE_SETTINGS($_POST);
54 // Remember new settings
55 $_CONFIG['beg_rallye'] = $_POST['beg_rallye'];
56 $_CONFIG['beg_ral_en_notify'] = $_POST['beg_ral_en_notify'];
57 $_CONFIG['beg_ral_di_notify'] = $_POST['beg_ral_di_notify'];
59 // Include sending out mails
60 if ((($_CONFIG['beg_rallye'] == 'Y') && ($_CONFIG['beg_ral_en_notify'] == 'Y')) || (($_CONFIG['beg_rallye'] == 'N') && ($_CONFIG['beg_ral_di_notify'] == 'Y')))
62 include(PATH."inc/mails/beg_mails.php");
67 // Prepare constants for the template
68 define('__BEG_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points'] , false));
69 define('__BEG_POINTS_MAX' , TRANSLATE_COMMA($_CONFIG['beg_points_max'] , false));
70 define('__BEG_NOTIFY_BONUS' , TRANSLATE_COMMA($_CONFIG['beg_notify_bonus'], false));
71 define('__BEG_TIMEOUT' , CREATE_TIME_SELECTIONS($_CONFIG['beg_timeout'] , "beg_timeout" , "Dhm"));
72 define('__BEG_UID_TIMEOUT' , CREATE_TIME_SELECTIONS($_CONFIG['beg_uid_timeout'], "beg_uid_timeout", "Dhm"));
73 define('__BEG_REMOTE_IP_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['beg_ip_timeout'] , "beg_ip_timeout" , "Dhm"));
74 define('__WAIT_SELECTION' , CREATE_TIME_SELECTIONS($_CONFIG['beg_notify_wait'], "beg_notify_wait", "ms" ));
75 define('__BEG_RANKS', $_CONFIG['beg_ranks']);
77 // Activate / Deactivate beg rallye (Y/N)
78 switch ($_CONFIG['beg_rallye'])
81 define('__BEG_RALLYE_Y', " checked");
82 define('__BEG_RALLYE_N', "");
86 define('__BEG_RALLYE_Y', "");
87 define('__BEG_RALLYE_N', " checked");
90 switch ($_CONFIG['beg_active'])
93 define('__BEG_ACTIVE_Y', " checked");
94 define('__BEG_ACTIVE_N', "");
98 define('__BEG_ACTIVE_Y', "");
99 define('__BEG_ACTIVE_N', " checked");
102 switch ($_CONFIG['beg_mode'])
105 define('__BEG_MODE_DIRECT', " checked");
106 define('__BEG_MODE_REF' , "");
110 define('__BEG_MODE_DIRECT', "");
111 define('__BEG_MODE_REF' , " checked");
114 switch ($_CONFIG['beg_ral_en_notify'])
117 define('__BEG_RAL_EN_NOTIFY_Y', " checked");
118 define('__BEG_RAL_EN_NOTIFY_N', "");
122 define('__BEG_RAL_EN_NOTIFY_Y', "");
123 define('__BEG_RAL_EN_NOTIFY_N', " checked");
126 switch ($_CONFIG['beg_ral_di_notify'])
129 define('__BEG_RAL_DI_NOTIFY_Y', " checked");
130 define('__BEG_RAL_DI_NOTIFY_N', "");
134 define('__BEG_RAL_DI_NOTIFY_Y', "");
135 define('__BEG_RAL_DI_NOTIFY_N', " checked");
138 switch ($_CONFIG['beg_new_mem_notify'])
141 define('__BEG_NEW_MEMBER_NOTIFY_Y', " checked");
142 define('__BEG_NEW_MEMBER_NOTIFY_N', "");
146 define('__BEG_NEW_MEMBER_NOTIFY_Y', "");
147 define('__BEG_NEW_MEMBER_NOTIFY_N', " checked");
150 switch ($_CONFIG['beg_include_own'])
153 define('__BEG_INCLUDE_OWN_Y', " checked");
154 define('__BEG_INCLUDE_OWN_N', "");
158 define('__BEG_INCLUDE_OWN_Y', "");
159 define('__BEG_INCLUDE_OWN_N', " checked");
163 // Add data to constant __MEMBER_SELECTION
164 ADD_MEMBER_SELECTION_BOX(false, true, true, $_CONFIG['beg_uid']);
166 // Load form template
167 LOAD_TEMPLATE("admin_config_beg");