X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-config_surfbar.php;h=f48676718269975bfc4e0a7ee0bee4bfdc9ab54d;hb=61b77b466ed51b55406cce2671c6ad3991b350a9;hp=10d587c6758c94b5d73d2e1cb4782b75a846f607;hpb=6f4a70d53accbaf7776ef4ecd3a39fe1a81ee276;p=mailer.git diff --git a/inc/modules/admin/what-config_surfbar.php b/inc/modules/admin/what-config_surfbar.php index 10d587c675..f486767182 100644 --- a/inc/modules/admin/what-config_surfbar.php +++ b/inc/modules/admin/what-config_surfbar.php @@ -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); } @@ -43,16 +43,34 @@ ADD_DESCR("admin", basename(__FILE__)); // 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_static_reward'])) $_POST['surfbar_static_reward'] = str_replace(",", ".", $_POST['surfbar_static_reward']); + if (isset($_POST['surfbar_static_costs'])) $_POST['surfbar_static_costs'] = str_replace(",", ".", $_POST['surfbar_static_costs']); + 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_time' => $_CONFIG['surfbar_static_time'], - 'surfbar_static_lock' => $_CONFIG['surfbar_static_lock'] + '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'], + // @TODO Rewrite this to tiny selection boxes + 'surfbar_purge_deleted' => $_CONFIG['surfbar_purge_deleted'], + // @TODO Rewrite this to tiny selection boxes + 'surfbar_purge_migrated' => $_CONFIG['surfbar_purge_migrated'], + 'surfbar_pause_url' => $_CONFIG['surfbar_pause_url'], + 'surfbar_warn_low_points' => $_CONFIG['surfbar_warn_low_points'], + // @TODO Rewrite this to tiny selection boxes + 'surfbar_low_interval' => $_CONFIG['surfbar_low_interval'], ); // Prepare payment model for template @@ -66,6 +84,61 @@ if (isset($_POST['ok'])) { 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\""); + } + + // Prepare notify limits + if ($_CONFIG['surfbar_notify_limits'] == "Y") { + // Yes selected + define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', " checked=\"checked\""); + define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', ""); + } else { + // No selected + define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', ""); + define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', " checked=\"checked\""); + } + + // Prepare order migration + if ($_CONFIG['surfbar_migrate_order'] == "Y") { + // Yes selected + define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', " checked=\"checked\""); + define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', ""); + } else { + // No selected + define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', ""); + define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', " checked=\"checked\""); + } + + // Pause URL mode + if ($_CONFIG['surfbar_pause_mode'] == "INTERNAL") { + // Internal pause page + define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', " checked=\"checked\""); + define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', ""); + } else { + // External pause page (if not empty) + define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', ""); + define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', " checked=\"checked\""); + } + + // Notification mode + if ($_CONFIG['surfbar_notification_mode'] == "INSTANT") { + // Instant notification + define('__CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', " selected=\"selected\""); + define('__CONFIG_SURFBAR_NOTIFICATION_MODE_RESET' , ""); + } else { + // Only daily reset + define('__CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', ""); + define('__CONFIG_SURFBAR_NOTIFICATION_MODE_RESET' , " selected=\"selected\""); + } + // Load template LOAD_TEMPLATE("admin_config_surfbar", false, $content); }