Fixes for stripped HTML tags, and false warnings in debug log
[mailer.git] / inc / modules / admin / what-config_yoomedia.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 10/10/2008 *
4  * ================                             Last change: 10/10/2008 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : what-yoomedia.php                                *
8  * -------------------------------------------------------------------- *
9  * Short description : Setup default statistics mode                    *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Standart Modus der Statistiken 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 } elseif (!EXT_IS_ACTIVE("yoomedia")) {
39         addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "yoomedia");
40         return;
41 }
42
43 // Add description as navigation point
44 ADD_DESCR("admin", __FILE__);
45
46 // Was the form submitted?
47 if (IS_FORM_SENT()) {
48         // Test Yoo!Media config
49         if (YOOMEDIA_TEST_CONFIG(REQUEST_POST_ARRAY())) {
50                 // Save settings
51                 ADMIN_SAVE_SETTINGS_POST();
52         } else {
53                 // Config not saved
54                 LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_CONFIG_YOOMEDIA_TEST_FAILED'));
55         }
56 } else {
57         // Prepare content
58         $content = array(
59                 'yoomedia_id'               => bigintval(getConfig('yoomedia_id')),
60                 'yoomedia_sid'              => bigintval(getConfig('yoomedia_sid')),
61                 'yoomedia_passwd'           => getConfig('yoomedia_passwd'),
62                 'yoomedia_tm_max_reload'    => bigintval(getConfig('yoomedia_tm_max_reload')),
63                 'yoomedia_tm_min_wait'      => bigintval(getConfig('yoomedia_tm_min_wait')),
64                 'yoomedia_tm_clicks_remain' => bigintval(getConfig('yoomedia_tm_clicks_remain')),
65                 'yoomedia_tm_min_pay'       => bigintval(getConfig('yoomedia_tm_min_pay'))
66         );
67
68         // Erotic?
69         switch (getConfig('yoomedia_erotic_allowed')) {
70                 case 0: // No erotic at all
71                         define('__CFG_YOOMEDIA_EROTIC_NONE'   , " selected=\"selected\"");
72                         define('__CFG_YOOMEDIA_EROTIC_INCLUDE', "");
73                         define('__CFG_YOOMEDIA_EROTIC_ONLY'   , "");
74                         break;
75
76                 case 1: // Include erotic
77                         define('__CFG_YOOMEDIA_EROTIC_NONE'   , "");
78                         define('__CFG_YOOMEDIA_EROTIC_INCLUDE', " selected=\"selected\"");
79                         define('__CFG_YOOMEDIA_EROTIC_ONLY'   , "");
80                         break;
81
82                 case 2: // Erotic only
83                         define('__CFG_YOOMEDIA_EROTIC_NONE'   , "");
84                         define('__CFG_YOOMEDIA_EROTIC_INCLUDE', "");
85                         define('__CFG_YOOMEDIA_EROTIC_ONLY'   , " selected=\"selected\"");
86                         break;
87         }
88
89         // Load template
90         LOAD_TEMPLATE("admin_config_yoomedia", false, $content);
91 }
92
93 //
94 ?>