From 6f4a70d53accbaf7776ef4ecd3a39fe1a81ee276 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 1 Sep 2008 00:24:01 +0000 Subject: [PATCH] Config added for surfbar --- .gitattributes | 2 + inc/language/de.php | 1 + inc/language/surfbar_de.php | 50 +++++++++++++++ inc/modules/admin/what-config_stats.php | 13 ++-- inc/modules/admin/what-config_surfbar.php | 30 ++++++++- .../de/html/admin/admin_config_surfbar.tpl | 63 +++++++++++++++++++ templates/de/html/admin/admin_footer.tpl | 4 +- 7 files changed, 154 insertions(+), 9 deletions(-) create mode 100644 inc/language/surfbar_de.php create mode 100644 templates/de/html/admin/admin_config_surfbar.tpl diff --git a/.gitattributes b/.gitattributes index 4283e03a3d..9380cae3be 100644 --- a/.gitattributes +++ b/.gitattributes @@ -171,6 +171,7 @@ inc/language/repair_de.php -text inc/language/rewrite_de.php -text inc/language/sponsor_de.php -text inc/language/support_de.php -text +inc/language/surfbar_de.php -text inc/language/task_de.php -text inc/language/theme_de.php -text inc/language/top10_de.php -text @@ -789,6 +790,7 @@ templates/de/html/admin/admin_config_secure.tpl -text templates/de/html/admin/admin_config_sponsor.tpl -text templates/de/html/admin/admin_config_stats.tpl -text templates/de/html/admin/admin_config_sub_points.tpl -text +templates/de/html/admin/admin_config_surfbar.tpl -text templates/de/html/admin/admin_config_title.tpl -text templates/de/html/admin/admin_config_top10.tpl -text templates/de/html/admin/admin_config_transfer.tpl -text diff --git a/inc/language/de.php b/inc/language/de.php index b5b0838566..0fc0173d98 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -1150,6 +1150,7 @@ define('ADMIN_CHANGE_LOGIN', "Anderes Adminlogin"); define('ADMIN_PASSWORD_RESET_DONE', "Ihr Administratorkennwort wurde neu gesetzt. Sie können sich jetzt mit Ihren neuen Zugangsdaten im Adminbereich einloggen."); define('ADMIN_CONTINUE_LOGIN', "Weiter zum Administratorlogin"); define('ADMIN_RESET_PASS_LINK', "Jetzt Ihr Administratorkennwort zurücksetzen (nötiger Schritt!)"); +define('ADMIN_SUPPORT_FORUM_LINK', "Direktlink zum Support-Forum (neues Fenster)"); // ?> diff --git a/inc/language/surfbar_de.php b/inc/language/surfbar_de.php new file mode 100644 index 0000000000..2d51ae3eb7 --- /dev/null +++ b/inc/language/surfbar_de.php @@ -0,0 +1,50 @@ + diff --git a/inc/modules/admin/what-config_stats.php b/inc/modules/admin/what-config_stats.php index 155a72ccbb..a82febbef7 100644 --- a/inc/modules/admin/what-config_stats.php +++ b/inc/modules/admin/what-config_stats.php @@ -32,21 +32,19 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); -if (isset($_POST['ok'])) -{ +// Was the form submitted? +if (isset($_POST['ok'])) { // Save settings ADMIN_SAVE_SETTINGS($_POST); -} - else -{ +} else { // Guest stats switch (strtolower($_CONFIG['guest_stats'])) { @@ -75,5 +73,6 @@ if (isset($_POST['ok'])) // Load template LOAD_TEMPLATE("admin_config_stats"); } + // ?> diff --git a/inc/modules/admin/what-config_surfbar.php b/inc/modules/admin/what-config_surfbar.php index e49887b351..10d587c675 100644 --- a/inc/modules/admin/what-config_surfbar.php +++ b/inc/modules/admin/what-config_surfbar.php @@ -40,7 +40,35 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); -die("
".print_r($_CONFIG, true)."
"); +// Was the form submitted? +if (isset($_POST['ok'])) { + // Replace german decimal comma with computer decimal dot + if (isset($_POST['surfbar_static_reward'])) $_POST['surfbar_static_reward'] = str_replace(",", ".", $_POST['surfbar_static_reward']); + + // Save settings + ADMIN_SAVE_SETTINGS($_POST); +} else { + // Prepare content + $content = array( + 'surfbar_static_reward' => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']), + 'surfbar_static_time' => $_CONFIG['surfbar_static_time'], + 'surfbar_static_lock' => $_CONFIG['surfbar_static_lock'] + ); + + // Prepare payment model for template + if ($_CONFIG['surfbar_pay_model'] == "STATIC") { + // Static model + define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , " checked=\"checked\""); + define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', ""); + } else { + // Dynamic model + define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , ""); + define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', " checked=\"checked\""); + } + + // Load template + LOAD_TEMPLATE("admin_config_surfbar", false, $content); +} // ?> diff --git a/templates/de/html/admin/admin_config_surfbar.tpl b/templates/de/html/admin/admin_config_surfbar.tpl new file mode 100644 index 0000000000..715d56b632 --- /dev/null +++ b/templates/de/html/admin/admin_config_surfbar.tpl @@ -0,0 +1,63 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {--ADMIN_CONFIG_SURFBAR_TITLE--} +
 
+ {--ADMIN_CONFIG_SURFBAR_STATIC_REWARD--} + + +
+ {--ADMIN_CONFIG_SURFBAR_STATIC_TIME--} + + +
 
+ {--ADMIN_CONFIG_SURFBAR_STATIC_LOCK--} + + +
 
+ {--ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL_STATIC--} + + +
+ {--ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL_DYNAMIC--} + + +
+
diff --git a/templates/de/html/admin/admin_footer.tpl b/templates/de/html/admin/admin_footer.tpl index c13b658b6a..4becac12ae 100644 --- a/templates/de/html/admin/admin_footer.tpl +++ b/templates/de/html/admin/admin_footer.tpl @@ -1 +1,3 @@ -{--ADMIN_BACK_TO_GUEST_MENU--} \ No newline at end of file +{--ADMIN_BACK_TO_GUEST_MENU--}
+
+{--ADMIN_SUPPORT_FORUM_LINK--} -- 2.39.5