(no commit message)
[mailer.git] / 0.2.1 / inc / modules / admin / what-config_beg.php
1 <?php\r
2 /************************************************************************\r
3  * MXChange v0.2.1                                    Start: 01/09/2005 *\r
4  * ================                             Last change: 01/09/2005 *\r
5  *                                                                      *\r
6  * -------------------------------------------------------------------- *\r
7  * File              : what-config_beg.php                              *\r
8  * -------------------------------------------------------------------- *\r
9  * Short description : Setup beg link                                   *\r
10  * -------------------------------------------------------------------- *\r
11  * Kurzbeschreibung  : Bettel-Link einstellen                           *\r
12  * -------------------------------------------------------------------- *\r
13  *                                                                      *\r
14  * -------------------------------------------------------------------- *\r
15  * Copyright (c) 2003 - 2007 by Roland Haeder                           *\r
16  * For more information visit: http://www.mxchange.org                  *\r
17  *                                                                      *\r
18  * This program is free software; you can redistribute it and/or modify *\r
19  * it under the terms of the GNU General Public License as published by *\r
20  * the Free Software Foundation; either version 2 of the License, or    *\r
21  * (at your option) any later version.                                  *\r
22  *                                                                      *\r
23  * This program is distributed in the hope that it will be useful,      *\r
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *\r
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *\r
26  * GNU General Public License for more details.                         *\r
27  *                                                                      *\r
28  * You should have received a copy of the GNU General Public License    *\r
29  * along with this program; if not, write to the Free Software          *\r
30  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *\r
31  * MA  02110-1301  USA                                                  *\r
32  ************************************************************************/\r
33 \r
34 // Some security stuff...\r
35 if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin()))\r
36 {\r
37         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";\r
38         require($INC);\r
39 }\r
40 \r
41 // Add description as navigation point\r
42 ADD_DESCR("admin", basename(__FILE__));\r
43 \r
44 if (isset($_POST['ok']))\r
45 {\r
46         // Translate german decimal commas to computer decimal dots\r
47         $_POST['beg_points']       = str_replace(",", ".", $_POST['beg_points']      );\r
48         $_POST['beg_points_max']   = str_replace(",", ".", $_POST['beg_points_max']  );\r
49         $_POST['beg_notify_bonus'] = str_replace(",", ".", $_POST['beg_notify_bonus']);\r
50 \r
51         // Save settings\r
52         ADMIN_SAVE_SETTINGS($_POST, "_config", "config='0'");\r
53 \r
54         // Remember new settings\r
55         $CONFIG['beg_rallye']        = $_POST['beg_rallye'];\r
56         $CONFIG['beg_ral_en_notify'] = $_POST['beg_ral_en_notify'];\r
57         $CONFIG['beg_ral_di_notify'] = $_POST['beg_ral_di_notify'];\r
58 \r
59         // Include sending out mails\r
60         if ((($CONFIG['beg_rallye'] == "Y") && ($CONFIG['beg_ral_en_notify'] == "Y")) || (($CONFIG['beg_rallye'] == "N") && ($CONFIG['beg_ral_di_notify'] == "Y")))\r
61         {\r
62                 include(PATH."inc/mails/beg_mails.php");\r
63         }\r
64 }\r
65  else\r
66 {\r
67         // Prepare constants for the template\r
68         define('__BEG_POINTS'           , TRANSLATE_COMMA($CONFIG['beg_points']      , false));\r
69         define('__BEG_POINTS_MAX'       , TRANSLATE_COMMA($CONFIG['beg_points_max']  , false));\r
70         define('__BEG_NOTIFY_BONUS'     , TRANSLATE_COMMA($CONFIG['beg_notify_bonus'], false));\r
71         define('__BEG_TIMEOUT'          , CREATE_TIME_SELECTIONS($CONFIG['beg_timeout']    , "beg_timeout"    , "Dhm"));\r
72         define('__BEG_UID_TIMEOUT'      , CREATE_TIME_SELECTIONS($CONFIG['beg_uid_timeout'], "beg_uid_timeout", "Dhm"));\r
73         define('__BEG_REMOTE_IP_TIMEOUT', CREATE_TIME_SELECTIONS($CONFIG['beg_ip_timeout'] , "beg_ip_timeout" , "Dhm"));\r
74         define('__WAIT_SELECTION'       , CREATE_TIME_SELECTIONS($CONFIG['beg_notify_wait'], "beg_notify_wait", "ms" ));\r
75         define('__BEG_RANKS', $CONFIG['beg_ranks']);\r
76 \r
77         // Activate / Deactivate beg rallye (Y/N)\r
78         switch ($CONFIG['beg_rallye'])\r
79         {\r
80         case "Y":\r
81                 define('__BEG_RALLYE_Y', " checked");\r
82                 define('__BEG_RALLYE_N', "");\r
83                 break;\r
84 \r
85         case "N":\r
86                 define('__BEG_RALLYE_Y', "");\r
87                 define('__BEG_RALLYE_N', " checked");\r
88                 break;\r
89         }\r
90         switch ($CONFIG['beg_active'])\r
91         {\r
92         case "Y":\r
93                 define('__BEG_ACTIVE_Y', " checked");\r
94                 define('__BEG_ACTIVE_N', "");\r
95                 break;\r
96 \r
97         case "N":\r
98                 define('__BEG_ACTIVE_Y', "");\r
99                 define('__BEG_ACTIVE_N', " checked");\r
100                 break;\r
101         }\r
102         switch ($CONFIG['beg_mode'])\r
103         {\r
104         case "DIRECT":\r
105                 define('__BEG_MODE_DIRECT', " checked");\r
106                 define('__BEG_MODE_REF'   , "");\r
107                 break;\r
108 \r
109         case "REF":\r
110                 define('__BEG_MODE_DIRECT', "");\r
111                 define('__BEG_MODE_REF'   , " checked");\r
112                 break;\r
113         }\r
114         switch ($CONFIG['beg_ral_en_notify'])\r
115         {\r
116         case "Y":\r
117                 define('__BEG_RAL_EN_NOTIFY_Y', " checked");\r
118                 define('__BEG_RAL_EN_NOTIFY_N', "");\r
119                 break;\r
120 \r
121         case "N":\r
122                 define('__BEG_RAL_EN_NOTIFY_Y', "");\r
123                 define('__BEG_RAL_EN_NOTIFY_N', " checked");\r
124                 break;\r
125         }\r
126         switch ($CONFIG['beg_ral_di_notify'])\r
127         {\r
128         case "Y":\r
129                 define('__BEG_RAL_DI_NOTIFY_Y', " checked");\r
130                 define('__BEG_RAL_DI_NOTIFY_N', "");\r
131                 break;\r
132 \r
133         case "N":\r
134                 define('__BEG_RAL_DI_NOTIFY_Y', "");\r
135                 define('__BEG_RAL_DI_NOTIFY_N', " checked");\r
136                 break;\r
137         }\r
138         switch ($CONFIG['beg_new_mem_notify'])\r
139         {\r
140         case "Y":\r
141                 define('__BEG_NEW_MEMBER_NOTIFY_Y', " checked");\r
142                 define('__BEG_NEW_MEMBER_NOTIFY_N', "");\r
143                 break;\r
144 \r
145         case "N":\r
146                 define('__BEG_NEW_MEMBER_NOTIFY_Y', "");\r
147                 define('__BEG_NEW_MEMBER_NOTIFY_N', " checked");\r
148                 break;\r
149         }\r
150         switch ($CONFIG['beg_include_own'])\r
151         {\r
152         case "Y":\r
153                 define('__BEG_INCLUDE_OWN_Y', " checked");\r
154                 define('__BEG_INCLUDE_OWN_N', "");\r
155                 break;\r
156 \r
157         case "N":\r
158                 define('__BEG_INCLUDE_OWN_Y', "");\r
159                 define('__BEG_INCLUDE_OWN_N', " checked");\r
160                 break;\r
161         }\r
162 \r
163         // Add data to constant __MEMBER_SELECTION\r
164         ADD_MEMBER_SELECTION_BOX(false, true, true, $CONFIG['beg_uid']);\r
165 \r
166         // Load form template\r
167         LOAD_TEMPLATE("admin_config_beg");\r
168 }\r
169 //\r
170 ?>\r