]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_surfbar.php
More queries now depends on UNIX_TIMESTAMP() SQL function, wrong index in autopurge...
[mailer.git] / inc / modules / admin / what-config_surfbar.php
index e49887b35109b233ed84811f72a20d584790e460..d844d99e6b14e9b5aa5b1774494edbf09ca287fb 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -32,7 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) {
+if ((!defined('__SECURITY')) || (!is_admin())) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
@@ -40,7 +40,55 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) {
 // Add description as navigation point
 ADD_DESCR("admin", basename(__FILE__));
 
-die("<pre>".print_r($_CONFIG, true)."</pre>");
+// 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']);
+       if (isset($_POST['surfbar_dynamic_percent'])) $_POST['surfbar_dynamic_percent'] = str_replace(",", ".", $_POST['surfbar_dynamic_percent']);
+
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Prepare content
+       $content = array(
+               'surfbar_static_reward'   => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']),
+               'surfbar_static_costs'    => TRANSLATE_COMMA($_CONFIG['surfbar_static_costs']),
+               // @TODO Rewrite this to tiny selection boxes
+               'surfbar_static_time'     => $_CONFIG['surfbar_static_time'],
+               // @TODO Rewrite this to tiny selection boxes
+               'surfbar_restart_time'    => $_CONFIG['surfbar_restart_time'],
+               'surfbar_static_lock'     => $_CONFIG['surfbar_static_lock'],
+               'surfbar_dynamic_percent' => TRANSLATE_COMMA($_CONFIG['surfbar_dynamic_percent']),
+               'surfbar_max_order'       => $_CONFIG['surfbar_max_order'],
+               // @TODO Rewrite this to tiny selection boxes
+               'surfbar_stats_reload'    => $_CONFIG['surfbar_stats_reload']
+       );
+
+       // 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\"");
+       }
+
+       // Prepare auto-sart
+       if ($_CONFIG['surfbar_autostart'] == "Y") {
+               // Yes selected
+               define('__CONFIG_SURFBAR_AUTOSTART_Y' , " checked=\"checked\"");
+               define('__CONFIG_SURFBAR_AUTOSTART_N', "");
+       } else {
+               // No selected
+               define('__CONFIG_SURFBAR_AUTOSTART_Y' , "");
+               define('__CONFIG_SURFBAR_AUTOSTART_N', " checked=\"checked\"");
+       }
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_surfbar", false, $content);
+}
 
 //
 ?>