Settings | Donate Author: Mike Challis http://www.642weather.com/weather/scripts.php */ if (isset($_POST['submit'])) { if ( function_exists('current_user_can') && !current_user_can('manage_options') ) die(__('You do not have permissions for managing this option', 'si-captcha')); check_admin_referer( 'si-captcha-options_update'); // nonce // post changes to the options array $optionarray_update = array( 'si_captcha_captcha_difficulty' => (trim($_POST['si_captcha_captcha_difficulty']) != '' ) ? trim($_POST['si_captcha_captcha_difficulty']) : $si_captcha_option_defaults['si_captcha_captcha_difficulty'], // use default if empty 'si_captcha_donated' => (isset( $_POST['si_captcha_donated'] ) ) ? 'true' : 'false',// true or false 'si_captcha_perm' => (isset( $_POST['si_captcha_perm'] ) ) ? 'true' : 'false', 'si_captcha_perm_level' => (trim($_POST['si_captcha_perm_level']) != '' ) ? trim($_POST['si_captcha_perm_level']) : $si_captcha_option_defaults['si_captcha_perm_level'], // use default if empty 'si_captcha_comment' => (isset( $_POST['si_captcha_comment'] ) ) ? 'true' : 'false', 'si_captcha_comment_label_position' => (trim($_POST['si_captcha_comment_label_position']) != '' ) ? trim($_POST['si_captcha_comment_label_position']) : $si_captcha_option_defaults['si_captcha_comment_label_position'], // use default if empty 'si_captcha_login' => (isset( $_POST['si_captcha_login'] ) ) ? 'true' : 'false', 'si_captcha_register' => (isset( $_POST['si_captcha_register'] ) ) ? 'true' : 'false', 'si_captcha_lostpwd' => (isset( $_POST['si_captcha_lostpwd'] ) ) ? 'true' : 'false', 'si_captcha_rearrange' => (isset( $_POST['si_captcha_rearrange'] ) ) ? 'true' : 'false', 'si_captcha_disable_session' => (isset( $_POST['si_captcha_disable_session'] ) ) ? 'true' : 'false', 'si_captcha_captcha_small' => (isset( $_POST['si_captcha_captcha_small'] ) ) ? 'true' : 'false', 'si_captcha_no_trans' => (isset( $_POST['si_captcha_no_trans'] ) ) ? 'true' : 'false', 'si_captcha_aria_required' => (isset( $_POST['si_captcha_aria_required'] ) ) ? 'true' : 'false', 'si_captcha_external_style' => trim( $_POST['si_captcha_external_style'] ), 'si_captcha_comment_label_style' => (trim($_POST['si_captcha_comment_label_style']) != '' ) ? trim($_POST['si_captcha_comment_label_style']) : $si_captcha_option_defaults['si_captcha_comment_label_style'], // use default if empty 'si_captcha_comment_field_style' => (trim($_POST['si_captcha_comment_field_style']) != '' ) ? trim($_POST['si_captcha_comment_field_style']) : $si_captcha_option_defaults['si_captcha_comment_field_style'], // use default if empty 'si_captcha_captcha_div_style' => (trim($_POST['si_captcha_captcha_div_style']) != '' ) ? trim($_POST['si_captcha_captcha_div_style']) : $si_captcha_option_defaults['si_captcha_captcha_div_style'], // use default if empty 'si_captcha_captcha_div_style_sm' => (trim($_POST['si_captcha_captcha_div_style_sm']) != '' ) ? trim($_POST['si_captcha_captcha_div_style_sm']) : $si_captcha_option_defaults['si_captcha_captcha_div_style_sm'], // use default if empty 'si_captcha_captcha_div_style_m' => (trim($_POST['si_captcha_captcha_div_style_m']) != '' ) ? trim($_POST['si_captcha_captcha_div_style_m']) : $si_captcha_option_defaults['si_captcha_captcha_div_style_m'], // use default if empty 'si_captcha_captcha_input_div_style' => (trim($_POST['si_captcha_captcha_input_div_style']) != '' ) ? trim($_POST['si_captcha_captcha_input_div_style']) : $si_captcha_option_defaults['si_captcha_captcha_input_div_style'], // use default if empty 'si_captcha_captcha_image_style' => (trim($_POST['si_captcha_captcha_image_style']) != '' ) ? trim($_POST['si_captcha_captcha_image_style']) : $si_captcha_option_defaults['si_captcha_captcha_image_style'], 'si_captcha_refresh_image_style' => (trim($_POST['si_captcha_refresh_image_style']) != '' ) ? trim($_POST['si_captcha_refresh_image_style']) : $si_captcha_option_defaults['si_captcha_refresh_image_style'], 'si_captcha_required_indicator' => $_POST['si_captcha_required_indicator'], 'si_captcha_label_captcha' => trim($_POST['si_captcha_label_captcha']), 'si_captcha_tooltip_captcha' => trim($_POST['si_captcha_tooltip_captcha']), 'si_captcha_tooltip_refresh' => trim($_POST['si_captcha_tooltip_refresh']), ); // deal with quotes foreach($optionarray_update as $key => $val) { $optionarray_update[$key] = str_replace('"','"',$val); } if (isset($_POST['si_captcha_reset_styles'])) { // reset styles feature $style_resets_arr= array('si_captcha_comment_label_style','si_captcha_comment_field_style','si_captcha_captcha_div_style','si_captcha_captcha_div_style_sm','si_captcha_captcha_div_style_m','si_captcha_captcha_input_div_style','si_captcha_captcha_image_style','si_captcha_refresh_image_style'); foreach($style_resets_arr as $style_reset) { $optionarray_update[$style_reset] = $si_captcha_option_defaults[$style_reset]; } } // save updated options to the database if ($wpmu == 1) update_site_option('si_captcha', $optionarray_update); else update_option('si_captcha', $optionarray_update); // get the options from the database if ($wpmu == 1) $si_captcha_opt = get_site_option('si_captcha'); else $si_captcha_opt = get_option('si_captcha'); // strip slashes on get options array foreach($si_captcha_opt as $key => $val) { $si_captcha_opt[$key] = $this->si_stripslashes($val); } if (function_exists('wp_cache_flush')) { wp_cache_flush(); } } // end if (isset($_POST['submit'])) ?>





| | | | | | | Mike Challis