function cptch_settings_page() { global $cptch_options, $wp_version, $cptch_plugin_info, $cptch_option_defaults, $wpdb; $error = $message = ""; $plugin_basename = plugin_basename(__FILE__); /* These fields for the 'Enable CAPTCHA on the' block which is located at the admin setting captcha page */ $cptch_admin_fields_enable = array(array('cptch_login_form', __('Login form', 'captcha'), 'login_form.jpg'), array('cptch_register_form', __('Registration form', 'captcha'), 'register_form.jpg'), array('cptch_lost_password_form', __('Reset Password form', 'captcha'), 'lost_password_form.jpg'), array('cptch_comments_form', __('Comments form', 'captcha'), 'comment_form.jpg')); $cptch_admin_fields_hide = array(array('cptch_hide_register', __('in Comments form for registered users', 'captcha'))); /* These fields for the 'Arithmetic actions for CAPTCHA' block which is located at the admin setting captcha page */ $cptch_admin_fields_actions = array(array('cptch_math_action_plus', __('Plus (+)', 'captcha'), __('Plus', 'captcha')), array('cptch_math_action_minus', __('Minus (−)', 'captcha'), __('Minus', 'captcha')), array('cptch_math_action_increase', __('Multiplication (×)', 'captcha'), __('Multiply', 'captcha'))); /* This fields for the 'Difficulty for CAPTCHA' block which is located at the admin setting captcha page */ $cptch_admin_fields_difficulty = array(array('cptch_difficulty_number', __('Numbers', 'captcha'), __('Numbers', 'captcha')), array('cptch_difficulty_word', __('Words', 'captcha'), __('Words', 'captcha')), array('cptch_difficulty_image', __('Images', 'captcha'))); if (!function_exists('get_plugins')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $all_plugins = get_plugins(); $is_network = is_multisite() && is_network_admin(); $admin_url = $is_network ? network_admin_url('/') : admin_url('/'); $bws_contact_form = cptch_plugin_status(array('contact-form-plugin/contact_form.php', 'contact-form-pro/contact_form_pro.php'), $all_plugins, $is_network); /* Save data for settings page */ if (isset($_REQUEST['cptch_form_submit']) && check_admin_referer($plugin_basename, 'cptch_nonce_name')) { /* hide pro blocks */ if (isset($_POST['bws_hide_premium_options']) && check_admin_referer($plugin_basename, 'cptch_nonce_name')) { $hide_result = bws_hide_premium_options($cptch_options); $cptch_options = $hide_result['options']; } $cptch_options['cptch_login_form'] = isset($_REQUEST['cptch_login_form']) ? 1 : 0; $cptch_options['cptch_register_form'] = isset($_REQUEST['cptch_register_form']) ? 1 : 0; $cptch_options['cptch_lost_password_form'] = isset($_REQUEST['cptch_lost_password_form']) ? 1 : 0; $cptch_options['cptch_comments_form'] = isset($_REQUEST['cptch_comments_form']) ? 1 : 0; $cptch_options['cptch_hide_register'] = isset($_REQUEST['cptch_hide_register']) ? 1 : 0; $cptch_options['cptch_contact_form'] = isset($_REQUEST['cptch_contact_form']) ? 1 : 0; $cptch_options['cptch_label_form'] = isset($_REQUEST['cptch_label_form']) ? stripslashes(esc_html($_REQUEST['cptch_label_form'])) : ''; $cptch_options['cptch_required_symbol'] = isset($_REQUEST['cptch_required_symbol']) ? stripslashes(esc_html($_REQUEST['cptch_required_symbol'])) : ''; $cptch_options['cptch_error_empty_value'] = isset($_REQUEST['cptch_error_empty_value']) ? stripslashes(esc_html($_REQUEST['cptch_error_empty_value'])) : ''; $cptch_options['cptch_error_incorrect_value'] = isset($_REQUEST['cptch_error_incorrect_value']) ? stripslashes(esc_html($_REQUEST['cptch_error_incorrect_value'])) : ''; $cptch_options['cptch_error_time_limit'] = isset($_REQUEST['cptch_error_time_limit']) ? stripslashes(esc_html($_REQUEST['cptch_error_time_limit'])) : ''; $cptch_options['whitelist_message'] = isset($_REQUEST['cptch_whitelist_message']) ? stripslashes(esc_html($_REQUEST['cptch_whitelist_message'])) : ''; if ($cptch_options['cptch_error_empty_value'] == '') { $cptch_options['cptch_error_empty_value'] = $cptch_option_defaults['cptch_error_empty_value']; } if ($cptch_options['cptch_error_incorrect_value'] == '') { $cptch_options['cptch_error_incorrect_value'] = $cptch_option_defaults['cptch_error_incorrect_value']; } if ($cptch_options['cptch_error_time_limit'] == '') { $cptch_options['cptch_error_time_limit'] = $cptch_option_defaults['cptch_error_time_limit']; } $cptch_options['cptch_math_action_plus'] = isset($_REQUEST['cptch_math_action_plus']) ? 1 : 0; $cptch_options['cptch_math_action_minus'] = isset($_REQUEST['cptch_math_action_minus']) ? 1 : 0; $cptch_options['cptch_math_action_increase'] = isset($_REQUEST['cptch_math_action_increase']) ? 1 : 0; $cptch_options['cptch_difficulty_number'] = isset($_REQUEST['cptch_difficulty_number']) ? 1 : 0; $cptch_options['cptch_difficulty_word'] = isset($_REQUEST['cptch_difficulty_word']) ? 1 : 0; $cptch_options['cptch_difficulty_image'] = isset($_REQUEST['cptch_difficulty_image']) ? 1 : 0; $cptch_options['used_packages'] = isset($_REQUEST['cptch_used_packages']) ? $_REQUEST['cptch_used_packages'] : array(); $cptch_options['display_reload_button'] = isset($_REQUEST['cptch_display_reload_button']) ? 1 : 0; $cptch_options['enlarge_images'] = isset($_REQUEST['cptch_enlarge_images']) ? 1 : 0; $cptch_options['use_time_limit'] = isset($_REQUEST['cptch_use_time_limit']) ? 1 : 0; $cptch_options['time_limit'] = !isset($_REQUEST['cptch_time_limit']) || !is_numeric($_REQUEST['cptch_time_limit']) || 10 > $_REQUEST['cptch_time_limit'] ? 120 : $_REQUEST['cptch_time_limit']; /* Check select one point in the blocks Arithmetic actions and Difficulty on settings page */ $arithmetic_actions = isset($_REQUEST['cptch_math_action_plus']) || isset($_REQUEST['cptch_math_action_minus']) || isset($_REQUEST['cptch_math_action_increase']) ? true : false; $complexity_level = isset($_REQUEST['cptch_difficulty_number']) || isset($_REQUEST['cptch_difficulty_word']) || isset($_REQUEST['cptch_difficulty_image']) ? true : false; $image_optins = isset($_REQUEST['cptch_difficulty_image']) && isset($_REQUEST['cptch_used_packages']) || !isset($_REQUEST['cptch_difficulty_image']) ? true : false; /* if 'Arithmetic actions'- or 'Complexity level'- options are disabled */ if (!$arithmetic_actions || !$complexity_level) { $error = __("Please select one item in the block Arithmetic and Complexity for CAPTCHA", 'captcha'); /* if 'Use packages'-options are disabled */ } elseif (!$image_optins) { $error = __("Please select one item in the block Enable image packages", 'captcha'); } else { if (!is_null($wpdb->get_var("SELECT `id` FROM `{$wpdb->prefix}cptch_whitelist` LIMIT 1"))) { $cptch_options['whitelist_is_empty'] = false; } /* Update options in the database */ update_option('cptch_options', $cptch_options); $message = __("Settings saved.", 'captcha'); } } if (!class_exists('Cptch_package_loader')) { require_once dirname(__FILE__) . '/includes/package_loader.php'; } $package_loader = new Cptch_package_loader(); $error .= $package_loader->error; if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $cptch_options = $cptch_option_defaults; update_option('cptch_options', $cptch_options); $message = __('All plugin settings were restored.', 'captcha'); } require_once dirname(__FILE__) . '/includes/pro_banners.php'; /* GO PRO */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { $go_pro_result = bws_go_pro_tab_check($plugin_basename, 'cptch_options'); if (!empty($go_pro_result['error'])) { $error = $go_pro_result['error']; } elseif (!empty($go_pro_result['message'])) { $message = $go_pro_result['message']; } } /* Display form on the setting page */ ?> <div class="wrap"> <h1><?php _e('Captcha Settings', 'captcha'); ?> </h1> <ul class="subsubsub cptch_how_to_use"> <li><a href="https://docs.google.com/document/d/11_TUSAjMjG7hLa53lmyTZ1xox03hNlEA4tRmllFep3I/edit" target="_blank"><?php _e('How to Use Step-by-step Instruction', 'captcha'); ?> </a></li> </ul> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=captcha.php"><?php _e('Basic', 'captcha'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'advanced' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=captcha.php&action=advanced"><?php _e('Advanced', 'captcha'); ?> </a> <a class="nav-tab <?php if (isset($_GET['action']) && 'whitelist' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=captcha.php&action=whitelist"><?php _e('Whitelist', 'captcha'); ?> </a> <a class="nav-tab bws_go_pro_tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=captcha.php&action=go_pro"><?php _e('Go PRO', 'captcha'); ?> </a> </h2> <div class="updated fade" <?php if ('' == $message || "" != $error) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <div class="error" <?php if ("" == $error) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $error; ?> </strong></p></div> <?php if (!isset($_GET['action']) || !in_array($_GET['action'], array('whitelist', 'go_pro'))) { if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } else { bws_show_settings_notice(); if (!empty($hide_result['message'])) { ?> <div class="updated fade"><p><strong><?php echo $hide_result['message']; ?> </strong></p></div> <?php } ?> <form class="bws_form" method="post" action="admin.php?page=captcha.php<?php if (isset($_GET['action']) && 'advanced' == $_GET['action']) { echo '&action=advanced'; } ?> "> <table class="form-table"<?php if (isset($_GET['action'])) { echo ' style="display: none;"'; } ?> > <tr valign="top"> <th scope="row"><?php _e('Enable CAPTCHA for', 'captcha'); ?> :</th> <td> <fieldset> <legend class="screen-reader-text"><span><?php _e('Enable CAPTCHA for', 'captcha'); ?> </span></legend> <p><i><?php _e('WordPress default', 'captcha'); ?> </i></p> <?php foreach ($cptch_admin_fields_enable as $fields) { if (in_array($fields[0], array('cptch_register_form', 'cptch_lost_password_form')) && !in_array(get_current_blog_id(), array(0, 1))) { $notice = '<br /><span class="bws_info">' . __('This option is available only for main blog', 'captcha') . '</span>'; $disable_reg_form = ' disabled="disabled"'; $checked = ''; } else { $notice = $disable_reg_form = ''; $checked = 1 == $cptch_options[$fields[0]] ? ' checked="checked"' : ''; } ?> <label><input<?php echo $disable_reg_form . $checked; ?> type="checkbox" name="<?php echo $fields[0]; ?> " value="<?php echo $fields[0]; ?> "/> <?php echo $fields[1]; ?> </label> <div class="bws_help_box dashicons dashicons-editor-help cptch_thumb_block"> <div class="bws_hidden_help_text"><img src="<?php echo plugins_url('captcha/images') . '/' . $fields[2]; ?> " title="<?php echo $fields[1]; ?> " alt="<?php echo $fields[1]; ?> "/></div> </div> <?php echo $notice; ?> <br /> <?php } ?> <br /> <p><i><?php _e('Plugins', 'captcha'); ?> </i></p> <?php if ('actived' == $bws_contact_form['status']) { $disabled_attr = $info = ''; } elseif ('deactivated' == $bws_contact_form['status']) { $disabled_attr = "disabled='disabled'"; $info = '<span class="bws_info">' . __('You should', 'captcha') . ' <a href="' . $admin_url . 'plugins.php">' . __('activate', 'captcha') . ' Contact Form ' . (is_network_admin() ? __('for network', 'captcha') : '') . '</a>' . ' ' . __('to use this functionality', 'captcha') . '</span>'; } elseif ('not_installed' == $bws_contact_form['status']) { $disabled_attr = "disabled='disabled'"; $info = '<span class="bws_info">' . __('You should', 'captcha') . ' <a href="http://http://bestwebsoft.com/products/contact-form/?k=9ab9d358ad3a23b8a99a8328595ede2e&pn=72&v=' . $cptch_plugin_info["Version"] . '&wp_v=' . $wp_version . '">' . __('download', 'captcha') . ' Contact Form </a>' . ' ' . __('to use this functionality', 'captcha') . '</span>'; } ?> <label><input <?php echo $disabled_attr; ?> type="checkbox" name="cptch_contact_form" value="1" <?php if (1 == $cptch_options['cptch_contact_form']) { echo 'checked="checked"'; } ?> /> Contact Form by BestWebSoft</label> <div class="bws_help_box dashicons dashicons-editor-help cptch_thumb_block"> <div class="bws_hidden_help_text"> <img src="<?php echo plugins_url('captcha/images/contact_form.jpg'); ?> " title="Contact Form" alt="Contact Form"/> </div> </div> <?php echo $info; ?> <br /> <?php echo apply_filters('cptch_forms_list', ''); ?> <span class="bws_info"><?php _e('If you would like to add Captcha to a custom form, please see', 'captcha'); ?> <a href="http://bestwebsoft.com/products/captcha/faq" target="_blank">FAQ</a></span> </fieldset> </td> </tr> </table> <?php if (!isset($_GET['action'])) { cptch_pro_block('cptch_basic_banner'); } ?> <table class="form-table"<?php if (isset($_GET['action'])) { echo ' style="display: none;"'; } ?> > <tr valign="top"> <th scope="row"><?php _e('Hide CAPTCHA', 'captcha'); ?> </th> <td><?php foreach ($cptch_admin_fields_hide as $fields) { ?> <label><input type="checkbox" name="<?php echo $fields[0]; ?> " value="<?php echo $fields[0]; ?> " <?php if (1 == $cptch_options[$fields[0]]) { echo "checked=\"checked\""; } ?> /> <?php echo $fields[1]; ?> </label><br /> <?php } ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Title', 'captcha'); ?> </th> <td><input class="cptch_settings_input" type="text" name="cptch_label_form" value="<?php echo $cptch_options['cptch_label_form']; ?> " maxlength="100" /></td> </tr> <tr valign="top"> <th scope="row"><?php _e("Required symbol", 'captcha'); ?> </th> <td colspan="2"> <input class="cptch_settings_input" type="text" name="cptch_required_symbol" value="<?php echo $cptch_options['cptch_required_symbol']; ?> " maxlength="100" /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Show "Reload" button', 'captcha'); ?> </th> <td> <input type="checkbox" name="cptch_display_reload_button" value="1" <?php if (1 == $cptch_options['display_reload_button']) { echo 'checked="checked"'; } ?> /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Arithmetic actions', 'captcha'); ?> </th> <td colspan="2"> <fieldset> <legend class="screen-reader-text"><span><?php _e('Arithmetic actions for CAPTCHA', 'captcha'); ?> </span></legend> <?php foreach ($cptch_admin_fields_actions as $actions) { ?> <label><input type="checkbox" name="<?php echo $actions[0]; ?> " value="1" <?php if (1 == $cptch_options[$actions[0]]) { echo "checked=\"checked\""; } ?> /> <?php echo $actions[1]; ?> </label> <div class="bws_help_box dashicons dashicons-editor-help"> <div class="bws_hidden_help_text"><?php cptch_display_example($actions[0]); ?> </div> </div> <br /> <?php } ?> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Complexity', 'captcha'); ?> </th> <td colspan="2"><fieldset> <legend class="screen-reader-text"><span><?php _e('Complexity', 'captcha'); ?> </span></legend> <?php foreach ($cptch_admin_fields_difficulty as $diff) { ?> <label><input type="checkbox" name="<?php echo $diff[0]; ?> " value="<?php echo $cptch_options[$diff[0]]; ?> " <?php if (1 == $cptch_options[$diff[0]]) { echo "checked=\"checked\""; } ?> /> <?php echo $diff[1]; ?> </label> <div class="bws_help_box dashicons dashicons-editor-help"> <div class="bws_hidden_help_text<?php echo 'cptch_difficulty_image' == $diff[0] ? ' cptch_images_example' : ''; ?> "><?php cptch_display_example($diff[0]); ?> </div> </div> <br /> <?php } ?> </fieldset></td> </tr> </table> <?php $package_list = $wpdb->get_results("SELECT `id`, `name` FROM `{$wpdb->base_prefix}cptch_packages` ORDER BY `name` ASC;"); if (!empty($package_list)) { ?> <table class="form-table"<?php if (!isset($_GET['action'])) { echo ' style="display: none;"'; } ?> > <tr class="cptch_packages"> <th scope="row"><?php _e('Enable image packages', 'captcha'); ?> </th> <td> <select name="cptch_used_packages[]" multiple="multiple"> <?php foreach ($package_list as $pack) { ?> <option value="<?php echo $pack->id; ?> "<?php if (in_array($pack->id, $cptch_options['used_packages'])) { echo ' selected="selected"'; } ?> ><?php echo $pack->name; ?> </option> <?php } ?> </select> </td> </tr> <tr class="cptch_packages"> <th scope="row"><?php _e('Enlarge images on mouseover', 'captcha'); ?> </th> <td> <input type="checkbox" name="cptch_enlarge_images" value="1"<?php if (1 == $cptch_options['enlarge_images']) { echo ' checked="checked"'; } ?> /><br/> </td> </tr> </table> <?php } if (isset($_GET['action']) && 'advanced' == $_GET['action']) { cptch_pro_block('cptch_advanced_banner'); } ?> <table class="form-table"<?php if (!isset($_GET['action'])) { echo ' style="display: none;"'; } ?> > <tr valign="top"> <th scope="row"><?php _e('Enable time limit', 'captcha'); ?> </th> <td> <input type="checkbox" name="cptch_use_time_limit" value="1"<?php if (1 == $cptch_options['use_time_limit']) { echo ' checked="checked"'; } ?> /> </td> </tr> <tr valign="top" class="cptch_limt_options"<?php if (0 == $cptch_options['use_time_limit']) { echo ' style="display: none;"'; } ?> > <th scope="row"><?php _e('Set time limit', 'captcha'); ?> </th> <td> <label for="cptch_time_limit"> <input type="number" name="cptch_time_limit" id ="cptch_time_limit" min="10" max="9999" step="1" value="<?php echo $cptch_options['time_limit']; ?> " style="width: 70px;"/> <?php _e('seconds', 'captcha'); ?> </label> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Notification messages", 'captcha'); ?> </th> <td colspan="2"> <p><i><?php _e("Error", 'captcha'); ?> </i></p> <p><input class="cptch_settings_input" type="text" name="cptch_error_empty_value" value="<?php echo $cptch_options['cptch_error_empty_value']; ?> " maxlength="100" /> <?php _e('If CAPTCHA field is empty', 'captcha'); ?> </p> <p><input class="cptch_settings_input" type="text" name="cptch_error_incorrect_value" value="<?php echo $cptch_options['cptch_error_incorrect_value']; ?> " maxlength="100" /> <?php _e('If CAPTCHA is incorrect', 'captcha'); ?> </p> <p><input class="cptch_settings_input" type="text" name="cptch_error_time_limit" value="<?php echo $cptch_options['cptch_error_time_limit']; ?> " maxlength="100" /> <?php _e('If time limit is exhausted', 'captcha'); ?> </p> <p><i><?php _e("Info", 'captcha'); ?> </i></p> <p><input class="cptch_settings_input" type="text" name="cptch_whitelist_message" value="<?php echo $cptch_options['whitelist_message']; ?> " maxlength="100" /> <?php _e('If the user IP is added to the whitelist (this message will be displayed instead of CAPTCHA).', 'captcha'); ?> </p> </td> </tr> </table> <input type="hidden" name="cptch_form_submit" value="submit" /> <p class="submit"> <input id="bws-submit-button" type="submit" class="button-primary" value="<?php _e('Save Changes', 'captcha'); ?> " /> </p> <?php wp_nonce_field($plugin_basename, 'cptch_nonce_name'); ?> </form> <?php bws_form_restore_default_settings($plugin_basename); } } elseif ('go_pro' == $_GET['action']) { $show = bws_hide_premium_options_check($cptch_options) ? true : false; bws_go_pro_tab_show($show, $cptch_plugin_info, $plugin_basename, 'captcha.php', 'captcha_pro.php', 'captcha-pro/captcha_pro.php', 'captcha', '9701bbd97e61e52baa79c58c3caacf6d', '75', isset($go_pro_result['pro_plugin_is_activated'])); } elseif ('whitelist' == $_GET['action']) { $limit_attempts_info = cptch_plugin_status(array('limit-attempts/limit-attempts.php', 'limit-attempts-pro/limit-attempts-pro.php'), $all_plugins, $is_network); require_once dirname(__FILE__) . '/includes/whitelist.php'; $cptch_whitelist = new Cptch_Whitelist($plugin_basename, $limit_attempts_info); $cptch_whitelist->display_content(); } bws_plugin_reviews_block($cptch_plugin_info['Name'], 'captcha'); ?> </div> <?php }
function gllr_settings_page() { global $gllr_options, $wp_version, $gllr_plugin_info, $gllr_option_defaults, $gllr_BWS_demo_data; $error = $message = ""; $plugin_basename = plugin_basename(__FILE__); if (!function_exists('get_plugins')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $all_plugins = get_plugins(); if ($cstmsrch_options = get_option('cstmsrchpr_options')) { $option_name = "cstmsrchpr_options"; } elseif ($cstmsrch_options = get_option('cstmsrch_options')) { $option_name = "cstmsrch_options"; } elseif ($cstmsrch_options = get_option('bws_custom_search')) { $option_name = "bws_custom_search"; } else { $cstmsrch_options = $option_name = ''; } /* Save data for settings page */ if (isset($_REQUEST['gllr_form_submit']) && check_admin_referer($plugin_basename, 'gllr_nonce_name')) { $gllr_request_options = array(); if (isset($_POST['bws_hide_premium_options'])) { $hide_result = bws_hide_premium_options($gllr_request_options); $gllr_request_options = $hide_result['options']; } $gllr_request_options["gllr_custom_size_name"] = $gllr_options["gllr_custom_size_name"]; $gllr_custom_image_size_w_album = isset($_REQUEST['gllr_custom_image_size_w_album']) ? intval(trim($_REQUEST['gllr_custom_image_size_w_album'])) : $gllr_option_defaults["gllr_custom_size_px"][0][0]; $gllr_custom_image_size_h_album = isset($_REQUEST['gllr_custom_image_size_h_album']) ? intval(trim($_REQUEST['gllr_custom_image_size_h_album'])) : $gllr_option_defaults["gllr_custom_size_px"][0][1]; $gllr_custom_image_size_w_photo = isset($_REQUEST['gllr_custom_image_size_w_photo']) ? intval(trim($_REQUEST['gllr_custom_image_size_w_photo'])) : $gllr_option_defaults["gllr_custom_size_px"][1][0]; $gllr_custom_image_size_h_photo = isset($_REQUEST['gllr_custom_image_size_h_photo']) ? intval(trim($_REQUEST['gllr_custom_image_size_h_photo'])) : $gllr_option_defaults["gllr_custom_size_px"][1][1]; $gllr_request_options["gllr_custom_size_px"] = array(array($gllr_custom_image_size_w_album, $gllr_custom_image_size_h_album), array($gllr_custom_image_size_w_photo, $gllr_custom_image_size_h_photo)); $gllr_request_options["border_images"] = isset($_REQUEST['gllr_border_images']) ? 1 : 0; $gllr_request_options["border_images_width"] = isset($_REQUEST['gllr_border_images_width']) ? intval(trim($_REQUEST['gllr_border_images_width'])) : $gllr_option_defaults["border_images_width"]; $gllr_request_options["border_images_color"] = isset($_REQUEST['gllr_border_images_color']) ? trim($_REQUEST['gllr_border_images_color']) : $gllr_option_defaults["border_images_color"]; if (!preg_match('/^#[A-Fa-f0-9]{6}$/', $gllr_request_options["border_images_color"])) { $gllr_request_options["border_images_color"] = $gllr_option_defaults["border_images_color"]; } $gllr_request_options["custom_image_row_count"] = isset($_REQUEST['gllr_custom_image_row_count']) ? intval(trim($_REQUEST['gllr_custom_image_row_count'])) : $gllr_option_defaults["custom_image_row_count"]; if ("" == $gllr_request_options["custom_image_row_count"] || 1 > $gllr_request_options["custom_image_row_count"]) { $gllr_request_options["custom_image_row_count"] = 1; } $gllr_request_options["start_slideshow"] = isset($_REQUEST['gllr_start_slideshow']) ? 1 : 0; $gllr_request_options["slideshow_interval"] = !isset($_REQUEST['gllr_slideshow_interval']) || empty($_REQUEST['gllr_slideshow_interval']) ? 2000 : intval($_REQUEST['gllr_slideshow_interval']); $gllr_request_options["single_lightbox_for_multiple_galleries"] = isset($_REQUEST['gllr_single_lightbox_for_multiple_galleries']) ? 1 : 0; $gllr_request_options["order_by"] = isset($_REQUEST['gllr_order_by']) ? stripslashes(esc_html($_REQUEST['gllr_order_by'])) : $gllr_option_defaults["order_by"]; $gllr_request_options["order"] = isset($_REQUEST['gllr_order']) ? stripslashes(esc_html($_REQUEST['gllr_order'])) : $gllr_option_defaults["order"]; $gllr_request_options["album_order_by"] = isset($_REQUEST['gllr_album_order_by']) ? stripslashes(esc_html($_REQUEST['gllr_album_order_by'])) : $gllr_option_defaults["album_order_by"]; $gllr_request_options["album_order"] = isset($_REQUEST['gllr_album_order']) ? stripslashes(esc_html($_REQUEST['gllr_album_order'])) : $gllr_option_defaults["album_order"]; $gllr_request_options["image_text"] = isset($_REQUEST['gllr_image_text']) ? 1 : 0; $gllr_request_options["return_link"] = isset($_REQUEST['gllr_return_link']) ? 1 : 0; $gllr_request_options["return_link_page"] = isset($_REQUEST['gllr_return_link_page']) ? stripslashes(esc_html($_REQUEST['gllr_return_link_page'])) : $gllr_option_defaults["return_link_page"]; $gllr_request_options["return_link_url"] = isset($_REQUEST['gllr_return_link_url']) ? stripslashes(esc_html($_REQUEST['gllr_return_link_url'])) : $gllr_option_defaults["return_link_url"]; $gllr_request_options["return_link_shortcode"] = isset($_REQUEST['gllr_return_link_shortcode']) ? 1 : 0; $gllr_request_options["return_link_text"] = isset($_REQUEST['gllr_return_link_text']) ? stripslashes(esc_html($_REQUEST['gllr_return_link_text'])) : $gllr_option_defaults["return_link_text"]; $gllr_request_options["read_more_link_text"] = isset($_REQUEST['gllr_read_more_link_text']) ? stripslashes(esc_html($_REQUEST['gllr_read_more_link_text'])) : $gllr_option_defaults["read_more_link_text"]; $gllr_request_options["rewrite_template"] = isset($_REQUEST['gllr_rewrite_template']) ? 1 : 0; if (!empty($cstmsrch_options)) { if (isset($_REQUEST['gllr_add_to_search'])) { if (isset($cstmsrch_options['post_types']) && !in_array('gallery', $cstmsrch_options['post_types'])) { array_push($cstmsrch_options['post_types'], 'gallery'); } } else { if (isset($cstmsrch_options['post_types']) && in_array('gallery', $cstmsrch_options['post_types'])) { unset($cstmsrch_options['post_types'][array_search('gallery', $cstmsrch_options['post_types'])]); } } update_option($option_name, $cstmsrch_options); } /* Array merge incase this version has added new options */ $gllr_options = array_merge($gllr_options, $gllr_request_options); /* Check select one point in the blocks Arithmetic actions and Difficulty on settings page */ update_option('gllr_options', $gllr_options); $message = __("Settings are saved", 'gallery-plugin'); } $bws_hide_premium_options_check = bws_hide_premium_options_check($gllr_options); /* GO PRO */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { $go_pro_result = bws_go_pro_tab_check($plugin_basename, 'gllr_options'); if (!empty($go_pro_result['error'])) { $error = $go_pro_result['error']; } elseif (!empty($go_pro_result['message'])) { $message = $go_pro_result['message']; } } /* Display form on the setting page */ if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $gllr_options = $gllr_option_defaults; update_option('gllr_options', $gllr_options); $message = __('All plugin settings were restored.', 'gallery-plugin'); } /* check demo data */ $result = $gllr_BWS_demo_data->bws_handle_demo_data('gllr_plugin_upgrade'); if (!empty($result) && is_array($result)) { $error = $result['error']; $message = $result['done']; if (!empty($result['done']) && !empty($result['options'])) { $gllr_options = $result['options']; } } ?> <div class="wrap"> <h1 style="line-height: normal;"><?php _e('Gallery Settings', 'gallery-plugin'); ?> </h1> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=gallery-plugin.php"><?php _e('Settings', 'gallery-plugin'); ?> </a> <a class="nav-tab <?php if (isset($_GET['action']) && 'custom_code' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=gallery-plugin.php&action=custom_code"><?php _e('Custom code', 'gallery-plugin'); ?> </a> <a class="nav-tab bws_go_pro_tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=gallery-plugin.php&action=go_pro"><?php _e('Go PRO', 'gallery-plugin'); ?> </a> </h2> <div id="gllr_settings_message" class="updated below-h2 fade" <?php if ("" == $message) { echo 'style="display:none"'; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <div class="error below-h2" <?php if ("" == $error) { echo 'style="display:none"'; } ?> ><p><strong><?php echo $error; ?> </strong></p></div> <?php if (!isset($_GET['action'])) { if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } elseif (isset($_POST['bws_handle_demo']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $gllr_BWS_demo_data->bws_demo_confirm(); } else { ?> <noscript><div class="error below-h2"><p><?php _e('Please enable JavaScript to use the option to renew images.', 'gallery-plugin'); ?> </p></div></noscript> <?php bws_show_settings_notice(); if (!empty($hide_result['message'])) { ?> <div class="updated below-h2 fade"><p><strong><?php echo $hide_result['message']; ?> </strong></p></div> <?php } ?> <br/> <div><?php printf(__("If you would like to add a Gallery to your page or post, please use %s button", 'gallery-plugin'), '<span class="bws_code"><img style="vertical-align: sub;" src="' . plugins_url('bws_menu/images/shortcode-icon.png', __FILE__) . '" alt=""/></span>'); ?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help gllr_help_box_shorcode_info"> <div class="bws_hidden_help_text" style="min-width: 180px;"> <?php printf(__("You can add the Gallery to your page or post by clicking on %s button in the content edit block using the Visual mode. If the button isn't displayed, please use the shortcode %s, where * stands for gallery ID", 'gallery-plugin'), '<code><img style="vertical-align: sub;" src="' . plugins_url('bws_menu/images/shortcode-icon.png', __FILE__) . '" alt="" /></code>', '<span class="bws_code">[print_gllr id=*]</span>'); ?> </div> </div> </div> <form class="bws_form" method="post" action="admin.php?page=gallery-plugin.php"> <table class="gllr_settings_table form-table"> <tr valign="top"> <th scope="row"><?php _e('Number of images in the row', 'gallery-plugin'); ?> </th> <td> <input type="number" name="gllr_custom_image_row_count" min="1" max="10000" value="<?php echo $gllr_options["custom_image_row_count"]; ?> " /> <span class="bws_info"><?php _e('The number of images per row can be less depending on the width of the parent block', 'gallery-plugin'); ?> </span> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Image size', 'gallery-plugin'); ?> </th> <td> <fieldset> <span class="bws_info"><?php _e('WordPress will create a new thumbnail with the specified dimensions when you upload a new photo.', 'gallery-plugin'); ?> </span> <div class="gllr_settings_size" style="margin: 0 0 10px;"> <label><strong><?php _e('For the album cover', 'gallery-plugin'); ?> </strong> <span>(<?php echo $gllr_options["gllr_custom_size_name"][0]; ?> )</span></label><br /> <input type="number" name="gllr_custom_image_size_w_album" min="1" max="10000" value="<?php echo $gllr_options["gllr_custom_size_px"][0][0]; ?> " /> x <input type="number" name="gllr_custom_image_size_h_album" min="1" max="10000" value="<?php echo $gllr_options["gllr_custom_size_px"][0][1]; ?> " /> <span class="bws_info">(<?php _e('width x height', 'gallery-plugin'); ?> ) <?php _e('in px', 'gallery-plugin'); ?> </span> </div> <div class="gllr_settings_size" style="margin: 0 0 10px;"> <label><strong><?php _e('For thumbnails', 'gallery-plugin'); ?> </strong> (<?php echo $gllr_options["gllr_custom_size_name"][1]; ?> )</label><br /> <input type="number" name="gllr_custom_image_size_w_photo" min="1" max="10000" value="<?php echo $gllr_options["gllr_custom_size_px"][1][0]; ?> " /> x <input type="number" name="gllr_custom_image_size_h_photo" min="1" max="10000" value="<?php echo $gllr_options["gllr_custom_size_px"][1][1]; ?> " /> <span class="bws_info">(<?php _e('width x height', 'gallery-plugin'); ?> ) <?php _e('in px', 'gallery-plugin'); ?> </span> </div> <div class="gllr_settings_size" style="margin: 0 0 10px;"> <input type="button" value="<?php _e('Update images for gallery', 'gallery-plugin'); ?> " id="gllr_ajax_update_images" name="ajax_update_images" class="button" /> <div id="gllr_img_loader"><img src="<?php echo plugins_url('images/ajax-loader.gif', __FILE__); ?> " alt="loader" /></div> </div> </fieldset> </td> </tr> </table> <?php if (!$bws_hide_premium_options_check) { ?> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e('Close', 'gallery-plugin'); ?> "></button> <div class="bws_table_bg"></div> <table class="gllr_settings_table form-table bws_pro_version"> <tr valign="top"> <th scope="row"><?php _e('Image size', 'gallery-plugin'); ?> </th> <td> <fieldset> <label><strong><?php _e('For images in the lightbox', 'gallery-plugin'); ?> </strong> (full-photo)</label> <div class="gllr_settings_size" style="margin: 0 0 10px;"> <input disabled class="gllrprfssnl_size_photo_full" type="number" name="gllrprfssnl_custom_image_size_w_full" min="1" max="10000" value="1024" /> x <input disabled class="gllrprfssnl_size_photo_full" type="number" name="gllrprfssnl_custom_image_size_h_full" min="1" max="10000" value="1024" /> <span class="bws_info">(<?php _e('width x height', 'gallery-plugin'); ?> ) <?php _e('in px', 'gallery-plugin'); ?> </span> </div> <input disabled type="checkbox" name="gllrprfssnl_size_photo_full" value="1" /> <?php _e('Display a full size image in the lightbox', 'gallery-plugin'); ?> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Crop position', 'gallery-plugin'); ?> </th> <td> <label> <select disabled style="min-width: 100px; max-width: 150px; width: 100%;"> <option value="center"><?php _e('center', 'gallery-plugin'); ?> </option> </select> <span class="bws_info"><?php _e('Horizontal', 'gallery-plugin'); ?> </span> </label><br /> <label> <select disabled style="min-width: 100px; max-width: 150px; width: 100%;"> <option value="center"><?php _e('center', 'gallery-plugin'); ?> </option> </select> <span class="bws_info"><?php _e('Vertical', 'gallery-plugin'); ?> </span> </label> </td> </tr> <tr valign="top"> <th scope="row" colspan="2"> * <?php _e('If you upgrade to Pro version all your settings and galleries will be saved.', 'gallery-plugin'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'gallery-plugin'); ?> </div> <div class="bws_pro_links"> <span class="bws_trial_info"> <a href="http://bestwebsoft.com/products/gallery/trial/?k=63a36f6bf5de0726ad6a43a165f38fe5&pn=79&v=<?php echo $gllr_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Gallery Pro Plugin"><?php _e('Start Your Trial', 'gallery-plugin'); ?> </a> <?php _e('or', 'gallery-plugin'); ?> </span> <a class="bws_button" href="http://bestwebsoft.com/products/gallery/?k=63a36f6bf5de0726ad6a43a165f38fe5&pn=79&v=<?php echo $gllr_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Gallery Pro Plugin"><?php _e('Learn More', 'gallery-plugin'); ?> </a> </div> <div class="gllr_clear"></div> </div> </div> <?php } ?> <table class="gllr_settings_table form-table"> <tr> <th scope="row"><?php _e('Display image text', 'gallery-plugin'); ?> </th> <td> <label><input type="checkbox" name="gllr_image_text" value="1" <?php if (1 == $gllr_options["image_text"]) { echo 'checked="checked"'; } ?> /> <?php _e('Turn off the checkbox, if you want to display text just in a lightbox', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Images with border', 'gallery-plugin'); ?> </th> <td> <input type="checkbox" name="gllr_border_images" value="1" <?php if (1 == $gllr_options["border_images"]) { echo 'checked="checked"'; } ?> /><br /> <div class="gllr_for_border_images"> <input type="number" min="0" max="10000" value="<?php echo $gllr_options["border_images_width"]; ?> " name="gllr_border_images_width" /> <span class="bws_info"><?php _e('Border width in px, just numbers', 'gallery-plugin'); ?> </span><br /> <input type="text" value="<?php echo $gllr_options["border_images_color"]; ?> " name="gllr_border_images_color" class="gllr_color_field" data-default-color="#F1F1F1" /> </div> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Sort images', 'gallery-plugin'); ?> </th> <td> <fieldset> <label><input type="radio" name="gllr_order_by" value="ID" <?php if ('ID' == $gllr_options["order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('by Attachment ID', 'gallery-plugin'); ?> </label><br /> <label><input type="radio" name="gllr_order_by" value="title" <?php if ('title' == $gllr_options["order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('by Image Name', 'gallery-plugin'); ?> </label><br /> <label><input type="radio" name="gllr_order_by" value="date" <?php if ('date' == $gllr_options["order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('by Date', 'gallery-plugin'); ?> </label><br /> <label><input type="radio" name="gllr_order_by" value="meta_value_num" <?php if ('meta_value_num' == $gllr_options["order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('by Sorting order in the Gallery', 'gallery-plugin'); ?> </label><br /> <label><input type="radio" name="gllr_order_by" value="rand" <?php if ('rand' == $gllr_options["order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('Random', 'gallery-plugin'); ?> </label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('The images sort order', 'gallery-plugin'); ?> </th> <td> <fieldset> <label><input type="radio" name="gllr_order" value="ASC" <?php if ('ASC' == $gllr_options["order"]) { echo 'checked="checked"'; } ?> /> <?php _e('ASC (ascending order from lowest to highest values - 1, 2, 3; a, b, c)', 'gallery-plugin'); ?> </label><br /> <label><input type="radio" name="gllr_order" value="DESC" <?php if ('DESC' == $gllr_options["order"]) { echo 'checked="checked"'; } ?> /> <?php _e('DESC (descending order from highest to lowest values - 3, 2, 1; c, b, a)', 'gallery-plugin'); ?> </label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Sort galleries', 'gallery-plugin'); ?> </th> <td> <fieldset> <label><input type="radio" name="gllr_album_order_by" value="ID" <?php if ('ID' == $gllr_options["album_order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('by Gallery ID', 'gallery-plugin'); ?> </label><br /> <label><input type="radio" name="gllr_album_order_by" value="title" <?php if ('title' == $gllr_options["album_order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('by Title', 'gallery-plugin'); ?> </label><br /> <label><input type="radio" name="gllr_album_order_by" value="date" <?php if ('date' == $gllr_options["album_order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('by Date', 'gallery-plugin'); ?> </label><br /> <label><input type="radio" name="gllr_album_order_by" value="modified" <?php if ('modified' == $gllr_options["album_order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('by Last modified date', 'gallery-plugin'); ?> </label><br /> <label><input type="radio" name="gllr_album_order_by" value="comment_count" <?php if ('comment_count' == $gllr_options["album_order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('by Comment count', 'gallery-plugin'); ?> </label><br /> <label><input type="radio" name="gllr_album_order_by" value="menu_order" <?php if ('menu_order' == $gllr_options["album_order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('by Sorting order (the input field for sorting order)', 'gallery-plugin'); ?> </label><br /> <label><input type="radio" name="gllr_album_order_by" value="author" <?php if ('author' == $gllr_options["album_order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('by Author', 'gallery-plugin'); ?> </label><br /> <label><input type="radio" name="gllr_album_order_by" value="rand" <?php if ('rand' == $gllr_options["album_order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('Random', 'gallery-plugin'); ?> </label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('The galleries sort order', 'gallery-plugin'); ?> </th> <td> <fieldset> <label><input type="radio" name="gllr_album_order" value="ASC" <?php if ('ASC' == $gllr_options["album_order"]) { echo 'checked="checked"'; } ?> /> <?php _e('ASC (ascending order from lowest to highest values - 1, 2, 3; a, b, c)', 'gallery-plugin'); ?> </label><br /> <label><input type="radio" name="gllr_album_order" value="DESC" <?php if ('DESC' == $gllr_options["album_order"]) { echo 'checked="checked"'; } ?> /> <?php _e('DESC (descending order from highest to lowest values - 3, 2, 1; c, b, a)', 'gallery-plugin'); ?> </label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Start slideshow', 'gallery-plugin'); ?> </th> <td> <input type="checkbox" name="gllr_start_slideshow" value="1" <?php if (1 == $gllr_options["start_slideshow"]) { echo 'checked="checked"'; } ?> /><br> <div class="gllr_for_start_slideshow"><input type="number" name="gllr_slideshow_interval" min="1" max="1000000" value="<?php echo $gllr_options["slideshow_interval"]; ?> " /> <span class="bws_info"><?php _e('Slideshow interval', 'gallery-plugin'); ?> <?php _e('(ms)', 'gallery-plugin'); ?> </span></div> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Use single lightbox for multiple galleries on one page', 'gallery-plugin'); ?> </th> <td> <input type="checkbox" name="gllr_single_lightbox_for_multiple_galleries" value="1" <?php if (1 == $gllr_options["single_lightbox_for_multiple_galleries"]) { echo 'checked="checked"'; } ?> /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Display the Back link', 'gallery-plugin'); ?> </th> <td> <input type="checkbox" name="gllr_return_link" value="1" <?php if (1 == $gllr_options["return_link"]) { echo 'checked="checked"'; } ?> /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Display the Back link in the shortcode', 'gallery-plugin'); ?> </th> <td> <input type="checkbox" name="gllr_return_link_shortcode" value="1" <?php if (1 == $gllr_options["return_link_shortcode"]) { echo 'checked="checked"'; } ?> /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('The Back link text', 'gallery-plugin'); ?> </th> <td> <input type="text" name="gllr_return_link_text" maxlength="250" value="<?php echo $gllr_options["return_link_text"]; ?> " /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('The Back link URL', 'gallery-plugin'); ?> </th> <td> <fieldset> <label><input type="radio" value="gallery_template_url" name="gllr_return_link_page" <?php if ('gallery_template_url' == $gllr_options["return_link_page"]) { echo 'checked="checked"'; } ?> /><?php _e('Gallery page (Page with Gallery Template)', 'gallery-plugin'); ?> </label><br /> <input type="radio" value="custom_url" name="gllr_return_link_page" id="gllr_return_link_url" <?php if ('custom_url' == $gllr_options["return_link_page"]) { echo 'checked="checked"'; } ?> /> <input type="text" value="<?php echo $gllr_options["return_link_url"]; ?> " name="gllr_return_link_url" maxlength="250" /> <label for="gllr_return_link_url"><?php _e('(Full URL to custom page)', 'gallery-plugin'); ?> </label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('The Read More link text', 'gallery-plugin'); ?> </th> <td> <input type="text" name="gllr_read_more_link_text" maxlength="250" value="<?php echo $gllr_options["read_more_link_text"]; ?> " /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Add gallery to the search', 'gallery-plugin'); ?> </th> <td> <?php if (array_key_exists('custom-search-plugin/custom-search-plugin.php', $all_plugins) || array_key_exists('custom-search-pro/custom-search-pro.php', $all_plugins)) { if (is_plugin_active('custom-search-plugin/custom-search-plugin.php') || is_plugin_active('custom-search-pro/custom-search-pro.php')) { ?> <input type="checkbox" name="gllr_add_to_search" value="1" <?php if (!empty($cstmsrch_options['post_types']) && in_array('gallery', $cstmsrch_options['post_types'])) { echo 'checked="checked"'; } ?> /> <span class="bws_info"> (<?php _e('Using', 'gallery-plugin'); ?> Custom Search <?php _e('powered by', 'gallery-plugin'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>)</span> <?php } else { ?> <input disabled="disabled" type="checkbox" name="gllr_add_to_search" value="1" <?php if (!empty($cstmsrch_options['post_types']) && in_array('gallery', $cstmsrch_options['post_types'])) { echo 'checked="checked"'; } ?> /> <span class="bws_info">(<?php _e('Using', 'gallery-plugin'); ?> Custom Search <?php _e('powered by', 'gallery-plugin'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php _e('Activate', 'gallery-plugin'); ?> Custom Search</a></span> <?php } } else { ?> <input disabled="disabled" type="checkbox" name="gllr_add_to_search" value="1" /> <span class="bws_info">(<?php _e('Using', 'gallery-plugin'); ?> Custom Search <?php _e('powered by', 'gallery-plugin'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="http://bestwebsoft.com/products/custom-search/"><?php _e('Download', 'gallery-plugin'); ?> Custom Search</a></span> <?php } ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Rewrite templates after update', 'gallery-plugin'); ?> </th> <td> <input type="checkbox" name="gllr_rewrite_template" value="1" <?php if (1 == $gllr_options['rewrite_template']) { echo 'checked="checked"'; } ?> /> <span class="bws_info"><?php printf(__("Turn off the checkbox, if You edited the file '%s' or '%s' file in your theme folder and You don't want to rewrite them", 'gallery-plugin'), 'gallery-template.php', 'gallery-single-template.php'); ?> </span> </td> </tr> </table> <?php if (!$bws_hide_premium_options_check) { ?> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e('Close', 'gallery-plugin'); ?> "></button> <div class="bws_table_bg gllr_bws_table_bg"></div> <table class="gllr_settings_table form-table bws_pro_version"> <tr valign="top"> <th scope="row"><?php _e('Single gallery view', 'gallery-plugin'); ?> </th> <td> <fieldset> <label><input disabled="disabled" type="radio" name="gllrprfssnl_view" value="grid" checked="checked" /> <?php _e('Grid', 'gallery-plugin'); ?> <span class="bws_help_box dashicons dashicons-editor-help gllr_help_box"><span class="bws_hidden_help_text"><img src="<?php echo plugins_url('images/view_grid.jpg', __FILE__); ?> "></span></span></label><br/> <label><input disabled="disabled" type="radio" name="gllrprfssnl_view" value="masonry" /> <?php _e('Masonry', 'gallery-plugin'); ?> <span class="bws_help_box dashicons dashicons-editor-help gllr_help_box"><span class="bws_hidden_help_text"><img src="<?php echo plugins_url('images/view_masonry.jpg', __FILE__); ?> "></span></span></label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Display image text', 'gallery-plugin'); ?> </th> <td> <fieldset> <label><input disabled type="radio" value="under" checked="checked"> <?php _e('Under image', 'gallery-plugin'); ?> <span class="bws_help_box dashicons dashicons-editor-help gllr_help_box"><span class="bws_hidden_help_text"><img src="<?php echo plugins_url('images/display_text_under_image.jpg', __FILE__); ?> "></span></span></label><br/> <label><input disabled type="radio" value="hover"> <?php _e('By mouse hover', 'gallery-plugin'); ?> <span class="bws_help_box dashicons dashicons-editor-help gllr_help_box"><span class="bws_hidden_help_text"><img src="<?php echo plugins_url('images/display_text_by_mouse_hover.jpg', __FILE__); ?> "></span></span></label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Use pagination for images', 'gallery-plugin'); ?> </th> <td> <input disabled type="checkbox" name="gllrprfssnl_images_pagination" value="1" checked="checked" /><br /> <label><input disabled type="number" name="gllrprfssnl_images_per_page" min="1" max="1000" value="10" style="width:100px;" /> <?php _e('per page', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Lightbox background', 'gallery-plugin'); ?> </th> <td> <input disabled class="button button-small gllrprfssnl_lightbox_default" type="button" value="<?php _e('Default', 'gallery-plugin'); ?> "> <br /> <input disabled type="text" size="8" value="0.7" name="gllrprfssnl_background_lightbox_opacity" /> <span class="bws_info"><?php _e('Background transparency (from 0 to 1)', 'gallery-plugin'); ?> </span> <br /> <input disabled type="text" value="#777777" name="gllr_border_images_color" class="gllr_color_field" data-default-color="#777777" /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('The lightbox helper', 'gallery-plugin'); ?> </th> <td> <label><input disabled type="radio" name="gllrprfssnl_fancybox_helper" value="none" checked="checked" /> <?php _e('Do not use', 'gallery-plugin'); ?> </label><br /> <label><input disabled type="radio" name="gllrprfssnl_fancybox_helper" value="button" /> <?php _e('Button helper', 'gallery-plugin'); ?> </label><br /> <label><input disabled type="radio" name="gllrprfssnl_fancybox_helper" value="thumbnail" /> <?php _e('Thumbnail helper', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Display Like buttons in the lightbox', 'gallery-plugin'); ?> </th> <td> <label><input disabled type="checkbox" name="gllrprfssnl_like_button_fb" value="1" /> <?php _e('FaceBook', 'gallery-plugin'); ?> </label><br /> <label><input disabled type="checkbox" name="gllrprfssnl_like_button_twit" value="1" /> <?php _e('Twitter', 'gallery-plugin'); ?> </label><br /> <label><input disabled type="checkbox" name="gllrprfssnl_like_button_pint" value="1" /> <?php _e('Pinterest', 'gallery-plugin'); ?> </label><br /> <label><input disabled type="checkbox" name="gllrprfssnl_like_button_g_plusone" value="1" /> <?php _e('Google +1', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Slug for gallery item', 'gallery-plugin'); ?> </th> <td> <input type="text" name="gllrprfssnl_slug" value="gallery" disabled /> <span class="bws_info"><?php _e('for any structure of permalinks except the default structure', 'gallery-plugin'); ?> </span> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Title for lightbox button', 'gallery-plugin'); ?> </th> <td> <input type="text" name="gllrprfssnl_lightbox_button_text" disabled value="" /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Display all images in the lightbox instead of going into a single gallery', 'gallery-plugin'); ?> </th> <td> <input type="checkbox" name="gllrpr_hide_single_gallery" value="1" disabled /> <span class="bws_info">(<?php printf(__('When using the gallery template or a shortcode with `%s` parameter', 'gallery-plugin'), 'display=short'); ?> )</span> </td> </tr> <tr valign="top"> <th scope="row" colspan="2"> * <?php _e('If you upgrade to Pro version all your settings and galleries will be saved.', 'gallery-plugin'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'gallery-plugin'); ?> </div> <div class="bws_pro_links"> <span class="bws_trial_info"> <a href="http://bestwebsoft.com/products/gallery/trial/?k=63a36f6bf5de0726ad6a43a165f38fe5&pn=79&v=<?php echo $gllr_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Gallery Pro Plugin"><?php _e('Start Your Trial', 'gallery-plugin'); ?> </a> <?php _e('or', 'gallery-plugin'); ?> </span> <a class="bws_button" href="http://bestwebsoft.com/products/gallery/?k=63a36f6bf5de0726ad6a43a165f38fe5&pn=79&v=<?php echo $gllr_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Gallery Pro Plugin"><?php _e('Learn More', 'gallery-plugin'); ?> </a> </div> <div class="gllr_clear"></div> </div> </div> <?php } ?> <p class="submit"> <input id="bws-submit-button" type="submit" class="button-primary" value="<?php _e('Save Changes', 'gallery-plugin'); ?> " /> <input type="hidden" name="gllr_form_submit" value="submit" /> <?php wp_nonce_field($plugin_basename, 'gllr_nonce_name'); ?> </p> </form> <?php $gllr_BWS_demo_data->bws_show_demo_button(__('If you install the demo-data, will be created galleries with images, demo-post with available shortcodes and page with a list of all the galleries.', 'gallery-plugin')); bws_form_restore_default_settings($plugin_basename); } } elseif ('custom_code' == $_GET['action']) { bws_custom_code_tab(); } elseif ('go_pro' == $_GET['action']) { bws_go_pro_tab_show($bws_hide_premium_options_check, $gllr_plugin_info, $plugin_basename, 'gallery-plugin.php', 'gallery-plugin-pro.php', 'gallery-plugin-pro/gallery-plugin-pro.php', 'gallery', '63a36f6bf5de0726ad6a43a165f38fe5', '79', isset($go_pro_result['pro_plugin_is_activated']), '7'); } bws_plugin_reviews_block($gllr_plugin_info['Name'], 'gallery-plugin'); ?> </div> <?php }
function lmtttmpts_settings_page() { global $lmtttmpts_options, $wpdb, $lmtttmpts_plugin_info, $wp_version, $lmtttmpts_option_defaults; $prefix = $wpdb->prefix . 'lmtttmpts_'; $error = $message = ''; $plugin_basename = plugin_basename(__FILE__); $action_message = array('error' => '', 'done' => ''); if (!function_exists('get_plugins')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $all_plugins = get_plugins(); if (is_multisite()) { $active_plugins = (array) array_keys(get_site_option('active_sitewide_plugins', array())); $active_plugins = array_merge($active_plugins, get_option('active_plugins')); } else { $active_plugins = get_option('active_plugins'); } /* get admins for emails */ $userslogin = get_users('blog_id=' . $GLOBALS['blog_id'] . '&role=administrator'); /* Start updating and verification options from Settings form */ /* If form was submited - whether "Save changes" button was pressed or not - check for inputed values and firstly update var $lmtttmpts_options only */ if (isset($_POST['lmtttmpts_form_submit']) && check_admin_referer($plugin_basename, 'lmtttmpts_nonce_name')) { /*Verification and updating option with allowed retries, after which address will be blocked automatically*/ if (isset($_POST['lmtttmpts_allowed_retries']) && $_POST['lmtttmpts_allowed_retries'] >= 1 && is_numeric($_POST['lmtttmpts_allowed_retries'])) { $lmtttmpts_options['allowed_retries'] = floor($_POST['lmtttmpts_allowed_retries']); } /*Verification and updating option with days of lock*/ if (isset($_POST['lmtttmpts_days_of_lock']) && $_POST['lmtttmpts_days_of_lock'] >= 0 && is_numeric($_POST['lmtttmpts_days_of_lock'])) { $lmtttmpts_options['days_of_lock'] = floor($_POST['lmtttmpts_days_of_lock']); } /*Verification and updating option with hours of lock*/ if (isset($_POST['lmtttmpts_hours_of_lock']) && $_POST['lmtttmpts_hours_of_lock'] >= 0 && $_POST['lmtttmpts_hours_of_lock'] <= 23 && is_numeric($_POST['lmtttmpts_hours_of_lock'])) { $lmtttmpts_options['hours_of_lock'] = floor($_POST['lmtttmpts_hours_of_lock']); } elseif ($_POST['lmtttmpts_hours_of_lock'] > 23) { $lmtttmpts_options['hours_of_lock'] = 23; } /*Verification and updating option with minutes of lock*/ if (isset($_POST['lmtttmpts_minutes_of_lock']) && $_POST['lmtttmpts_minutes_of_lock'] >= 0 && $_POST['lmtttmpts_minutes_of_lock'] <= 59 && is_numeric($_POST['lmtttmpts_minutes_of_lock'])) { $lmtttmpts_options['minutes_of_lock'] = floor($_POST['lmtttmpts_minutes_of_lock']); } elseif ($_POST['lmtttmpts_minutes_of_lock'] > 59) { $lmtttmpts_options['minutes_of_lock'] = 59; } /*Verification and updating option with days to reset failed attempts quantity*/ if (isset($_POST['lmtttmpts_days_to_reset']) && $_POST['lmtttmpts_days_to_reset'] >= 0 && is_numeric($_POST['lmtttmpts_days_to_reset'])) { $lmtttmpts_options['days_to_reset'] = floor($_POST['lmtttmpts_days_to_reset']); } /*Verification and updating option with minutes to reset failed attempts quantity*/ if (isset($_POST['lmtttmpts_hours_to_reset']) && $_POST['lmtttmpts_hours_to_reset'] >= 0 && $_POST['lmtttmpts_hours_to_reset'] <= 23 && is_numeric($_POST['lmtttmpts_hours_to_reset'])) { $lmtttmpts_options['hours_to_reset'] = floor($_POST['lmtttmpts_hours_to_reset']); } elseif ($_POST['lmtttmpts_hours_to_reset'] > 23) { $lmtttmpts_options['hours_to_reset'] = 23; } /*Verification and updating option with minutes to reset failed attempts quantity*/ if (isset($_POST['lmtttmpts_minutes_to_reset']) && $_POST['lmtttmpts_minutes_to_reset'] >= 0 && $_POST['lmtttmpts_minutes_to_reset'] <= 59 && is_numeric($_POST['lmtttmpts_minutes_to_reset'])) { $lmtttmpts_options['minutes_to_reset'] = floor($_POST['lmtttmpts_minutes_to_reset']); } elseif ($_POST['lmtttmpts_minutes_to_reset'] > 59) { $lmtttmpts_options['minutes_to_reset'] = 59; } /*Verification and updating option with allowed locks, after which address will be blacklisted automatically*/ if (isset($_POST['lmtttmpts_allowed_locks']) && $_POST['lmtttmpts_allowed_locks'] >= 1 && is_numeric($_POST['lmtttmpts_allowed_locks'])) { $lmtttmpts_options['allowed_locks'] = floor($_POST['lmtttmpts_allowed_locks']); } /*Verification and updating option with days to reset blocks quantity*/ if (isset($_POST['lmtttmpts_days_to_reset_block']) && $_POST['lmtttmpts_days_to_reset_block'] >= 0 && is_numeric($_POST['lmtttmpts_days_to_reset_block'])) { $lmtttmpts_options['days_to_reset_block'] = floor($_POST['lmtttmpts_days_to_reset_block']); } /*Verification and updating option with hours to reset blocks quantity*/ if (isset($_POST['lmtttmpts_hours_to_reset_block']) && $_POST['lmtttmpts_hours_to_reset_block'] >= 0 && $_POST['lmtttmpts_hours_to_reset_block'] <= 23 && is_numeric($_POST['lmtttmpts_hours_to_reset_block'])) { $lmtttmpts_options['hours_to_reset_block'] = floor($_POST['lmtttmpts_hours_to_reset_block']); } elseif ($_POST['lmtttmpts_hours_to_reset_block'] > 23) { $lmtttmpts_options['hours_to_reset_block'] = 23; } /*Verification and updating option with minutes to reset blocks quantity*/ if (isset($_POST['lmtttmpts_minutes_to_reset_block']) && $_POST['lmtttmpts_minutes_to_reset_block'] >= 0 && $_POST['lmtttmpts_minutes_to_reset_block'] <= 59 && is_numeric($_POST['lmtttmpts_minutes_to_reset_block'])) { $lmtttmpts_options['minutes_to_reset_block'] = floor($_POST['lmtttmpts_minutes_to_reset_block']); } elseif ($_POST['lmtttmpts_minutes_to_reset_block'] > 59) { $lmtttmpts_options['minutes_to_reset_block'] = 59; } /* Veification and updating option with days to clear statistics */ if (isset($_POST['lmtttmpts_days_to_clear_statistics']) && $_POST['lmtttmpts_days_to_clear_statistics'] >= 0 && is_numeric($_POST['lmtttmpts_days_to_clear_statistics'])) { if ($lmtttmpts_options['days_to_clear_statistics'] != floor($_POST['lmtttmpts_days_to_clear_statistics']) && isset($_POST['lmtttmpts_form_submit_button'])) { if ($lmtttmpts_options['days_to_clear_statistics'] == 0) { $time = time() - fmod(time(), 86400) + 86400; wp_schedule_event($time, 'daily', 'lmtttmpts_daily_statistics_clear'); } elseif ($_POST['lmtttmpts_days_to_clear_statistics'] == 0) { wp_clear_scheduled_hook('lmtttmpts_daily_statistics_clear'); } } $lmtttmpts_options['days_to_clear_statistics'] = floor($_POST['lmtttmpts_days_to_clear_statistics']); } /*Updating options with notify by email options*/ $lmtttmpts_options['notify_email'] = isset($_POST['lmtttmpts_notify_email']) ? true : false; if (isset($_POST['lmtttmpts_mailto'])) { $lmtttmpts_options['mailto'] = $_POST['lmtttmpts_mailto']; if ('admin' == $_POST['lmtttmpts_mailto']) { $lmtttmpts_options['email_address'] = $_POST['lmtttmpts_user_email_address']; } elseif ('custom' == $_POST['lmtttmpts_mailto'] && isset($_POST['lmtttmpts_email_address']) && is_email($_POST['lmtttmpts_email_address'])) { $lmtttmpts_options['email_address'] = $_POST['lmtttmpts_email_address']; } } /*Updating options of interaction with Htaccess plugin*/ if (isset($_POST['lmtttmpts_block_by_htaccess'])) { if ((0 < count(preg_grep('/htaccess\\/htaccess.php/', $active_plugins)) || 0 < count(preg_grep('/htaccess-pro\\/htaccess-pro.php/', $active_plugins))) && !isset($lmtttmpts_options['block_by_htaccess'])) { do_action('lmtttmpts_htaccess_hook_for_copy_all'); } $lmtttmpts_options['block_by_htaccess'] = $_POST['lmtttmpts_block_by_htaccess']; } else { if ((0 < count(preg_grep('/htaccess\\/htaccess.php/', $active_plugins)) || 0 < count(preg_grep('/htaccess-pro\\/htaccess-pro.php/', $active_plugins))) && isset($lmtttmpts_options['block_by_htaccess'])) { do_action('lmtttmpts_htaccess_hook_for_delete_all'); } unset($lmtttmpts_options['block_by_htaccess']); } /*Updating options of interaction with Captcha plugin in login form*/ if (isset($_POST['lmtttmpts_login_form_captcha_check'])) { $lmtttmpts_options['login_form_captcha_check'] = $_POST['lmtttmpts_login_form_captcha_check']; } else { unset($lmtttmpts_options['login_form_captcha_check']); } /* array for saving and restoring default messages */ $lmtttmpts_messages = array('failed_message', 'blocked_message', 'blacklisted_message', 'email_subject', 'email_subject_blacklisted', 'email_blocked', 'email_blacklisted'); /* Update messages when login failed, address blocked or blacklisted, email subject and text when address blocked or blacklisted */ foreach ($lmtttmpts_messages as $lmtttmpts_single_message) { if (isset($_POST['lmtttmpts_' . $lmtttmpts_single_message])) { $lmtttmpts_options[$lmtttmpts_single_message] = stripslashes($_POST['lmtttmpts_' . $lmtttmpts_single_message]); } } /* Restore default messages */ if (isset($_POST['lmtttmpts_return_default']) && in_array($_POST['lmtttmpts_return_default'], $lmtttmpts_messages)) { $lmtttmpts_messages_defaults = lmtttmpts_get_default_messages(); $lmtttmpts_options[$_POST['lmtttmpts_return_default']] = $lmtttmpts_messages_defaults[$_POST['lmtttmpts_return_default'] . '_default']; } /* save show/hide status of message-textarea blocks on setting page */ if (isset($_POST['lmtttmpts_options_for_block_message'])) { $lmtttmpts_options['options_for_block_message'] = $_POST['lmtttmpts_options_for_block_message']; } if (isset($_POST['lmtttmpts_options_for_email_message'])) { $lmtttmpts_options['options_for_email_message'] = $_POST['lmtttmpts_options_for_email_message']; } /*Verification and updating option with time of block if they are zero total*/ if ($lmtttmpts_options['days_of_lock'] == 0 && $lmtttmpts_options['hours_of_lock'] == 0 && $lmtttmpts_options['minutes_of_lock'] == 0) { $lmtttmpts_options['minutes_of_lock'] = 1; } /*Verification and updating option with time of reset failed attempts quantity if they are zero total*/ if ($lmtttmpts_options['days_to_reset'] == 0 && $lmtttmpts_options['hours_to_reset'] == 0 && $lmtttmpts_options['minutes_to_reset'] == 0) { $lmtttmpts_options['minutes_to_reset'] = 1; } /*Verification and updating option with time of reset blocks quantity if they are zero total*/ if ($lmtttmpts_options['days_to_reset_block'] == 0 && $lmtttmpts_options['hours_to_reset_block'] == 0 && $lmtttmpts_options['minutes_to_reset_block'] == 0) { $lmtttmpts_options['minutes_to_reset_block'] = 1; } /* Updating options in wp_options table if button "Save changes" is pressed */ if (isset($_POST['lmtttmpts_form_submit_button'])) { update_option('lmtttmpts_options', $lmtttmpts_options); } /* Finish updating and verification options from Settings form */ } /* GO PRO */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { $go_pro_result = bws_go_pro_tab_check($plugin_basename); if (!empty($go_pro_result['error'])) { $error = $go_pro_result['error']; } } /* allowed symbol to enter in black- and whitelist */ if (isset($_GET['action']) && in_array($_GET['action'], array('blacklist', 'whitelist'))) { $allowed_symbols = '<span class="lmtttmpts_little lmtttmpts_grey">' . __("Allowed formats:", 'lmtttmpts') . ' <code>192.168.0.1</code></span> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr> <td valign="top">' . __('Reason', 'lmtttmpts') . ' <input/><br /><span class="lmtttmpts_little lmtttmpts_grey">' . __("Allowed formats:", 'lmtttmpts') . ' <code>192.168.0.1</code>, <code>192.168.0.</code>, <code>192.168.</code>, <code>192.</code>, <code>192.168.0.1/8</code>, <code>192.168.0.1-192.168.2.255</code><br />' . __("Allowed separators:", 'lmtttmpts') . ' ' . __('a comma', 'lmtttmpts') . ' (<code>,</code>), ' . __('semicolon', 'lmtttmpts') . ' (<code>;</code>), ' . __('ordinary space, tab, new line or carriage return', 'lmtttmpts') . '</span></td> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info">' . __('Unlock premium options by upgrading to a PRO version.', 'lmtttmpts') . ' <a href="http://bestwebsoft.com/products/limit-attempts/?k=33bc89079511cdfe28aeba317abfaf37&pn=140&v=' . $lmtttmpts_plugin_info["Version"] . '&wp_v=' . $wp_version . '" target="_blank" title="Limit Attempts Pro">' . __("Learn More", 'lmtttmpts') . '</a> </div> <a class="bws_button" href="http://bestwebsoft.com/products/limit-attempts/buy/?k=33bc89079511cdfe28aeba317abfaf37&pn=140&v=' . $lmtttmpts_plugin_info["Version"] . '&wp_v=' . $wp_version . '" target="_blank" title="Limit Attempts Pro">' . __('Go', 'lmtttmpts') . ' <strong>PRO</strong> </a> <div class="clear"></div> </div> </div>'; } if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $lmtttmpts_options = $lmtttmpts_option_defaults; update_option('lmtttmpts_options', $lmtttmpts_options); $action_message['done'] .= __('All plugin settings were restored.', 'lmtttmpts'); } ?> <div class="wrap"> <h2><?php _e('Limit Attempts Settings', 'lmtttmpts'); ?> </h2> <div id="lmtttmpts_settings_notice" class="updated fade" style="display:none"> <p><strong><?php _e("Notice:", 'lmtttmpts'); ?> </strong> <?php _e("The plugin's settings have been changed. In order to save them please don't forget to click the 'Save Changes' button.", 'lmtttmpts'); ?> </p> </div> <?php /* action message when working with blocked/black/white lists or statistics */ if (isset($_GET['action']) && 'log' != $_GET['action']) { $action_message = lmtttmpts_list_actions(); } if (!empty($error)) { $action_message['error'] = $error; } ?> <div class="error" <?php if (empty($action_message['error'])) { echo 'style="display:none"'; } ?> ><p><strong><?php if (!empty($action_message['error'])) { echo $action_message['error']; } ?> </strong></div> <div class="updated" <?php if (empty($action_message['done'])) { echo 'style="display: none;"'; } ?> ><p><?php if (!empty($action_message['done'])) { echo $action_message['done']; } ?> </p></div> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=limit-attempts.php"><?php _e('Settings', 'lmtttmpts'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'blocked' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=limit-attempts.php&action=blocked"><?php _e('Blocked IP', 'lmtttmpts'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'blacklist' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=limit-attempts.php&action=blacklist"><?php _e('Blacklist', 'lmtttmpts'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'whitelist' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=limit-attempts.php&action=whitelist"><?php _e('Whitelist', 'lmtttmpts'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'log' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=limit-attempts.php&action=log"><?php _e('Log', 'lmtttmpts'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'statistics' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=limit-attempts.php&action=statistics"><?php _e('Statistics', 'lmtttmpts'); ?> </a> <a class="nav-tab" href="http://bestwebsoft.com/products/limit-attempts/faq/" target="_blank"><?php _e('FAQ', 'lmtttmpts'); ?> </a> <a class="nav-tab bws_go_pro_tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=limit-attempts.php&action=go_pro"><?php _e('Go PRO', 'lmtttmpts'); ?> </a> </h2> <?php if (!isset($_GET['action'])) { /* Showing settings tab */ if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } else { /* display hidden error/email messages blocks - for disabled JS primarily */ $hide_login_message_block = isset($_GET['login_error_tab']) || isset($_POST['lmtttmpts_options_for_block_message']) && 'show' == $_POST['lmtttmpts_options_for_block_message'] ? false : true; $hide_email_message_block = isset($_GET['email_error_tab']) || isset($_POST['lmtttmpts_options_for_email_message']) && 'show' == $_POST['lmtttmpts_options_for_email_message'] ? false : true; ?> <div id="lmtttmpts_settings"> <form method="post" action="admin.php?page=limit-attempts.php"> <table id="lmtttmpts_lock_options" class="form-table lmtttmpts_options_table"> <tr> <th><?php _e('Block address', 'lmtttmpts'); ?> </th> <td class="lmtttmpts-lock-options"> <p> <?php _e('for', 'lmtttmpts'); ?> <span id="lmtttmpts-time-of-lock-display" class="lmtttmpts_hidden lmtttmpts-display"> <span <?php if (0 == $lmtttmpts_options['days_of_lock']) { echo 'class="lmtttmpts-zero-value"'; } ?> ><span class="lmtttmpts-unit-measure" ><?php echo $lmtttmpts_options['days_of_lock']; ?> </span> <?php echo _n('day', 'days', $lmtttmpts_options['days_of_lock'], 'lmtttmpts'); ?> </span> <span <?php if (0 == $lmtttmpts_options['hours_of_lock']) { echo 'class="lmtttmpts-zero-value"'; } ?> ><span class="lmtttmpts-unit-measure" ><?php echo $lmtttmpts_options['hours_of_lock']; ?> </span> <?php echo _n('hour', 'hours', $lmtttmpts_options['hours_of_lock'], 'lmtttmpts'); ?> </span> <span <?php if (0 == $lmtttmpts_options['minutes_of_lock']) { echo 'class="lmtttmpts-zero-value"'; } ?> ><span class="lmtttmpts-unit-measure" ><?php echo $lmtttmpts_options['minutes_of_lock']; ?> </span> <?php echo _n('minute', 'minutes', $lmtttmpts_options['minutes_of_lock'], 'lmtttmpts'); ?> </span> <span id="lmtttmpts-time-of-lock-edit" class="lmtttmpts-edit"><?php _e('Edit', 'lmtttmpts'); ?> </span> </span> <span id="lmtttmpts-time-of-lock" class="lmtttmpts-hidden-input"> <input id="lmtttmpts-days-of-lock-display" type="number" max="999" min="0" step="1" maxlength="3" value="<?php echo $lmtttmpts_options['days_of_lock']; ?> " name="lmtttmpts_days_of_lock" /> <?php _e('days', 'lmtttmpts'); ?> <input id="lmtttmpts-hours-of-lock-display" type="number" max="23" min="0" step="1" maxlength="2" value="<?php echo $lmtttmpts_options['hours_of_lock']; ?> " name="lmtttmpts_hours_of_lock" /> <?php _e('hours', 'lmtttmpts'); ?> <input id="lmtttmpts-minutes-of-lock-display" type="number" max="59" min="0" step="1" maxlength="2" value="<?php echo $lmtttmpts_options['minutes_of_lock']; ?> " name="lmtttmpts_minutes_of_lock" /> <?php _e('minutes', 'lmtttmpts'); ?> </span> </p> <p> <?php _e('after', 'lmtttmpts'); ?> <span id="lmtttmpts-allowed-retries-display" class="lmtttmpts_hidden lmtttmpts-display"> <span class="lmtttmpts-unit-measure" ><?php echo $lmtttmpts_options['allowed_retries']; ?> </span> <?php echo _n('failed attempt', 'failed attempts', $lmtttmpts_options['allowed_retries'], 'lmtttmpts'); ?> <span id="lmtttmpts-allowed-retries-edit" class="lmtttmpts-edit"><?php _e('Edit', 'lmtttmpts'); ?> </span> </span> <span id="lmtttmpts-allowed-retries" class="lmtttmpts-hidden-input"> <input id="lmtttmpts-allowed-retries-number-display" type="number" min="1" step="1" maxlength="2" value="<?php echo $lmtttmpts_options['allowed_retries']; ?> " name="lmtttmpts_allowed_retries" /> <?php _e('failed attempts', 'lmtttmpts'); ?> </span> </p> <p> <?php _e('per', 'lmtttmpts'); ?> <span id="lmtttmpts-time-to-reset-display" class="lmtttmpts_hidden lmtttmpts-display"> <span <?php if (0 == $lmtttmpts_options['days_to_reset']) { echo 'class="lmtttmpts-zero-value"'; } ?> > <span class="lmtttmpts-unit-measure" ><?php echo $lmtttmpts_options['days_to_reset']; ?> </span> <?php echo _n('day', 'days', $lmtttmpts_options['days_to_reset'], 'lmtttmpts'); ?> </span> <span <?php if (0 == $lmtttmpts_options['hours_to_reset']) { echo 'class="lmtttmpts-zero-value"'; } ?> > <span class="lmtttmpts-unit-measure" ><?php echo $lmtttmpts_options['hours_to_reset']; ?> </span> <?php echo _n('hour', 'hours', $lmtttmpts_options['hours_to_reset'], 'lmtttmpts'); ?> </span> <span <?php if (0 == $lmtttmpts_options['minutes_to_reset']) { echo 'class="lmtttmpts-zero-value"'; } ?> > <span class="lmtttmpts-unit-measure" ><?php echo $lmtttmpts_options['minutes_to_reset']; ?> </span> <?php echo _n('minute', 'minutes', $lmtttmpts_options['minutes_to_reset'], 'lmtttmpts'); ?> </span> <span id="lmtttmpts-time-to-reset-edit" class="lmtttmpts-edit"><?php _e('Edit', 'lmtttmpts'); ?> </span> </span> <span id="lmtttmpts-time-to-reset" class="lmtttmpts-hidden-input"> <input id="lmtttmpts-days-to-reset-display" type="number" max="999" min="0" step="1" maxlength="3" value="<?php echo $lmtttmpts_options['days_to_reset']; ?> " name="lmtttmpts_days_to_reset" /> <?php _e('days', 'lmtttmpts'); ?> <input id="lmtttmpts-hours-to-reset-display" type="number" max="23" min="0" step="1" maxlength="2" value="<?php echo $lmtttmpts_options['hours_to_reset']; ?> " name="lmtttmpts_hours_to_reset" /> <?php _e('hours', 'lmtttmpts'); ?> <input id="lmtttmpts-minutes-to-reset-display" type="number" max="59" min="0" step="1" maxlength="2" value="<?php echo $lmtttmpts_options['minutes_to_reset']; ?> " name="lmtttmpts_minutes_to_reset" /> <?php _e('minutes', 'lmtttmpts'); ?> </span> </p> </td> </tr> <tr> <th><?php _e('Add to the blacklist', 'lmtttmpts'); ?> </th> <td> <p> <?php _e('after', 'lmtttmpts'); ?> <span id="lmtttmpts-allowed-locks-display" class="lmtttmpts_hidden lmtttmpts-display"> <span class="lmtttmpts-unit-measure" ><?php echo $lmtttmpts_options['allowed_locks']; ?> </span> <?php echo _n('block', 'blocks', $lmtttmpts_options['allowed_locks'], 'lmtttmpts'); ?> <span id="lmtttmpts-allowed-locks-edit" class="lmtttmpts-edit"><?php _e('Edit', 'lmtttmpts'); ?> </span> </span> <span id="lmtttmpts-allowed-locks" class="lmtttmpts-hidden-input"> <input id="lmtttmpts-allowed-locks-number-display" type="number" min="1" step="1" maxlength="2" value="<?php echo $lmtttmpts_options['allowed_locks']; ?> " name="lmtttmpts_allowed_locks" /> <?php _e('blocks', 'lmtttmpts'); ?> </span> </p> <p> <?php _e('per', 'lmtttmpts'); ?> <span id="lmtttmpts-time-to-reset-block-display" class="lmtttmpts_hidden lmtttmpts-display"> <span <?php if (0 == $lmtttmpts_options['days_to_reset_block']) { echo 'class="lmtttmpts-zero-value"'; } ?> ><span class="lmtttmpts-unit-measure" ><?php echo $lmtttmpts_options['days_to_reset_block']; ?> </span> <?php echo _n('day', 'days', $lmtttmpts_options['days_to_reset_block'], 'lmtttmpts'); ?> </span> <span <?php if (0 == $lmtttmpts_options['hours_to_reset_block']) { echo 'class="lmtttmpts-zero-value"'; } ?> ><span class="lmtttmpts-unit-measure" ><?php echo $lmtttmpts_options['hours_to_reset_block']; ?> </span> <?php echo _n('hour', 'hours', $lmtttmpts_options['hours_to_reset_block'], 'lmtttmpts'); ?> </span> <span <?php if (0 == $lmtttmpts_options['minutes_to_reset_block']) { echo 'class="lmtttmpts-zero-value"'; } ?> ><span class="lmtttmpts-unit-measure" ><?php echo $lmtttmpts_options['minutes_to_reset_block']; ?> </span> <?php echo _n('minute', 'minutes', $lmtttmpts_options['minutes_to_reset_block'], 'lmtttmpts'); ?> </span> <span id="lmtttmpts-time-to-reset-block-edit" class="lmtttmpts-edit"><?php _e('Edit', 'lmtttmpts'); ?> </span> </span> <span id="lmtttmpts-time-to-reset-block" class="lmtttmpts-hidden-input"> <input id="lmtttmpts-days-to-reset-block-display" type="number" max="999" min="0" step="1" maxlength="3" value="<?php echo $lmtttmpts_options['days_to_reset_block']; ?> " name="lmtttmpts_days_to_reset_block" /> <?php _e('days', 'lmtttmpts'); ?> <input id="lmtttmpts-hours-to-reset-block-display" type="number" max="23" min="0" step="1" maxlength="2" value="<?php echo $lmtttmpts_options['hours_to_reset_block']; ?> " name="lmtttmpts_hours_to_reset_block" /> <?php _e('hours', 'lmtttmpts'); ?> <input id="lmtttmpts-minutes-to-reset-block-display" type="number" max="59" min="0" step="1" maxlength="2" value="<?php echo $lmtttmpts_options['minutes_to_reset_block']; ?> " name="lmtttmpts_minutes_to_reset_block" /> <?php _e('minutes', 'lmtttmpts'); ?> </span> </p> </td> </tr> </table> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version lmtttmpts_options_table_demo"> <tr> <th><?php _e('If user tried to log in with a non-existent username', 'lmtttmpts'); ?> </th> <td> <input type="radio" disabled="disabled" /><label><?php _e('according to "Block address" and "Add to the blacklist" options', 'lmtttmpts'); ?> </label><br> <input type="radio" disabled="disabled" /><label><?php _e('block address immediately', 'lmtttmpts'); ?> </label><br> <input type="radio" disabled="disabled" /><label><?php _e('add to the blacklist immediately', 'lmtttmpts'); ?> </label><br> </td> </tr> <tr> <th><?php _e('Remove log entries that are over', 'lmtttmpts'); ?> </th> <td style="min-width: 210px;"> <input disabled="disabled" type="number" min="0" step="1" maxlength="3" value="30"/> <?php _e('days', 'lmtttmpts'); ?> <br/> <span class="lmtttmpts_little lmtttmpts_grey"><?php _e('Set "0" if you do not want to clear the log.', 'lmtttmpts'); ?> <br /> <?php echo __('Current size of DB table', 'lmtttmpts') . '≈ <strong>' . '1.234' . '</strong> ' . __('Mb', 'lmtttmpts'); ?> </span> </td> </tr> <tr valign="top"> <th scope="row" colspan="3"> * <?php _e('If you upgrade to Pro version all your settings will be saved.', 'lmtttmpts'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to a PRO version.', 'lmtttmpts'); ?> <a href="http://bestwebsoft.com/products/limit-attempts/?k=33bc89079511cdfe28aeba317abfaf37&pn=140&v=<?php echo $lmtttmpts_plugin_info["Version"] . '&wp_v=' . $wp_version; ?> " target="_blank" title="Limit Attempts Pro"><?php _e("Learn More", 'lmtttmpts'); ?> </a> </div> <a class="bws_button" href="http://bestwebsoft.com/products/limit-attempts/buy/?k=33bc89079511cdfe28aeba317abfaf37&pn=140&v=<?php echo $lmtttmpts_plugin_info["Version"] . '&wp_v=' . $wp_version; ?> " target="_blank" title="Limit Attempts Pro"> <?php _e('Go', 'lmtttmpts'); ?> <strong>PRO</strong> </a> <div class="clear"></div> </div> </div> <table class="form-table lmtttmpts_options_table"> <tr> <th><?php _e('Remove statistics entry in case no failed attempts occurred for', 'lmtttmpts'); ?> </th> <td> <input type="number" min="0" step="1" maxlength="3" value="<?php echo $lmtttmpts_options['days_to_clear_statistics']; ?> " name="lmtttmpts_days_to_clear_statistics" /> <?php _e('days', 'lmtttmpts'); ?> <br/> <span class="lmtttmpts_little lmtttmpts_grey"><?php _e('Set "0" if you do not want to clear the statistics.', 'lmtttmpts'); ?> </span> </td> </tr> <th><?php _e('Error messages', 'lmtttmpts'); ?> </th> <td> <button id="lmtttmpts_hide_options_for_block_message_button" class="button-secondary" <?php if ($hide_login_message_block) { echo 'style="display: none;"'; } ?> name="lmtttmpts_options_for_block_message" value="hide"><?php _e('Hide', 'lmtttmpts'); ?> </button> <button id="lmtttmpts_show_options_for_block_message_button" class="button-secondary" <?php if (!$hide_login_message_block) { echo 'style="display: none;"'; } ?> name="lmtttmpts_options_for_block_message" value="show"><?php _e('Show', 'lmtttmpts'); ?> </button> </td> </table> <h3 id="lmtttmpts_nav_tab_message_no_js" class="nav-tab-wrapper lmtttmpts_block_message_block <?php if ($hide_login_message_block) { echo "lmtttmpts_hidden"; } ?> "> <a class="nav-tab<?php if (!isset($_GET['login_error_tab']) || 'failed' == $_GET['login_error_tab']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=limit-attempts.php&login_error_tab=failed"><?php _e('For invalid attempt', 'lmtttmpts'); ?> </a> <a class="nav-tab<?php if (isset($_GET['login_error_tab']) && 'blocked' == $_GET['login_error_tab']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=limit-attempts.php&login_error_tab=blocked"><?php _e('For blocked user', 'lmtttmpts'); ?> </a> <a class="nav-tab<?php if (isset($_GET['login_error_tab']) && 'blacklisted' == $_GET['login_error_tab']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=limit-attempts.php&login_error_tab=blacklisted"><?php _e('For blacklisted user', 'lmtttmpts'); ?> </a> </h3> <h3 id="lmtttmpts_nav_tab_message_js" style="display:none" class="nav-tab-wrapper lmtttmpts_block_message_block <?php if (isset($lmtttmpts_options['options_for_block_message']) && 'hide' == $lmtttmpts_options['options_for_block_message']) { echo "lmtttmpts_hidden"; } ?> "> <p id="lmtttmpts_message_invalid_attempt" style="cursor:pointer" class="nav-tab<?php if (!isset($_GET['login_error_tab'])) { echo ' nav-tab-active'; } ?> " ><?php _e('For invalid attempt', 'lmtttmpts'); ?> </p> <p id="lmtttmpts_message_blocked" style="cursor:pointer" class="nav-tab<?php if (isset($_GET['login_error_tab']) && 'blocked' == $_GET['login_error_tab']) { echo ' nav-tab-active'; } ?> " ><?php _e('For blocked user', 'lmtttmpts'); ?> </p> <p id="lmtttmpts_message_blacklisted" style="cursor:pointer" class="nav-tab<?php if (isset($_GET['login_error_tab']) && 'blacklisted' == $_GET['login_error_tab']) { echo ' nav-tab-active'; } ?> " ><?php _e('For blacklisted user', 'lmtttmpts'); ?> </p> </h3> <table class="form-table lmtttmpts_block_message_block <?php if ($hide_login_message_block) { echo "lmtttmpts_hidden"; } ?> "> <tr id="lmtttmpts_message_invalid_attempt_area" <?php if (isset($_GET['login_error_tab']) && 'failed' != $_GET['login_error_tab']) { echo 'class="lmtttmpts_hidden"'; } ?> > <td> <p><?php _e('Allowed Variables:', 'lmtttmpts'); ?> </p> <ul> <li>'%ATTEMPTS%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display quantity of allowed attempts', 'lmtttmpts'); ?> )</span></li> </ul> <button class="button-secondary" name="lmtttmpts_return_default" value="failed_message"><?php _e('Restore default message', 'lmtttmpts'); ?> </button> </td> <td> <textarea rows="5" cols="100" name="lmtttmpts_failed_message"><?php echo $lmtttmpts_options['failed_message']; ?> </textarea><br /> <span class="lmtttmpts_little lmtttmpts_grey"><?php _e('You can use standart HTML tags and attributes.', 'lmtttmpts'); ?> </span> </td> </tr> <tr id="lmtttmpts_message_blocked_area" <?php if (!isset($_GET['login_error_tab']) || isset($_GET['login_error_tab']) && 'blocked' != $_GET['login_error_tab']) { echo 'class="lmtttmpts_hidden"'; } ?> > <td> <p><?php _e('Allowed Variables:', 'lmtttmpts'); ?> </p> <ul> <li>'%DATE%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display date when block is removed', 'lmtttmpts'); ?> )</span></li> <li>'%MAIL%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display administrator’s e-mail for feedback', 'lmtttmpts'); ?> )</span></li> </ul> <button class="button-secondary" name="lmtttmpts_return_default" value="blocked_message"><?php _e('Restore default message', 'lmtttmpts'); ?> </button> </td> <td> <textarea rows="5" cols="100" name="lmtttmpts_blocked_message"><?php echo $lmtttmpts_options['blocked_message']; ?> </textarea><br /> <span class="lmtttmpts_little lmtttmpts_grey"><?php _e('You can use standart HTML tags and attributes.', 'lmtttmpts'); ?> </span> </td> </tr> <tr id="lmtttmpts_message_blacklisted_area" <?php if (!isset($_GET['login_error_tab']) || isset($_GET['login_error_tab']) && 'blacklisted' != $_GET['login_error_tab']) { echo 'class="lmtttmpts_hidden"'; } ?> > <td> <p><?php _e('Allowed Variables:', 'lmtttmpts'); ?> </p> <ul> <li>'%MAIL%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display administrators e-mail for feedback', 'lmtttmpts'); ?> )</span></li> </ul> <button class="button-secondary" name="lmtttmpts_return_default" value="blacklisted_message"><?php _e('Restore default message', 'lmtttmpts'); ?> </button> </td> <td> <textarea rows="5" cols="100" name="lmtttmpts_blacklisted_message"><?php echo $lmtttmpts_options['blacklisted_message']; ?> </textarea><br /> <span class="lmtttmpts_little lmtttmpts_grey"><?php _e('You can use standart HTML tags and attributes.', 'lmtttmpts'); ?> </span> </td> </tr> </table> <table id="lmtttmpts_notify_options" class="form-table"> <tr> <th><?php _e('Send email with notification', 'lmtttmpts'); ?> </th> <td style="width:15px" class="lmtttmpts_align_top"> <input id="lmtttmpts_notify_email_options" type="checkbox" name="lmtttmpts_notify_email" value="1" <?php if ($lmtttmpts_options['notify_email']) { echo 'checked="checked" '; } ?> /><br /> </td> <td class="lmtttmpts_align_top lmtttmpts_notify_email_block <?php if (isset($lmtttmpts_options['notify_email']) && false === $lmtttmpts_options['notify_email']) { echo "lmtttmpts_hidden"; } ?> " style="max-width:150px;"> <input type="radio" id="lmtttmpts_user_mailto" name="lmtttmpts_mailto" value="admin" <?php if (isset($lmtttmpts_options['mailto']) && $lmtttmpts_options['mailto'] == 'admin') { echo 'checked="checked" '; } ?> /><label for="lmtttmpts_user_mailto"><?php _e("Email to user's address", 'lmtttmpts'); ?> </label> <select name="lmtttmpts_user_email_address" onfocus="document.getElementById('lmtttmpts_user_mailto').checked = true;"> <option disabled><?php _e("Choose a username", 'lmtttmpts'); ?> </option> <?php foreach ($userslogin as $key => $value) { if ($value->data->user_email != '') { ?> <option value="<?php echo $value->data->user_email; ?> " <?php if ($value->data->user_email == $lmtttmpts_options['email_address']) { echo 'selected="selected" '; } ?> ><?php echo $value->data->user_login; ?> </option> <?php } } ?> </select></br> <input type="radio" id="lmtttmpts_custom_mailto" name="lmtttmpts_mailto" value="custom" <?php if (isset($lmtttmpts_options['mailto']) && $lmtttmpts_options['mailto'] == 'custom') { echo 'checked="checked" '; } ?> /><label for="lmtttmpts_custom_mailto"><?php _e('Email to another address', 'lmtttmpts'); ?> </label> <input type="email" maxlength="100" name="lmtttmpts_email_address" value="<?php if ($lmtttmpts_options['mailto'] == 'custom') { echo $lmtttmpts_options['email_address']; } ?> " onfocus="document.getElementById('lmtttmpts_custom_mailto').checked = true;"/> </td> </tr> <tr> <th><?php _e('Additional options for email with notification', 'lmtttmpts'); ?> </th> <td> <button id="lmtttmpts_hide_options_for_email_message_button" class="button-secondary" <?php if ($hide_email_message_block) { echo 'style="display: none;"'; } ?> name="lmtttmpts_options_for_email_message" value="hide"><?php _e('Hide', 'lmtttmpts'); ?> </button> <button id="lmtttmpts_show_options_for_email_message_button" class="button-secondary" <?php if (!$hide_email_message_block) { echo 'style="display: none;"'; } ?> name="lmtttmpts_options_for_email_message" value="show"><?php _e('Show', 'lmtttmpts'); ?> </button> </td> <td></td> </tr> </table> <h3 id="lmtttmpts_nav_tab_email_no_js_a" class="nav-tab-wrapper lmtttmpts_email_message_block <?php if ($hide_email_message_block) { echo "lmtttmpts_hidden"; } ?> "> <a class="nav-tab<?php if (!isset($_GET['email_error_tab']) || 'blocked' == $_GET['email_error_tab']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=limit-attempts.php&email_error_tab=blocked"><?php _e('Email to admistrator when user is blocked', 'lmtttmpts'); ?> </a> <a class="nav-tab<?php if (isset($_GET['email_error_tab']) && 'blacklisted' == $_GET['email_error_tab']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=limit-attempts.php&email_error_tab=blacklisted"><?php _e('Email to admistrator when user is blacklisted', 'lmtttmpts'); ?> </a> </h3> <h3 id="lmtttmpts_nav_tab_email_js_a" style="display:none" class="nav-tab-wrapper lmtttmpts_email_message_block <?php if (isset($lmtttmpts_options['options_for_email_message']) && 'hide' == $lmtttmpts_options['options_for_email_message']) { echo "lmtttmpts_hidden"; } ?> "> <p id="lmtttmpts_email_blocked" class="nav-tab<?php if (!isset($_GET['email_error_tab'])) { echo ' nav-tab-active'; } ?> " ><?php _e('Email to admistrator when user is blocked', 'lmtttmpts'); ?> </p> <p id="lmtttmpts_email_blacklisted" class="nav-tab<?php if (isset($_GET['email_error_tab']) && 'blacklisted' == $_GET['email_error_tab']) { echo ' nav-tab-active'; } ?> " ><?php _e('Email to admistrator when user is blacklisted', 'lmtttmpts'); ?> </p> </h3> <table class="form-table lmtttmpts_email_message_block <?php if ($hide_email_message_block) { echo "lmtttmpts_hidden"; } ?> "> <tr> <th><?php _e('Subject', 'lmtttmpts'); ?> </th> </tr> <tr id="lmtttmpts_email_subject_area" <?php if (isset($_GET['email_error_tab']) && 'blocked' != $_GET['email_error_tab']) { echo 'class="lmtttmpts_hidden"'; } ?> > <td> <p><?php _e('Allowed Variables:', 'lmtttmpts'); ?> </p> <ul> <li>'%IP%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display blocked IP address', 'lmtttmpts'); ?> )</span></li> <li>'%SITE_NAME%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display name of your site', 'lmtttmpts'); ?> )</span></li> </ul> <button class="button-secondary" name="lmtttmpts_return_default" value="email_subject"><?php _e('Restore default subject', 'lmtttmpts'); ?> </button> </td> <td> <textarea rows="1" cols="100" name="lmtttmpts_email_subject"><?php echo $lmtttmpts_options['email_subject']; ?> </textarea><br /> <span class="lmtttmpts_little lmtttmpts_grey"><?php _e('You can use standart HTML tags and attributes.', 'lmtttmpts'); ?> </span> </td> </tr> <tr id="lmtttmpts_email_subject_blacklisted_area" <?php if (!isset($_GET['email_error_tab']) || isset($_GET['email_error_tab']) && 'blacklisted' != $_GET['email_error_tab']) { echo 'class="lmtttmpts_hidden"'; } ?> > <td> <p><?php _e('Allowed Variables:', 'lmtttmpts'); ?> </p> <ul> <li>'%IP%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display blacklisted IP address', 'lmtttmpts'); ?> )</span></li> <li>'%SITE_NAME%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display name of your site', 'lmtttmpts'); ?> )</span></li> </ul> <button class="button-secondary" name="lmtttmpts_return_default" value="email_subject_blacklisted"><?php _e('Restore default subject', 'lmtttmpts'); ?> </button> </td> <td> <textarea rows="1" cols="100" name="lmtttmpts_email_subject_blacklisted"><?php echo $lmtttmpts_options['email_subject_blacklisted']; ?> </textarea><br /> <span class="lmtttmpts_little lmtttmpts_grey"><?php _e('You can use standart HTML tags and attributes.', 'lmtttmpts'); ?> </span> </td> </tr> <tr> <th><?php _e('Message', 'lmtttmpts'); ?> </th> </tr> <tr id="lmtttmpts_email_blocked_area" <?php if (isset($_GET['email_error_tab']) && 'blocked' != $_GET['email_error_tab']) { echo 'class="lmtttmpts_hidden"'; } ?> > <td> <p><?php _e('Allowed Variables:', 'lmtttmpts'); ?> </p> <ul> <li>'%IP%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display IP address that is blocked', 'lmtttmpts'); ?> )</span></li> <li>'%PLUGIN_LINK%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display link for Limit Attempts plugin on your site', 'lmtttmpts'); ?> )</span></li> <li>'%WHEN%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display date and time when IP address was blocked', 'lmtttmpts'); ?> )</span></li> <li>'%SITE_NAME%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display name of your site', 'lmtttmpts'); ?> )</span></li> <li>'%SITE_URL%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e("display your site's URL", 'lmtttmpts'); ?> )</span></li> </ul> <button class="button-secondary" name="lmtttmpts_return_default" value="email_blocked"><?php _e('Restore default message', 'lmtttmpts'); ?> </button> </td> <td> <textarea rows="5" cols="100" name="lmtttmpts_email_blocked"><?php echo $lmtttmpts_options['email_blocked']; ?> </textarea><br /> <span class="lmtttmpts_little lmtttmpts_grey"><?php _e('You can use standart HTML tags and attributes.', 'lmtttmpts'); ?> </span> </td> </tr> <tr id="lmtttmpts_email_blacklisted_area" <?php if (!isset($_GET['email_error_tab']) || isset($_GET['email_error_tab']) && 'blacklisted' != $_GET['email_error_tab']) { echo 'class="lmtttmpts_hidden"'; } ?> > <td> <p><?php _e('Allowed Variables:', 'lmtttmpts'); ?> </p> <ul> <li>'%IP%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display IP address that is added to the blacklist', 'lmtttmpts'); ?> )</span></li> <li>'%PLUGIN_LINK%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display link for Limit Attempts plugin on your site', 'lmtttmpts'); ?> )</span></li> <li>'%WHEN%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display date and time when IP address was blacklisted', 'lmtttmpts'); ?> )</span></li> <li>'%SITE_NAME%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e('display name of your site', 'lmtttmpts'); ?> )</span></li> <li>'%SITE_URL%' <span class="lmtttmpts_little lmtttmpts_grey">(<?php _e("display your site's URL", 'lmtttmpts'); ?> )</span></li> </ul> <button class="button-secondary" name="lmtttmpts_return_default" value="email_blacklisted"><?php _e('Restore default message', 'lmtttmpts'); ?> </button> </td> <td> <textarea rows="5" cols="100" name="lmtttmpts_email_blacklisted"><?php echo $lmtttmpts_options['email_blacklisted']; ?> </textarea><br /> <span class="lmtttmpts_little lmtttmpts_grey"><?php _e('You can use standart HTML tags and attributes.', 'lmtttmpts'); ?> </span> </td> </tr> </table> <table id="lmtttmpts_interaction_settings" class="form-table"> <tr> <th><?php _e("Htaccess plugin", 'lmtttmpts'); ?> </th> <td> <?php if (array_key_exists('htaccess/htaccess.php', $all_plugins) || array_key_exists('htaccess-pro/htaccess-pro.php', $all_plugins)) { $htaccess_free_active = 0 < count(preg_grep('/htaccess\\/htaccess.php/', $active_plugins)) ? true : false; $htaccess_pro_active = 0 < count(preg_grep('/htaccess-pro\\/htaccess-pro.php/', $active_plugins)) ? true : false; if ($htaccess_free_active || $htaccess_pro_active) { if ($htaccess_pro_active && !$htaccess_free_active) { ?> <input type="checkbox" name="lmtttmpts_block_by_htaccess" value="1" <?php if (isset($lmtttmpts_options["block_by_htaccess"])) { echo 'checked="checked"'; } ?> /> <span class="bws_info"> (<?php _e('Using', 'lmtttmpts'); ?> <a href="admin.php?page=htaccess-pro.php">Htaccess Pro</a> <?php _e('powered by', 'lmtttmpts'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>)</span> <?php } elseif ($htaccess_free_active && isset($all_plugins['htaccess/htaccess.php']['Version']) && $all_plugins['htaccess/htaccess.php']['Version'] >= '1.6.2') { ?> <input type="checkbox" name="lmtttmpts_block_by_htaccess" value="1" <?php if (isset($lmtttmpts_options["block_by_htaccess"])) { echo 'checked="checked"'; } ?> /> <span class="bws_info"> (<?php _e('Using', 'lmtttmpts'); ?> <a href="admin.php?page=htaccess.php">Htaccess</a> <?php _e('powered by', 'lmtttmpts'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>)</span> <?php } else { ?> <input disabled="disabled" type="checkbox" name="lmtttmpts_block_by_htaccess" value="1" <?php if (isset($lmtttmpts_options["block_by_htaccess"])) { echo 'checked="checked"'; } ?> /> <span class="bws_info">(<?php _e('Using Htaccess powered by', 'lmtttmpts'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php _e('Update Htaccess at least to v.1.6.2', 'lmtttmpts'); ?> </a></span> <?php } } else { ?> <input disabled="disabled" type="checkbox" name="lmtttmpts_block_by_htaccess" value="1" <?php if (isset($lmtttmpts_options["block_by_htaccess"])) { echo 'checked="checked"'; } ?> /> <span class="bws_info">(<?php _e('Using Htaccess powered by', 'lmtttmpts'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php _e('Activate Htaccess', 'lmtttmpts'); ?> </a></span> <?php } } else { ?> <input disabled="disabled" type="checkbox" name="lmtttmpts_block_by_htaccess" value="1" /> <span class="bws_info">(<?php _e('Using Htaccess powered by', 'lmtttmpts'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="http://bestwebsoft.com/products/htaccess/"><?php _e('Download Htaccess', 'lmtttmpts'); ?> </a></span> <?php } ?> <br /><span class="lmtttmpts_little lmtttmpts_grey"><?php _e('Allow Htaccess plugin block IP to reduce the database workload.', 'lmtttmpts'); ?> </span> </td> </tr> <tr> <th><?php _e('Captcha plugin', 'lmtttmpts'); ?> </th> <td> <?php if (array_key_exists('captcha/captcha.php', $all_plugins) || array_key_exists('captcha-plus/captcha-plus.php', $all_plugins) || array_key_exists('captcha-pro/captcha_pro.php', $all_plugins)) { /* if captcha is installed */ if (0 < count(preg_grep('/captcha\\/captcha.php/', $active_plugins)) || 0 < count(preg_grep('/captcha-pro\\/captcha_pro.php/', $active_plugins)) || 0 < count(preg_grep('/captcha-plus\\/captcha-plus.php/', $active_plugins))) { /* if captcha plugin is active */ if (0 < count(preg_grep('/captcha-pro\\/captcha_pro.php/', $active_plugins))) { /* if Captcha PRO is active */ if (isset($all_plugins['captcha-pro/captcha_pro.php']['Version']) && $all_plugins['captcha-pro/captcha_pro.php']['Version'] >= '1.4.4') { ?> <!-- Checkbox for Login form captcha checking --> <label> <input type="checkbox" name="lmtttmpts_login_form_captcha_check" value="1" <?php if (isset($lmtttmpts_options['login_form_captcha_check'])) { echo 'checked="checked"'; } ?> /> <span><?php _e('Login form', 'lmtttmpts'); ?> </span> </label> <span class="bws_info"> (<?php _e('Using', 'lmtttmpts'); ?> <a href="admin.php?page=captcha_pro.php">Captcha Pro</a> <?php _e('powered by', 'lmtttmpts'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>)</span> <?php } else { ?> <input disabled="disabled" type="checkbox" name="lmtttmpts_login_form_captcha_check" value="1" <?php if (isset($lmtttmpts_options["login_form_captcha_check"])) { echo 'checked="checked"'; } ?> /> <span class="bws_info">(<?php _e('Using Captcha Pro powered by', 'lmtttmpts'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php _e('Update Captcha Pro at least to v.1.4.4', 'lmtttmpts'); ?> </a></span> <?php } } elseif (0 < count(preg_grep('/captcha-plus\\/captcha-plus.php/', $active_plugins))) { /* if Captcha Plus is active */ ?> <label> <input type="checkbox" name="lmtttmpts_login_form_captcha_check" value="1" <?php if (isset($lmtttmpts_options['login_form_captcha_check'])) { echo 'checked="checked"'; } ?> /> <span><?php _e('Login form', 'lmtttmpts'); ?> </span> </label> <span class="bws_info"> (<?php _e('Using', 'lmtttmpts'); ?> <a href="admin.php?page=captcha-plus.php">Captcha Plus</a> <?php _e('powered by', 'lmtttmpts'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>)</span> <?php } else { /* Captcha free is active */ if (isset($all_plugins['captcha/captcha.php']['Version']) && $all_plugins['captcha/captcha.php']['Version'] >= '4.0.2') { ?> <label> <input type="checkbox" name="lmtttmpts_login_form_captcha_check" value="1" <?php if (isset($lmtttmpts_options['login_form_captcha_check'])) { echo 'checked="checked"'; } ?> /> <span><?php _e('Login form', 'lmtttmpts'); ?> </span> </label> <span class="bws_info"> (<?php _e('Using', 'lmtttmpts'); ?> <a href="admin.php?page=captcha.php">Captcha</a> <?php _e('powered by', 'lmtttmpts'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>)</span> <?php } else { ?> <input disabled="disabled" type="checkbox" name="lmtttmpts_login_form_captcha_check" value="1" <?php if (isset($lmtttmpts_options["login_form_captcha_check"])) { echo 'checked="checked"'; } ?> /> <span class="bws_info">(<?php _e('Using Captcha powered by', 'lmtttmpts'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php _e('Update Captcha at least to v.4.0.2', 'lmtttmpts'); ?> </a></span> <?php } } } else { /* if no plugin is active */ if (array_key_exists('captcha-pro/captcha_pro.php', $all_plugins)) { $using_plugin_name = 'Captcha Pro'; } elseif (array_key_exists('captcha-plus/captcha-plus.php', $all_plugins)) { $using_plugin_name = 'Captcha Plus'; } else { $using_plugin_name = 'Captcha'; } ?> <input disabled="disabled" type="checkbox" name="lmtttmpts_login_form_captcha_check" value="1" <?php if (isset($lmtttmpts_options["login_form_captcha_check"])) { echo 'checked="checked"'; } ?> /><span class="bws_info"> (<?php printf(__('Using %s powered by', 'lmtttmpts'), $using_plugin_name); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php printf(__('Activate %s', 'lmtttmpts'), $using_plugin_name); ?> </a></span> <?php } } else { ?> <input disabled="disabled" type="checkbox" name="lmtttmpts_login_form_captcha_check" value="1" /> <span class="bws_info">(<?php _e('Using Captcha powered by', 'lmtttmpts'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="http://bestwebsoft.com/products/captcha/"><?php _e('Download Captcha', 'lmtttmpts'); ?> </a></span> <?php } ?> <br /><span class="lmtttmpts_little lmtttmpts_grey"><?php _e('Consider the incorrect captcha input as an invalid attempt.', 'lmtttmpts'); ?> </span> <?php $captcha_span = '<span class="bws_info"> (' . __('Using', 'lmtttmpts') . ' <a href="">Captcha Pro</a> ' . __('powered by', 'lmtttmpts') . ' <a href="">bestwebsoft.com</a>)</span>'; ?> <div class="bws_pro_version_bloc" style="max-width: 590px;"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version lmtttmpts_options_table_demo"> <tr> <td style="min-width: 430px;"> <label><input disabled="disabled" type="checkbox" checked="checked"/><span> <?php _e('Registration form', 'lmtttmpts'); ?> </span></label><?php echo $captcha_span; ?> <br /> <label><input disabled="disabled" type="checkbox"/><span> <?php _e('Reset Password form', 'lmtttmpts'); ?> </span></label><?php echo $captcha_span; ?> <br /> <label><input disabled="disabled" type="checkbox"/><span> <?php _e('Comments form', 'lmtttmpts'); ?> </span></label><?php echo $captcha_span; ?> <br /> <label><input disabled="disabled" type="checkbox" checked="checked"/><span> <?php _e('Contact form', 'lmtttmpts'); ?> </span></label><span class="bws_info"> (<?php _e('powered by', 'lmtttmpts'); ?> <a href="">bestwebsoft.com</a>)</span><br /> <label><input disabled="disabled" type="checkbox"/><span> <?php _e('Buddypress registration form', 'lmtttmpts'); ?> </span></label><br /> <label><input disabled="disabled" type="checkbox"/><span> <?php _e('Buddypress comments form', 'lmtttmpts'); ?> </span></label><br /> <label><input disabled="disabled" type="checkbox"/><span> <?php _e('Buddypress "Create a Group" form', 'lmtttmpts'); ?> </span></label><br /> <label><input disabled="disabled" type="checkbox" checked="checked"/><span> <?php _e('Contact Form 7', 'lmtttmpts'); ?> </span></label> </td> </tr> <tr valign="top"> <th scope="row" colspan="3"> <p>* <?php _e('If you upgrade to Pro version all your settings will be saved.', 'lmtttmpts'); ?> </p> <p>* <?php _e('You also need Captcha PRO to use these options.', 'lmtttmpts'); ?> </p> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to a PRO version.', 'lmtttmpts'); ?> <a href="http://bestwebsoft.com/products/limit-attempts/?k=33bc89079511cdfe28aeba317abfaf37&pn=140&v=<?php echo $lmtttmpts_plugin_info["Version"] . '&wp_v=' . $wp_version; ?> " target="_blank" title="Limit Attempts Pro"><?php _e("Learn More", 'lmtttmpts'); ?> </a> </div> <a class="bws_button" href="http://bestwebsoft.com/products/limit-attempts/buy/?k=33bc89079511cdfe28aeba317abfaf37&pn=140&v=<?php echo $lmtttmpts_plugin_info["Version"] . '&wp_v=' . $wp_version; ?> " target="_blank" title="Limit Attempts Pro"> <?php _e('Go', 'lmtttmpts'); ?> <strong>PRO</strong> </a> <div class="clear"></div> </div> </div> </td> </tr> </table> <input type="hidden" name="lmtttmpts_form_submit" value="submit" /> <p class="submit"> <input type="submit" name="lmtttmpts_form_submit_button" class="button-primary" value="<?php _e('Save Changes', 'lmtttmpts'); ?> " /> </p> <?php wp_nonce_field($plugin_basename, 'lmtttmpts_nonce_name'); ?> </form> <?php bws_form_restore_default_settings($plugin_basename); ?> </div> <?php } } elseif ('blocked' == $_GET['action']) { /* Showing blocked list table using wp_list_table class */ ?> <div id="lmtttmpts_blocked"> <?php $lmtttmpts_blocked_list = new Lmtttmpts_Blocked_list(); $lmtttmpts_blocked_list->prepare_items(); ?> <form method="get" action="admin.php"> <?php $lmtttmpts_blocked_list->search_box(__('Search IP', 'lmtttmpts'), 'search_blocked_ip'); ?> <input type="hidden" name="page" value="limit-attempts.php" /> <input type="hidden" name="action" value="blocked" /> </form> <form method="post" action="admin.php?page=limit-attempts.php&action=blocked"> <?php $lmtttmpts_blocked_list->display(); wp_nonce_field($plugin_basename, 'lmtttmpts_nonce_name'); ?> </form> </div> <?php } elseif ('blacklist' == $_GET['action']) { /* Showing blacklist table using wp_list_table class */ ?> <div id="lmtttmpts_blacklist"> <form method="post" action="admin.php?page=limit-attempts.php&action=blacklist"> <td><input type="text" maxlength="31" name="lmtttmpts_add_to_blacklist" /></td> <td><input type="submit" class="button-secondary" value="<?php _e('Add IP to blacklist', 'lmtttmpts'); ?> " /></td> <?php wp_nonce_field($plugin_basename, 'lmtttmpts_nonce_name'); ?> </form> <?php echo $allowed_symbols; $lmtttmpts_blacklist_table = new Lmtttmpts_Blacklist(); $lmtttmpts_blacklist_table->prepare_items(); ?> <form method="get" action="admin.php"> <?php $lmtttmpts_blacklist_table->search_box(__('Search IP', 'lmtttmpts'), 'search_blacklisted_ip'); ?> <input type="hidden" name="page" value="limit-attempts.php" /> <input type="hidden" name="action" value="blacklist" /> </form> <form method="post" action="admin.php?page=limit-attempts.php&action=blacklist"> <?php $lmtttmpts_blacklist_table->display(); wp_nonce_field($plugin_basename, 'lmtttmpts_nonce_name'); ?> </form> </div> <?php } elseif ('whitelist' == $_GET['action']) { /* Showing whitelist table using wp_list_table class */ ?> <div id="lmtttmpts_whitelist"> <form method="post" action="admin.php?page=limit-attempts.php&action=whitelist"> <td><input type="text" maxlength="31" name="lmtttmpts_add_to_whitelist" /></td> <td><input type="submit" class="button-secondary" value="<?php _e('Add IP to whitelist', 'lmtttmpts'); ?> " /></td> <?php wp_nonce_field($plugin_basename, 'lmtttmpts_nonce_name'); ?> </form> <?php echo $allowed_symbols; $lmtttmpts_whitelist_table = new Lmtttmpts_Whitelist(); $lmtttmpts_whitelist_table->prepare_items(); ?> <form method="get" action="admin.php"> <?php $lmtttmpts_whitelist_table->search_box(__('Search IP', 'lmtttmpts'), 'search_whitelisted_ip'); ?> <input type="hidden" name="page" value="limit-attempts.php" /> <input type="hidden" name="action" value="whitelist" /> </form> <form method="post" action="admin.php?page=limit-attempts.php&action=whitelist"> <?php $lmtttmpts_whitelist_table->display(); wp_nonce_field($plugin_basename, 'lmtttmpts_nonce_name'); ?> </form> </div> <?php } elseif ('log' == $_GET['action']) { /* PRO-teaser of 'Log' tab */ ?> <div id="lmtttmpts_log"> <div style="max-width: 100%" class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <div style="padding: 5px;"> <form><p class="search-box"><input disabled="disabled" type="search" name="s"><input disabled="disabled" type="submit" value="<?php _e('Search IP', 'lmtttmpts'); ?> " class="button"></p></form> <form><input disabled="disabled" type="submit" value="<?php _e('Clear Log', 'lmtttmpts'); ?> " class="button"></form> <form> <div class="tablenav top"><div class="alignleft actions bulkactions"><select disabled="disabled"><option><?php _e('Delete log entry', 'lmtttmpts'); ?> </option></select><input disabled="disabled" type="submit" value="Apply" class="button action"></div><div class="tablenav-pages one-page"><span class="displaying-num">1 item</span></div><br class="clear"></div> <table class="wp-list-table widefat fixed bws-plugins_page_limit-attempts-pro"> <thead><tr><th class="manage-column check-column" scope="col"><input disabled="disabled" type="checkbox"></th><th class="manage-column" scope="col"><a href=""><span><?php _e('IP address', 'lmtttmpts'); ?> </span></a></th><th class="manage-column" scope="col"><a href=""><span><?php _e('Internet Hostname', 'lmtttmpts'); ?> </span></a></th><th class="manage-column" scope="col"><a href=""><span><?php _e('Event', 'lmtttmpts'); ?> </span></a></th><th class="manage-column" scope="col"><a href=""><span><?php _e('Form', 'lmtttmpts'); ?> </span></a></th><th class="manage-column" scope="col"><a href=""><span><?php _e('Event time', 'lmtttmpts'); ?> </a></th></tr></thead> <tfoot><tr><th class="manage-column check-column" scope="col"><input disabled="disabled" type="checkbox"></th><th class="manage-column" scope="col"><a href=""><span><?php _e('IP address', 'lmtttmpts'); ?> </span></a></th><th class="manage-column" scope="col"><a href=""><span><?php _e('Internet Hostname', 'lmtttmpts'); ?> </span></a></th><th class="manage-column" scope="col"><a href=""><span><?php _e('Event', 'lmtttmpts'); ?> </span></a></th><th class="manage-column" scope="col"><a href=""><span><?php _e('Form', 'lmtttmpts'); ?> </span></a></th><th class="manage-column" scope="col"><a href=""><span><?php _e('Event time', 'lmtttmpts'); ?> </a></th></tr></tfoot> <tbody><tr class="alternate"><th class="check-column" scope="row"><input disabled="disabled" type="checkbox"></th><td>127.0.0.1</td><td>localhost</td><td><?php _e('Failed attempt', 'lmtttmpts'); ?> </td><td><?php _e('Login form', 'lmtttmpts'); ?> </td><td>November 25, 2014 11:55 am</td></tr> </tbody> </table> <div class="tablenav bottom"><div class="alignleft actions bulkactions"><select disabled="disabled"><option><?php _e('Delete log entry', 'lmtttmpts'); ?> </option></select><input disabled="disabled" type="submit" value="Apply" class="button action"></div><div class="tablenav-pages one-page"><span class="displaying-num">1 item</span></div><br class="clear"></div> </form> </div> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to a PRO version.', 'lmtttmpts'); ?> <a href="http://bestwebsoft.com/products/limit-attempts/?k=33bc89079511cdfe28aeba317abfaf37&pn=140&v=<?php echo $lmtttmpts_plugin_info["Version"] . '&wp_v=' . $wp_version; ?> " target="_blank" title="Limit Attempts Pro"> <?php _e("Learn More", 'lmtttmpts'); ?> </a> </div> <a class="bws_button" href="http://bestwebsoft.com/products/limit-attempts/buy/?k=33bc89079511cdfe28aeba317abfaf37&pn=140&v=<?php echo $lmtttmpts_plugin_info["Version"] . '&wp_v=' . $wp_version; ?> " target="_blank" title="Limit Attempts Pro"> <?php _e('Go', 'lmtttmpts'); ?> <strong>PRO</strong> </a> <div class="clear"></div> </div> </div> </div> <?php } elseif ('statistics' == $_GET['action']) { /* Showing statistics table using wp_list_table class */ if (isset($_POST['lmtttmpts_clear_statistics_complete']) && check_admin_referer($plugin_basename, 'lmtttmpts_nonce_name')) { ?> <div id="lmtttmpts_clear_statistics_confirm"> <p><?php _e('Are you sure you want to delete all statistics entries?', 'lmtttmpts'); ?> </p> <form method="post" action="admin.php?page=limit-attempts.php&action=statistics"> <button class="button" name="lmtttmpts_clear_statistics_complete_confirm"><?php _e('Yes, delete these entries', 'lmtttmpts'); ?> </button> <button class="button" name="lmtttmpts_clear_statistics_complete_deny"><?php _e('No, go back to the Statistics page', 'lmtttmpts'); ?> </button> <?php wp_nonce_field($plugin_basename, 'lmtttmpts_nonce_name'); ?> </form> </div> <?php } else { ?> <div id="lmtttmpts_statistics"> <?php $lmtttmpts_statistics_list = new Lmtttmpts_Statistics(); $lmtttmpts_statistics_list->prepare_items(); ?> <form method="get" action="admin.php"> <?php $lmtttmpts_statistics_list->search_box(__('Search IP', 'lmtttmpts'), 'search_statistics_ip'); ?> <input type="hidden" name="page" value="limit-attempts.php" /> <input type="hidden" name="action" value="statistics" /> </form> <form method="post" action="admin.php?page=limit-attempts.php&action=statistics"> <input type="hidden" name="lmtttmpts_clear_statistics_complete" /> <input type="submit" class="button" value="<?php _e('Clear Statistics', 'lmtttmpts'); ?> " /> <?php wp_nonce_field(plugin_basename(__FILE__), 'lmtttmpts_nonce_name'); ?> </form> <form method="post" action="admin.php?page=limit-attempts.php&action=statistics"> <?php $lmtttmpts_statistics_list->display(); wp_nonce_field($plugin_basename, 'lmtttmpts_nonce_name'); ?> </form> </div> <?php } } elseif ('go_pro' == $_GET['action']) { bws_go_pro_tab($lmtttmpts_plugin_info, $plugin_basename, 'limit-attempts.php', 'limit-attempts-pro.php', 'limit-attempts-pro/limit-attempts-pro.php', 'limit-attempts', 'fdac994c203b41e499a2818c409ff2bc', '140', isset($go_pro_result['pro_plugin_is_activated'])); } bws_plugin_reviews_block($lmtttmpts_plugin_info['Name'], 'limit-attempts'); ?> </div> <?php }
function cntctfrm_settings_page() { global $cntctfrm_options, $wpdb, $cntctfrm_option_defaults, $wp_version, $cntctfrm_plugin_info, $lang_codes; $error = $message = $notice = ''; $plugin_basename = plugin_basename(__FILE__); if (!function_exists('get_plugins') || !function_exists('is_plugin_active_for_network')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } if (!isset($_GET['action']) || 'additional' == $_GET['action'] || 'appearance' == $_GET['action']) { $all_plugins = get_plugins(); } /* Check contact-form-multi plugin */ if (is_plugin_active('contact-form-multi/contact-form-multi.php')) { $contact_form_multi_active = true; } if (is_plugin_active('contact-form-multi-pro/contact-form-multi-pro.php')) { $contact_form_multi_pro_active = true; } /* Get Captcha options */ if (get_option('cptch_options')) { $cptch_options = get_option('cptch_options'); } if (get_option('cptchpls_options')) { $cptchpls_options = get_option('cptchpls_options'); } if (get_option('cptchpr_options')) { $cptchpr_options = get_option('cptchpr_options'); } if (get_option('gglcptch_options')) { $gglcptch_options = get_option('gglcptch_options'); } if (get_option('gglcptchpr_options')) { $gglcptchpr_options = get_option('gglcptchpr_options'); } /* Get Contact Form to DB options */ if (get_option('cntctfrmtdb_options')) { $cntctfrmtdb_options = get_option('cntctfrmtdb_options'); } if (get_option('cntctfrmtdbpr_options')) { $cntctfrmtdbpr_options = get_option('cntctfrmtdbpr_options'); } $userslogin = get_users('blog_id=' . $GLOBALS['blog_id'] . '&role=administrator'); if (isset($_POST['cntctfrm_form_appearance_submit']) && check_admin_referer($plugin_basename, 'cntctfrm_nonce_name')) { $cntctfrm_options_submit = array(); if (isset($_POST['bws_hide_premium_options'])) { $hide_result = bws_hide_premium_options($cntctfrm_options_submit); $cntctfrm_options_submit = $hide_result['options']; if (isset($contact_form_multi_active) || isset($contact_form_multi_pro_active)) { $cntctfrm_options = array_merge($cntctfrm_options, $cntctfrm_options_submit); update_option('cntctfrm_options', $cntctfrm_options); } } $cntctfrm_layout = isset($_POST['cntctfrm_layout']) ? (int) $_POST['cntctfrm_layout'] : 1; $cntctfrm_submit_position = isset($_POST['cntctfrm_submit_position']) ? stripslashes(esc_html($_POST['cntctfrm_submit_position'])) : 'left'; $cntctfrm_layout_first_column_string = stripslashes(esc_html($_POST['cntctfrm_layout_first_column'])); $cntctfrm_layout_first_column = explode(',', $cntctfrm_layout_first_column_string); $cntctfrm_layout_first_column = array_diff($cntctfrm_layout_first_column, array('')); $cntctfrm_layout_second_column_string = stripslashes(esc_html($_POST['cntctfrm_layout_second_column'])); $cntctfrm_layout_second_column = explode(',', $cntctfrm_layout_second_column_string); $cntctfrm_layout_second_column = array_diff($cntctfrm_layout_second_column, array('')); if ($cntctfrm_layout === 1 && !empty($cntctfrm_layout_second_column)) { $cntctfrm_layout_first_column = array_merge($cntctfrm_layout_first_column, $cntctfrm_layout_second_column); $cntctfrm_layout_second_column = array(); } $cntctfrm_options_submit['cntctfrm_layout'] = $cntctfrm_layout; $cntctfrm_options_submit['cntctfrm_submit_position'] = $cntctfrm_submit_position; $cntctfrm_options_submit['cntctfrm_order_fields']['first_column'] = $cntctfrm_layout_first_column; $cntctfrm_options_submit['cntctfrm_order_fields']['second_column'] = $cntctfrm_layout_second_column; $cntctfrm_options = array_merge($cntctfrm_options, $cntctfrm_options_submit); if (isset($contact_form_multi_active)) { $cntctfrmmlt_options_main = get_option('cntctfrmmlt_options_main'); if ($cntctfrmmlt_options_main['id_form'] !== $_SESSION['cntctfrmmlt_id_form']) { add_option('cntctfrmmlt_options_' . $cntctfrmmlt_options_main['id_form'], $cntctfrm_options); } else { if ($cntctfrmmlt_options_main['id_form'] == $_SESSION['cntctfrmmlt_id_form']) { update_option('cntctfrmmlt_options_' . $cntctfrmmlt_options_main['id_form'], $cntctfrm_options); } } } elseif (isset($contact_form_multi_pro_active)) { $cntctfrmmltpr_options_main = get_option('cntctfrmmltpr_options_main'); if ($cntctfrmmltpr_options_main['id_form'] !== $_SESSION['cntctfrmmlt_id_form']) { add_option('cntctfrmmlt_options_' . $cntctfrmmltpr_options_main['id_form'], $cntctfrm_options); } else { if ($cntctfrmmltpr_options_main['id_form'] == $_SESSION['cntctfrmmlt_id_form']) { update_option('cntctfrmmlt_options_' . $cntctfrmmltpr_options_main['id_form'], $cntctfrm_options); } } } else { update_option('cntctfrm_options', $cntctfrm_options); } $message = __("Settings saved.", 'contact-form-plugin'); } /* Save data for settings page */ if (isset($_POST['cntctfrm_form_submit']) && check_admin_referer($plugin_basename, 'cntctfrm_nonce_name')) { $cntctfrm_options_submit = array(); if (isset($_POST['bws_hide_premium_options'])) { $hide_result = bws_hide_premium_options($cntctfrm_options_submit); $cntctfrm_options_submit = $hide_result['options']; if (isset($contact_form_multi_active) || isset($contact_form_multi_pro_active)) { $cntctfrm_options = array_merge($cntctfrm_options, $cntctfrm_options_submit); update_option('cntctfrm_options', $cntctfrm_options); } } $cntctfrm_options_submit['cntctfrm_user_email'] = $_POST['cntctfrm_user_email']; $cntctfrm_options_submit['cntctfrm_custom_email'] = trim(stripslashes(esc_html($_POST['cntctfrm_custom_email'])), " ,"); $cntctfrm_options_submit['cntctfrm_select_email'] = $_POST['cntctfrm_select_email']; $cntctfrm_options_submit['cntctfrm_from_email'] = $_POST['cntctfrm_from_email']; $cntctfrm_options_submit['cntctfrm_custom_from_email'] = stripslashes(esc_html($_POST['cntctfrm_custom_from_email'])); $cntctfrm_options_submit['cntctfrm_mail_method'] = $_POST['cntctfrm_mail_method']; $cntctfrm_options_submit['cntctfrm_from_field'] = stripslashes(esc_html($_POST['cntctfrm_from_field'])); $cntctfrm_options_submit['cntctfrm_select_from_field'] = $_POST['cntctfrm_select_from_field']; $cntctfrm_options_submit['cntctfrm_display_name_field'] = isset($_POST['cntctfrm_display_name_field']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_display_address_field'] = isset($_POST['cntctfrm_display_address_field']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_display_phone_field'] = isset($_POST['cntctfrm_display_phone_field']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_attachment'] = isset($_POST['cntctfrm_attachment']) ? $_POST['cntctfrm_attachment'] : 0; $cntctfrm_options_submit['cntctfrm_attachment_explanations'] = isset($_POST['cntctfrm_attachment_explanations']) ? $_POST['cntctfrm_attachment_explanations'] : 0; $cntctfrm_options_submit['cntctfrm_send_copy'] = isset($_POST['cntctfrm_send_copy']) ? $_POST['cntctfrm_send_copy'] : 0; $cntctfrm_options_submit['cntctfrm_delete_attached_file'] = isset($_POST['cntctfrm_delete_attached_file']) ? $_POST['cntctfrm_delete_attached_file'] : 0; if (isset($_POST['cntctfrm_display_captcha'])) { if (get_option('cptch_options')) { $cptch_options['cptch_contact_form'] = 1; update_option('cptch_options', $cptch_options); } if (get_option('cptchpls_options')) { $cptchpls_options['cptchpls_contact_form'] = 1; update_option('cptchpls_options', $cptchpls_options); } if (get_option('cptchpr_options')) { $cptchpr_options['cptchpr_contact_form'] = 1; update_option('cptchpr_options', $cptchpr_options); } } else { if (get_option('cptch_options')) { $cptch_options['cptch_contact_form'] = 0; update_option('cptch_options', $cptch_options); } if (get_option('cptchpls_options')) { $cptchpls_options['cptchpls_contact_form'] = 0; update_option('cptchpls_options', $cptchpls_options); } if (get_option('cptchpr_options')) { $cptchpr_options['cptchpr_contact_form'] = 0; update_option('cptchpr_options', $cptchpr_options); } } if (isset($_POST['cntctfrm_save_email_to_db'])) { if (get_option('cntctfrmtdb_options')) { $cntctfrmtdb_options['cntctfrmtdb_save_messages_to_db'] = 1; update_option('cntctfrmtdb_options', $cntctfrmtdb_options); } if (get_option('cntctfrmtdbpr_options')) { $cntctfrmtdbpr_options['save_messages_to_db'] = 1; update_option('cntctfrmtdbpr_options', $cntctfrmtdbpr_options); } } else { if (get_option('cntctfrmtdb_options')) { $cntctfrmtdb_options['cntctfrmtdb_save_messages_to_db'] = 0; update_option('cntctfrmtdb_options', $cntctfrmtdb_options); } if (get_option('cntctfrmtdbpr_options')) { $cntctfrmtdbpr_options['save_messages_to_db'] = 0; update_option('cntctfrmtdbpr_options', $cntctfrmtdbpr_options); } } if (0 == $cntctfrm_options_submit['cntctfrm_display_name_field']) { $cntctfrm_options_submit['cntctfrm_required_name_field'] = 0; } else { $cntctfrm_options_submit['cntctfrm_required_name_field'] = isset($_POST['cntctfrm_required_name_field']) ? 1 : 0; } if (0 == $cntctfrm_options_submit['cntctfrm_display_address_field']) { $cntctfrm_options_submit['cntctfrm_required_address_field'] = 0; } else { $cntctfrm_options_submit['cntctfrm_required_address_field'] = isset($_POST['cntctfrm_required_address_field']) ? 1 : 0; } $cntctfrm_options_submit['cntctfrm_required_email_field'] = isset($_POST['cntctfrm_required_email_field']) ? 1 : 0; if (0 == $cntctfrm_options_submit['cntctfrm_display_phone_field']) { $cntctfrm_options_submit['cntctfrm_required_phone_field'] = 0; } else { $cntctfrm_options_submit['cntctfrm_required_phone_field'] = isset($_POST['cntctfrm_required_phone_field']) ? 1 : 0; } $cntctfrm_options_submit['cntctfrm_required_subject_field'] = isset($_POST['cntctfrm_required_subject_field']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_required_message_field'] = isset($_POST['cntctfrm_required_message_field']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_required_symbol'] = isset($_POST['cntctfrm_required_symbol']) ? stripslashes(esc_html($_POST['cntctfrm_required_symbol'])) : '*'; $cntctfrm_options_submit['cntctfrm_html_email'] = isset($_POST['cntctfrm_html_email']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_display_add_info'] = isset($_POST['cntctfrm_display_add_info']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_display_sent_from'] = isset($_POST['cntctfrm_display_sent_from']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_display_date_time'] = isset($_POST['cntctfrm_display_date_time']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_display_coming_from'] = isset($_POST['cntctfrm_display_coming_from']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_display_user_agent'] = isset($_POST['cntctfrm_display_user_agent']) ? 1 : 0; if (0 == $cntctfrm_options_submit['cntctfrm_display_sent_from'] && 0 == $cntctfrm_options_submit['cntctfrm_display_date_time'] && 0 == $cntctfrm_options_submit['cntctfrm_display_coming_from'] && 0 == $cntctfrm_options_submit['cntctfrm_display_user_agent']) { $cntctfrm_options_submit['cntctfrm_display_add_info'] = 0; } if (0 == $cntctfrm_options_submit['cntctfrm_display_add_info']) { $cntctfrm_options_submit['cntctfrm_display_sent_from'] = 1; $cntctfrm_options_submit['cntctfrm_display_date_time'] = 1; $cntctfrm_options_submit['cntctfrm_display_coming_from'] = 1; $cntctfrm_options_submit['cntctfrm_display_user_agent'] = 1; } $cntctfrm_options_submit['cntctfrm_change_label'] = isset($_POST['cntctfrm_change_label']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_change_label_in_email'] = isset($_POST['cntctfrm_change_label_in_email']) ? 1 : 0; if (1 == $cntctfrm_options_submit['cntctfrm_change_label']) { foreach ($_POST['cntctfrm_name_label'] as $key => $val) { $cntctfrm_options_submit['cntctfrm_name_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_name_label'][$key])); $cntctfrm_options_submit['cntctfrm_address_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_address_label'][$key])); $cntctfrm_options_submit['cntctfrm_email_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_email_label'][$key])); $cntctfrm_options_submit['cntctfrm_phone_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_phone_label'][$key])); $cntctfrm_options_submit['cntctfrm_subject_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_subject_label'][$key])); $cntctfrm_options_submit['cntctfrm_message_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_message_label'][$key])); $cntctfrm_options_submit['cntctfrm_attachment_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_attachment_label'][$key])); $cntctfrm_options_submit['cntctfrm_attachment_tooltip'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_attachment_tooltip'][$key])); $cntctfrm_options_submit['cntctfrm_send_copy_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_send_copy_label'][$key])); $cntctfrm_options_submit['cntctfrm_thank_text'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_thank_text'][$key])); $cntctfrm_options_submit['cntctfrm_submit_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_submit_label'][$key])); $cntctfrm_options_submit['cntctfrm_name_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_name_error'][$key])); $cntctfrm_options_submit['cntctfrm_address_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_address_error'][$key])); $cntctfrm_options_submit['cntctfrm_email_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_email_error'][$key])); $cntctfrm_options_submit['cntctfrm_phone_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_phone_error'][$key])); $cntctfrm_options_submit['cntctfrm_subject_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_subject_error'][$key])); $cntctfrm_options_submit['cntctfrm_message_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_message_error'][$key])); $cntctfrm_options_submit['cntctfrm_attachment_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_attachment_error'][$key])); $cntctfrm_options_submit['cntctfrm_attachment_upload_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_attachment_upload_error'][$key])); $cntctfrm_options_submit['cntctfrm_attachment_move_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_attachment_move_error'][$key])); $cntctfrm_options_submit['cntctfrm_attachment_size_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_attachment_size_error'][$key])); $cntctfrm_options_submit['cntctfrm_captcha_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_captcha_error'][$key])); $cntctfrm_options_submit['cntctfrm_form_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_form_error'][$key])); } } else { if (empty($cntctfrm_options['cntctfrm_language'])) { $cntctfrm_options_submit['cntctfrm_name_label'] = $cntctfrm_option_defaults['cntctfrm_name_label']; $cntctfrm_options_submit['cntctfrm_address_label'] = $cntctfrm_option_defaults['cntctfrm_address_label']; $cntctfrm_options_submit['cntctfrm_email_label'] = $cntctfrm_option_defaults['cntctfrm_email_label']; $cntctfrm_options_submit['cntctfrm_phone_label'] = $cntctfrm_option_defaults['cntctfrm_phone_label']; $cntctfrm_options_submit['cntctfrm_subject_label'] = $cntctfrm_option_defaults['cntctfrm_subject_label']; $cntctfrm_options_submit['cntctfrm_message_label'] = $cntctfrm_option_defaults['cntctfrm_message_label']; $cntctfrm_options_submit['cntctfrm_attachment_label'] = $cntctfrm_option_defaults['cntctfrm_attachment_label']; $cntctfrm_options_submit['cntctfrm_attachment_tooltip'] = $cntctfrm_option_defaults['cntctfrm_attachment_tooltip']; $cntctfrm_options_submit['cntctfrm_send_copy_label'] = $cntctfrm_option_defaults['cntctfrm_send_copy_label']; $cntctfrm_options_submit['cntctfrm_thank_text'] = $_POST['cntctfrm_thank_text']; $cntctfrm_options_submit['cntctfrm_submit_label'] = $cntctfrm_option_defaults['cntctfrm_submit_label']; $cntctfrm_options_submit['cntctfrm_name_error'] = $cntctfrm_option_defaults['cntctfrm_name_error']; $cntctfrm_options_submit['cntctfrm_address_error'] = $cntctfrm_option_defaults['cntctfrm_address_error']; $cntctfrm_options_submit['cntctfrm_email_error'] = $cntctfrm_option_defaults['cntctfrm_email_error']; $cntctfrm_options_submit['cntctfrm_phone_error'] = $cntctfrm_option_defaults['cntctfrm_phone_error']; $cntctfrm_options_submit['cntctfrm_subject_error'] = $cntctfrm_option_defaults['cntctfrm_subject_error']; $cntctfrm_options_submit['cntctfrm_message_error'] = $cntctfrm_option_defaults['cntctfrm_message_error']; $cntctfrm_options_submit['cntctfrm_attachment_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_error']; $cntctfrm_options_submit['cntctfrm_attachment_upload_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_upload_error']; $cntctfrm_options_submit['cntctfrm_attachment_move_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_move_error']; $cntctfrm_options_submit['cntctfrm_attachment_size_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_size_error']; $cntctfrm_options_submit['cntctfrm_captcha_error'] = $cntctfrm_option_defaults['cntctfrm_captcha_error']; $cntctfrm_options_submit['cntctfrm_form_error'] = $cntctfrm_option_defaults['cntctfrm_form_error']; foreach ($cntctfrm_options_submit['cntctfrm_thank_text'] as $key => $val) { $cntctfrm_options_submit['cntctfrm_thank_text'][$key] = stripcslashes(htmlspecialchars($val)); } } else { $cntctfrm_options_submit['cntctfrm_name_label']['en'] = $cntctfrm_option_defaults['cntctfrm_name_label']['en']; $cntctfrm_options_submit['cntctfrm_address_label']['en'] = $cntctfrm_option_defaults['cntctfrm_address_label']['en']; $cntctfrm_options_submit['cntctfrm_email_label']['en'] = $cntctfrm_option_defaults['cntctfrm_email_label']['en']; $cntctfrm_options_submit['cntctfrm_phone_label']['en'] = $cntctfrm_option_defaults['cntctfrm_phone_label']['en']; $cntctfrm_options_submit['cntctfrm_subject_label']['en'] = $cntctfrm_option_defaults['cntctfrm_subject_label']['en']; $cntctfrm_options_submit['cntctfrm_message_label']['en'] = $cntctfrm_option_defaults['cntctfrm_message_label']['en']; $cntctfrm_options_submit['cntctfrm_attachment_label']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_label']['en']; $cntctfrm_options_submit['cntctfrm_attachment_tooltip']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_tooltip']['en']; $cntctfrm_options_submit['cntctfrm_send_copy_label']['en'] = $cntctfrm_option_defaults['cntctfrm_send_copy_label']['en']; $cntctfrm_options_submit['cntctfrm_submit_label']['en'] = $cntctfrm_option_defaults['cntctfrm_submit_label']['en']; $cntctfrm_options_submit['cntctfrm_name_error']['en'] = $cntctfrm_option_defaults['cntctfrm_name_error']['en']; $cntctfrm_options_submit['cntctfrm_address_error']['en'] = $cntctfrm_option_defaults['cntctfrm_address_error']['en']; $cntctfrm_options_submit['cntctfrm_email_error']['en'] = $cntctfrm_option_defaults['cntctfrm_email_error']['en']; $cntctfrm_options_submit['cntctfrm_phone_error']['en'] = $cntctfrm_option_defaults['cntctfrm_phone_error']['en']; $cntctfrm_options_submit['cntctfrm_subject_error']['en'] = $cntctfrm_option_defaults['cntctfrm_subject_error']['en']; $cntctfrm_options_submit['cntctfrm_message_error']['en'] = $cntctfrm_option_defaults['cntctfrm_message_error']['en']; $cntctfrm_options_submit['cntctfrm_attachment_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_error']['en']; $cntctfrm_options_submit['cntctfrm_attachment_upload_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_upload_error']['en']; $cntctfrm_options_submit['cntctfrm_attachment_move_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_move_error']['en']; $cntctfrm_options_submit['cntctfrm_attachment_size_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_size_error']['en']; $cntctfrm_options_submit['cntctfrm_captcha_error']['en'] = $cntctfrm_option_defaults['cntctfrm_captcha_error']['en']; $cntctfrm_options_submit['cntctfrm_form_error']['en'] = $cntctfrm_option_defaults['cntctfrm_form_error']['en']; foreach ($_POST['cntctfrm_thank_text'] as $key => $val) { $cntctfrm_options_submit['cntctfrm_thank_text'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_thank_text'][$key])); } } } /* if 'FROM' field was changed */ if ('custom' == $cntctfrm_options['cntctfrm_from_email'] && 'custom' != $cntctfrm_options_submit['cntctfrm_from_email'] || 'custom' == $cntctfrm_options_submit['cntctfrm_from_email'] && $cntctfrm_options['cntctfrm_custom_from_email'] != $cntctfrm_options_submit['cntctfrm_custom_from_email']) { $notice = __("Email 'FROM' field option was changed, which may cause email messages being moved to the spam folder or email delivery failures.", 'contact-form-plugin'); } $cntctfrm_options_submit['cntctfrm_action_after_send'] = $_POST['cntctfrm_action_after_send']; $cntctfrm_options_submit['cntctfrm_redirect_url'] = esc_url($_POST['cntctfrm_redirect_url']); $cntctfrm_options = array_merge($cntctfrm_options, $cntctfrm_options_submit); if (0 == $cntctfrm_options_submit['cntctfrm_action_after_send'] && ("" == trim($cntctfrm_options_submit['cntctfrm_redirect_url']) || !filter_var($cntctfrm_options_submit['cntctfrm_redirect_url'], FILTER_VALIDATE_URL))) { $error .= __("If the 'Redirect to page' option is selected then the URL field should be in the following format", 'contact-form-plugin') . " <code>http://your_site/your_page</code>"; $cntctfrm_options['cntctfrm_action_after_send'] = 1; } if ('user' == $cntctfrm_options_submit['cntctfrm_select_email']) { if ('3.3' > $wp_version && function_exists('get_userdatabylogin') && false !== get_userdatabylogin($cntctfrm_options_submit['cntctfrm_user_email'])) { /**/ } else { if (false !== get_user_by('login', $cntctfrm_options_submit['cntctfrm_user_email'])) { /**/ } else { $error .= __("Such user does not exist.", 'contact-form-plugin'); } } } else { if (preg_match('|,|', $cntctfrm_options_submit['cntctfrm_custom_email'])) { $cntctfrm_custom_emails = explode(',', $cntctfrm_options_submit['cntctfrm_custom_email']); } else { $cntctfrm_custom_emails[0] = $cntctfrm_options_submit['cntctfrm_custom_email']; } foreach ($cntctfrm_custom_emails as $cntctfrm_custom_email) { if ($cntctfrm_custom_email == "" || !is_email(trim($cntctfrm_custom_email))) { $error .= __("Please enter a valid email address in the 'Use this email address' field.", 'contact-form-plugin'); break; } } } if ('custom' == $cntctfrm_options_submit['cntctfrm_from_email']) { if ("" == $cntctfrm_options_submit['cntctfrm_custom_from_email'] || !is_email(trim($cntctfrm_options_submit['cntctfrm_custom_from_email']))) { $error .= __("Please enter a valid email address in the 'FROM' field.", 'contact-form-plugin'); } } if ('' == $error) { if (isset($contact_form_multi_active)) { $cntctfrmmlt_options_main = get_option('cntctfrmmlt_options_main'); if ($cntctfrmmlt_options_main['id_form'] !== $_SESSION['cntctfrmmlt_id_form']) { add_option('cntctfrmmlt_options_' . $cntctfrmmlt_options_main['id_form'], $cntctfrm_options); } else { if ($cntctfrmmlt_options_main['id_form'] == $_SESSION['cntctfrmmlt_id_form']) { update_option('cntctfrmmlt_options_' . $cntctfrmmlt_options_main['id_form'], $cntctfrm_options); } } } elseif (isset($contact_form_multi_pro_active)) { $cntctfrmmltpr_options_main = get_option('cntctfrmmltpr_options_main'); if ($cntctfrmmltpr_options_main['id_form'] !== $_SESSION['cntctfrmmlt_id_form']) { add_option('cntctfrmmlt_options_' . $cntctfrmmltpr_options_main['id_form'], $cntctfrm_options); } else { if ($cntctfrmmltpr_options_main['id_form'] == $_SESSION['cntctfrmmlt_id_form']) { update_option('cntctfrmmlt_options_' . $cntctfrmmltpr_options_main['id_form'], $cntctfrm_options); } } } else { update_option('cntctfrm_options', $cntctfrm_options); } $message = __("Settings saved.", 'contact-form-plugin'); } else { $error .= ' ' . __("Settings are not saved.", 'contact-form-plugin'); } } $bws_hide_premium_options_check = bws_hide_premium_options_check(get_option('cntctfrm_options')); /* GO PRO */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { $go_pro_result = bws_go_pro_tab_check($plugin_basename, 'cntctfrm_options'); if (!empty($go_pro_result['error'])) { $error = $go_pro_result['error']; } elseif (!empty($go_pro_result['message'])) { $message = $go_pro_result['message']; } } /* Add restore function */ if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $cntctfrm_options = $cntctfrm_option_defaults; update_option('cntctfrm_options', $cntctfrm_options); $message = __('All plugin settings were restored.', 'contact-form-plugin'); } /* end */ ?> <div class="wrap"> <h1><?php _e("Contact Form Settings", 'contact-form-plugin'); ?> </h1> <ul class="subsubsub cntctfrm_how_to_use"> <li><a href="https://docs.google.com/document/d/1qZYPJhkSdVyyM6XO5WfiBcTS2Sa9_9UMn4vS2g48JRY/" target="_blank"><?php _e('How to Use Step-by-step Instruction', 'contact-form-plugin'); ?> </a></li> </ul> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=contact_form.php"><?php _e('Settings', 'contact-form-plugin'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'additional' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=contact_form.php&action=additional"><?php _e('Additional settings', 'contact-form-plugin'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'appearance' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=contact_form.php&action=appearance"><?php _e('Appearance', 'contact-form-plugin'); ?> </a> <a class="nav-tab bws_go_pro_tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=contact_form.php&action=go_pro"><?php _e('Go PRO', 'contact-form-plugin'); ?> </a> </h2> <?php if (isset($_GET['action']) && 'additional' == $_GET['action']) { ?> <noscript> <div class="error"> <p> <strong><?php printf(__("Please enable JavaScript to add language in the contact form, change the names of the contact form fields and error messages.", 'contact-form-plugin'), __("Form layout", 'contact-form-plugin'), __("Submit position", 'contact-form-plugin')); ?> </strong> </p> </div> </noscript> <?php } ?> <div class="updated fade" <?php if ($message == "" || "" != $error) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <div class="error" <?php if ("" == $error) { echo 'style="display:none"'; } ?> ><p><strong><?php echo $error; ?> </strong></p></div> <?php bws_show_settings_notice(); if (!empty($hide_result['message'])) { ?> <div class="updated fade"><p><strong><?php echo $hide_result['message']; ?> </strong></p></div> <?php } if (!empty($notice)) { ?> <div class="error"><p><strong><?php _e('Notice:', 'contact-form-plugin'); ?> </strong> <?php echo $notice; ?> </p></div> <?php } if ((!isset($_GET['action']) || 'go_pro' != $_GET['action']) && !isset($contact_form_multi_active) && !isset($contact_form_multi_pro_active)) { ?> <h3 class="nav-tab-wrapper"> <span class="nav-tab nav-tab-active"><?php _e('NEW_FORM', 'contact-form-plugin'); ?> </span> <a id="cntctfrm_show_multi_notice" class="nav-tab" target="_new" href="http://bestwebsoft.com/products/contact-form-multi/?k=747ca825fb44711e2d24e40697747bc6&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " title="<?php _e("If you want to create multiple contact forms, please install the Contact Form Multi plugin.", 'contact-form-plugin'); ?> ">+</a> </h3> <?php } if (!isset($_GET['action']) || 'additional' == $_GET['action']) { if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } else { ?> <form id="cntctfrm_settings_form" class="bws_form" method="post" action=""> <div style="margin: 20px 0;"> <?php printf(__("If you would like to add a Contact Form to your page or post, please use %s button", 'contact-form-plugin'), '<span class="bws_code"><img style="vertical-align: sub;" src="' . plugins_url('bws_menu/images/shortcode-icon.png', __FILE__) . '" alt=""/></span>'); ?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help"> <div class="bws_hidden_help_text" style="min-width: 260px;"> <?php printf(__("You can add the Contact Form to your page or post by clicking on %s button in the content edit block using the Visual mode. If the button isn't displayed, please use the shortcode %s or %s where * stands for Contact Form language.", 'contact-form-plugin'), '<code><img style="vertical-align: sub;" src="' . plugins_url('bws_menu/images/shortcode-icon.png', __FILE__) . '" alt="" /></code>', sprintf('<br/><span class="bws_code">[bestwebsoft_contact_form%s]</span><br/>', !isset($contact_form_multi_active) && !isset($contact_form_multi_pro_active) ? '' : ' id=' . $_SESSION['cntctfrmmlt_id_form']), sprintf('<br/><span class="bws_code">[bestwebsoft_contact_form%s lang=*]</span>,<br/>', !isset($contact_form_multi_active) && !isset($contact_form_multi_pro_active) ? '' : ' id=' . $_SESSION['cntctfrmmlt_id_form'])); ?> </div> </div> </div> <div <?php if (isset($_GET['action'])) { echo 'style="display: none;"'; } ?> > <p><?php _e("If you leave the fields empty, the messages will be sent to the email address specified during registration.", 'contact-form-plugin'); ?> </p> <table class="form-table" style="width:auto;"> <tr valign="top"> <th scope="row"><?php _e("The user's email address:", 'contact-form-plugin'); ?> </th> <td colspan="2"> <input type="radio" id="cntctfrm_select_email_user" name="cntctfrm_select_email" value="user" <?php if ($cntctfrm_options['cntctfrm_select_email'] == 'user') { echo 'checked="checked" '; } ?> /> <select name="cntctfrm_user_email"> <option disabled><?php _e("Select a username", 'contact-form-plugin'); ?> </option> <?php foreach ($userslogin as $key => $value) { if (isset($value->data)) { if ($value->data->user_email != '') { ?> <option value="<?php echo $value->data->user_login; ?> " <?php if ($cntctfrm_options['cntctfrm_user_email'] == $value->data->user_login) { echo 'selected="selected" '; } ?> ><?php echo $value->data->user_login; ?> </option> <?php } } else { if ($value->user_email != '') { ?> <option value="<?php echo $value->user_login; ?> " <?php if ($cntctfrm_options['cntctfrm_user_email'] == $value->user_login) { echo 'selected="selected" '; } ?> ><?php echo $value->user_login; ?> </option> <?php } } } ?> </select> <span class="bws_info"><?php _e("Enter a username of the person who should get the messages from the contact form.", 'contact-form-plugin'); ?> </span> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Use this email address:", 'contact-form-plugin'); ?> </th> <td colspan="2"> <input type="radio" id="cntctfrm_select_email_custom" name="cntctfrm_select_email" value="custom" <?php if ('custom' == $cntctfrm_options['cntctfrm_select_email']) { echo 'checked="checked" '; } ?> /> <input type="text" name="cntctfrm_custom_email" value="<?php echo $cntctfrm_options['cntctfrm_custom_email']; ?> " onfocus="document.getElementById('cntctfrm_select_email_custom').checked = true;" maxlength="500" /> <span class="bws_info"><?php _e("Enter the email address you want the messages forwarded to.", 'contact-form-plugin'); ?> </span> </td> </tr> </table> <?php if (!$bws_hide_premium_options_check) { ?> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e('Close', 'contact-form-plugin'); ?> "></button> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <th scope="row"><?php _e("Add department selectbox to the contact form:", 'contact-form-plugin'); ?> </th> <td colspan="2"> <input type="radio" id="cntctfrmpr_select_email_department" name="cntctfrmpr_select_email" value="departments" disabled="disabled" /> <div class="cntctfrmpr_department_table"><img style="width:100%;" src="<?php echo plugins_url('images/pro_screen_1.png', __FILE__); ?> " alt="" /></div> </td> </tr> <tr valign="top"> <th scope="row" colspan="2"> * <?php _e('If you upgrade to Pro version all your settings will be saved.', 'contact-form-plugin'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'contact-form-plugin'); ?> </div> <a class="bws_button" href="http://bestwebsoft.com/products/contact-form/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"> <?php _e('Learn More', 'contact-form-plugin'); ?> </a> <div class="clear"></div> </div> </div> <?php } ?> <table class="form-table" style="width:auto;"> <tr valign="top"> <th scope="row"><?php _e("Save emails to the database", 'contact-form-plugin'); ?> </th> <td colspan="2"> <?php if (array_key_exists('contact-form-to-db/contact_form_to_db.php', $all_plugins) || array_key_exists('contact-form-to-db-pro/contact_form_to_db_pro.php', $all_plugins)) { if (is_plugin_active('contact-form-to-db/contact_form_to_db.php') || is_plugin_active('contact-form-to-db-pro/contact_form_to_db_pro.php')) { ?> <input type="checkbox" name="cntctfrm_save_email_to_db" value="1" <?php if (isset($cntctfrmtdb_options) && 1 == $cntctfrmtdb_options["cntctfrmtdb_save_messages_to_db"] || isset($cntctfrmtdbpr_options) && 1 == $cntctfrmtdbpr_options["save_messages_to_db"]) { echo 'checked="checked"'; } ?> /> <span class="bws_info"> (<?php _e('Using', 'contact-form-plugin'); ?> <a href="admin.php?page=cntctfrmtdb_manager">Contact Form to DB by BestWebSoft</a>)</span> <?php } else { ?> <input disabled="disabled" type="checkbox" name="cntctfrm_save_email_to_db" value="1" <?php if (isset($cntctfrmtdb_options) && 1 == $cntctfrmtdb_options["cntctfrmtdb_save_messages_to_db"] || isset($cntctfrmtdbpr_options) && 1 == $cntctfrmtdbpr_options["save_messages_to_db"]) { echo 'checked="checked"'; } ?> /> <span class="bws_info">(<?php _e('Using Contact Form to DB by BestWebSoft', 'contact-form-plugin'); ?> ) <a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php _e('Activate', 'contact-form-plugin'); ?> Contact Form to DB</a></span> <?php } } else { ?> <input disabled="disabled" type="checkbox" name="cntctfrm_save_email_to_db" value="1" /> <span class="bws_info">(<?php _e('Using Contact Form to DB by BestWebSoft', 'contact-form-plugin'); ?> ) <a href="http://bestwebsoft.com/products/contact-form-to-db/?k=19d806f45d866e70545de83169b274f2&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> "><?php _e('Download', 'contact-form-plugin'); ?> Contact Form to DB</a></span> <?php } ?> </td> </tr> </table> </div> <!-- end of main 'settings' div --> <div <?php if (!isset($_GET['action'])) { echo 'style="display: none;"'; } ?> > <table class="form-table" style="width:auto;"> <tr> <th scope="row"><?php _e('What to use?', 'contact-form-plugin'); ?> </th> <td colspan="2"> <fieldset> <label> <input type='radio' name='cntctfrm_mail_method' value='wp-mail' <?php if ('wp-mail' == $cntctfrm_options['cntctfrm_mail_method']) { echo 'checked="checked" '; } ?> /> <?php _e('Wp-mail', 'contact-form-plugin'); ?> </label> <label><span class="bws_info">(<?php _e('You can use the wp_mail function for mailing', 'contact-form-plugin'); ?> )</span></label><br /> <label> <input type='radio' name='cntctfrm_mail_method' value='mail' <?php if ('mail' == $cntctfrm_options['cntctfrm_mail_method']) { echo 'checked="checked" '; } ?> /> <?php _e('Mail', 'contact-form-plugin'); ?> </label> <label><span class="bws_info">(<?php _e('To send mail you can use the php mail function', 'contact-form-plugin'); ?> )</span></label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("'FROM' field", 'contact-form-plugin'); ?> </th> <td style="vertical-align: top;width: 210px;"> <div><?php _e("Name", 'contact-form-plugin'); ?> </div> <div> <label> <input type="radio" id="cntctfrm_select_from_custom_field" name="cntctfrm_select_from_field" value="custom" <?php if ('custom' == $cntctfrm_options['cntctfrm_select_from_field']) { echo 'checked="checked" '; } ?> /> <input type="text" name="cntctfrm_from_field" value="<?php echo stripslashes($cntctfrm_options['cntctfrm_from_field']); ?> " onfocus="document.getElementById('cntctfrm_select_from_custom_field').checked = true;" size="18" maxlength="100" /> </label><br/> <div> <label><input type="radio" id="cntctfrm_select_from_field" name="cntctfrm_select_from_field" value="user_name" <?php if ('user_name' == $cntctfrm_options['cntctfrm_select_from_field']) { echo 'checked="checked" '; } ?> /> <?php _e("User name", 'contact-form-plugin'); ?> </label> <div class="bws_help_box dashicons dashicons-editor-help"> <div class="bws_hidden_help_text" style="min-width: 200px;"><?php echo __("The name of the user who fills the form will be used in the field 'From'.", 'contact-form-plugin'); ?> </div> </div> </div> </div> </td> <td> <div><?php _e("Email", 'contact-form-plugin'); ?> </div> <div> <div> <input type="radio" id="cntctfrm_from_custom_email" name="cntctfrm_from_email" value="custom" <?php if ('custom' == $cntctfrm_options['cntctfrm_from_email']) { echo 'checked="checked" '; } ?> /> <input type="text" name="cntctfrm_custom_from_email" value="<?php echo $cntctfrm_options['cntctfrm_custom_from_email']; ?> " onfocus="document.getElementById('cntctfrm_from_custom_email').checked = true;" maxlength="100" /> </div> <div> <label><input type="radio" id="cntctfrm_from_email" name="cntctfrm_from_email" value="user" <?php if ('user' == $cntctfrm_options['cntctfrm_from_email']) { echo 'checked="checked" '; } ?> /> <?php _e("User email", 'contact-form-plugin'); ?> </label> <div class="bws_help_box dashicons dashicons-editor-help"> <div class="bws_hidden_help_text" style="min-width: 200px;"><?php echo __("The email address of the user who fills the form will be used in the field 'From'.", 'contact-form-plugin'); ?> </div> </div> </div> <div> <span class="bws_info">(<?php _e("If this option is changed, email messages may be moved to the spam folder or email delivery failures may occur.", 'contact-form-plugin'); ?> )</span> </div> </div> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Required symbol", 'contact-form-plugin'); ?> </th> <td colspan="2"> <input type="text" id="cntctfrm_required_symbol" name="cntctfrm_required_symbol" value="<?php echo $cntctfrm_options['cntctfrm_required_symbol']; ?> " maxlength="100" /> </td> </tr> </table> <br /> <table class="cntctfrm_settings_table" style="max-width: auto;"> <thead> <tr valign="top"> <th scope="row"><?php _e("Fields", 'contact-form-plugin'); ?> </th> <th><?php _e("Used", 'contact-form-plugin'); ?> </th> <th><?php _e("Required", 'contact-form-plugin'); ?> </th> <?php if (!$bws_hide_premium_options_check) { ?> <th><?php _e("Visible", 'contact-form-plugin'); ?> </th> <th><?php _e("Disabled for editing", 'contact-form-plugin'); ?> </th> <th scope="row" ><?php _e("Field's default value", 'contact-form-plugin'); ?> </th> <?php } ?> </tr> </thead> <tbody> <?php if (!$bws_hide_premium_options_check) { ?> <tr valign="top" > <td><?php _e("Department selectbox", 'contact-form-plugin'); ?> </td> <td class="bws_pro_version"></td> <td class="bws_pro_version"> <label><input disabled="disabled" type="checkbox" name="cntctfrm_required_department_field" value="1" /> <span class="cntctfrm_mobile_title"><?php _e("Required", 'contact-form-plugin'); ?> </span></label> </td> <td class="bws_pro_version"></td> <td class="bws_pro_version"></td> <td class="bws_pro_version"></td> </tr> <?php } ?> <tr valign="top"> <td><?php _e("Name", 'contact-form-plugin'); ?> </td> <td> <label><input type="checkbox" name="cntctfrm_display_name_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_name_field']) { echo 'checked="checked" '; } ?> /> <span class="cntctfrm_mobile_title"><?php _e("Used", 'contact-form-plugin'); ?> </span></label> </td> <td> <label><input type="checkbox" id="cntctfrm_required_name_field" name="cntctfrm_required_name_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_required_name_field']) { echo 'checked="checked" '; } ?> /> <span class="cntctfrm_mobile_title"><?php _e("Required", 'contact-form-plugin'); ?> </span></label> </td> <?php if (!$bws_hide_premium_options_check) { ?> <td class="bws_pro_version"> <label><input disabled="disabled" type="checkbox" name="cntctfrmpr_visible_name" value="1" checked="checked" /> <span class="cntctfrm_mobile_title"><?php _e("Visible", 'contact-form-plugin'); ?> </span></label> </td> <td class="bws_pro_version"> <label><input disabled="disabled" type="checkbox" name="cntctfrmpr_disabled_name" value="1" /> <span class="cntctfrm_mobile_title"><?php _e("Disabled for editing", 'contact-form-plugin'); ?> </span></label> </td> <td class="bws_pro_version"> <input disabled="disabled" type="checkbox" name="cntctfrmpr_default_name" value="1" /> <?php _e("Use User's name as a default value if the user is logged in.", 'contact-form-plugin'); ?> <br /> <span class="bws_info">(<?php _e("'Visible' and 'Disabled for editing' options will be applied only to logged-in users.", 'contact-form-plugin'); ?> )</span> </td> <?php } ?> </tr> <?php if (!$bws_hide_premium_options_check) { ?> <tr valign="top"> <td><?php _e("Location selectbox", 'contact-form-plugin'); ?> </td> <td class="bws_pro_version"> <label><input disabled="disabled" type="checkbox" name="cntctfrmpr_display_selectbox" value="1" /> <span class="cntctfrm_mobile_title"><?php _e("Used", 'contact-form-plugin'); ?> </span></label> </td> <td class="bws_pro_version"> <label><input disabled="disabled" type="checkbox" name="cntctfrmpr_required_selectbox" value="1" /> <span class="cntctfrm_mobile_title"><?php _e("Required", 'contact-form-plugin'); ?> </span></label> </td> <td class="bws_pro_version"></td> <td class="bws_pro_version"></td> <td class="bws_pro_version"> <label> <span class="cntctfrmpr_mobile_title"><?php _e("Field's default value", 'contact-form-plugin'); ?> </span> <input disabled="disabled" type="file" name="cntctfrmpr_default_location" /> </label> </td> </tr> <?php } ?> <tr valign="top"> <td><?php _e("Address", 'contact-form-plugin'); ?> </td> <td> <label><input type="checkbox" id="cntctfrm_display_address_field" name="cntctfrm_display_address_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_address_field']) { echo 'checked="checked" '; } ?> /> <span class="cntctfrm_mobile_title"><?php _e("Used", 'contact-form-plugin'); ?> </span></label> </td> <td> <label><input type="checkbox" id="cntctfrm_required_address_field" name="cntctfrm_required_address_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_required_address_field']) { echo 'checked="checked" '; } ?> /> <span class="cntctfrm_mobile_title"><?php _e("Required", 'contact-form-plugin'); ?> </span></label> </td> <?php if (!$bws_hide_premium_options_check) { ?> <td></td> <td></td> <td></td> <?php } ?> </tr> <tr valign="top"> <td><?php _e("Email Address", 'contact-form-plugin'); ?> </td> <td></td> <td> <label><input type="checkbox" id="cntctfrm_required_email_field" name="cntctfrm_required_email_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_required_email_field']) { echo 'checked="checked" '; } ?> /> <span class="cntctfrm_mobile_title"><?php _e("Required", 'contact-form-plugin'); ?> </span></label> </td> <?php if (!$bws_hide_premium_options_check) { ?> <td class="bws_pro_version"> <label><input disabled="disabled" type="checkbox" name="cntctfrmpr_visible_email" value="1" checked="checked" /> <span class="cntctfrm_mobile_title"><?php _e("Visible", 'contact-form-plugin'); ?> </span></label> </td> <td class="bws_pro_version"> <label><input disabled="disabled" type="checkbox" name="cntctfrmpr_disabled_email" value="1" /> <span class="cntctfrm_mobile_title"><?php _e("Disabled for editing", 'contact-form-plugin'); ?> </span></label> </td> <td class="bws_pro_version"> <input disabled="disabled" type="checkbox" name="cntctfrmpr_default_email" value="1" /> <?php _e("Use User's email as a default value if the user is logged in.", 'contact-form-plugin'); ?> <br /> <span class="bws_info">(<?php _e("'Visible' and 'Disabled for editing' options will be applied only to logged-in users.", 'contact-form-plugin'); ?> )</span> </td> <?php } ?> </tr> <tr valign="top"> <td><?php _e("Phone number", 'contact-form-plugin'); ?> </td> <td> <label><input type="checkbox" id="cntctfrm_display_phone_field" name="cntctfrm_display_phone_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_phone_field']) { echo 'checked="checked" '; } ?> /> <span class="cntctfrm_mobile_title"><?php _e("Used", 'contact-form-plugin'); ?> </span></label> </td> <td> <label><input type="checkbox" id="cntctfrm_required_phone_field" name="cntctfrm_required_phone_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_required_phone_field']) { echo 'checked="checked" '; } ?> /> <span class="cntctfrm_mobile_title"><?php _e("Required", 'contact-form-plugin'); ?> </span></label> </td> <?php if (!$bws_hide_premium_options_check) { ?> <td></td> <td></td> <td></td> <?php } ?> </tr> <tr valign="top"> <td><?php _e("Subject", 'contact-form-plugin'); ?> </td> <td></td> <td> <label><input type="checkbox" id="cntctfrm_required_subject_field" name="cntctfrm_required_subject_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_required_subject_field']) { echo 'checked="checked" '; } ?> /> <span class="cntctfrm_mobile_title"><?php _e("Required", 'contact-form-plugin'); ?> </span></label> </td> <?php if (!$bws_hide_premium_options_check) { ?> <td class="bws_pro_version"> <label><input class="subject" disabled="disabled" type="checkbox" name="cntctfrmpr_visible_subject" value="1" checked="checked" /> <span class="cntctfrm_mobile_title"><?php _e("Visible", 'contact-form-plugin'); ?> </span></label> </td> <td class="bws_pro_version"> <label><input class="subject" disabled="disabled" type="checkbox" name="cntctfrmpr_disabled_subject" value="1" /> <span class="cntctfrm_mobile_title"><?php _e("Disabled for editing", 'contact-form-plugin'); ?> </span></label> </td> <td class="bws_pro_version"> <label> <span class="cntctfrmpr_mobile_title"><?php _e("Field's default value", 'contact-form-plugin'); ?> </span> <input class="subject" disabled="disabled" type="text" name="cntctfrmpr_default_subject" value="" /> </label> </td> <?php } ?> </tr> <tr valign="top"> <td><?php _e("Message", 'contact-form-plugin'); ?> </td> <td></td> <td> <label><input type="checkbox" id="cntctfrm_required_message_field" name="cntctfrm_required_message_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_required_message_field']) { echo 'checked="checked" '; } ?> /> <span class="cntctfrm_mobile_title"><?php _e("Required", 'contact-form-plugin'); ?> </span></label> </td> <?php if (!$bws_hide_premium_options_check) { ?> <td class="bws_pro_version"> <label><input class="message" disabled="disabled" type="checkbox" name="cntctfrmpr_visible_message" value="1" checked="checked" /> <span class="cntctfrm_mobile_title"><?php _e("Visible", 'contact-form-plugin'); ?> </span></label> </td> <td class="bws_pro_version"> <label><input class="message" disabled="disabled" disabled="disabled" type="checkbox" name="cntctfrmpr_disabled_message" value="1" /> <span class="cntctfrm_mobile_title"><?php _e("Disabled for editing", 'contact-form-plugin'); ?> </span></label> </td> <td class="bws_pro_version"> <label> <span class="cntctfrmpr_mobile_title"><?php _e("Field's default value", 'contact-form-plugin'); ?> </span> <input class="message" disabled="disabled" type="text" name="cntctfrmpr_default_message" value="" /> </label> </td> <?php } ?> </tr> <?php if (!$bws_hide_premium_options_check) { ?> <tr valign="top"> <td></td> <td></td> <td></td> <td colspan="3" class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'contact-form-plugin'); ?> </div> <a class="bws_button" href="http://bestwebsoft.com/products/contact-form/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"> <?php _e('Learn More', 'contact-form-plugin'); ?> </a> <div class="clear"></div> </td> </tr> <?php } ?> <tr valign="top"> <td> <?php _e("Attachment block", 'contact-form-plugin'); ?> <div class="bws_help_box dashicons dashicons-editor-help"> <div class="bws_hidden_help_text" style="min-width: 200px;"><?php echo __("Users can attach the following file formats", 'contact-form-plugin') . ": html, txt, css, gif, png, jpeg, jpg, tiff, bmp, ai, eps, ps, csv, rtf, pdf, doc, docx, xls, xlsx, zip, rar, wav, mp3, ppt, aar, sce"; ?> </div> </div> </td> <td> <label><input type="checkbox" id="cntctfrm_attachment" name="cntctfrm_attachment" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_attachment']) { echo 'checked="checked" '; } ?> /> <span class="cntctfrm_mobile_title"><?php _e("Used", 'contact-form-plugin'); ?> </span></label> </td> <td></td> <?php if (!$bws_hide_premium_options_check) { ?> <td></td> <td></td> <td></td> <?php } ?> </tr> </tbody> </table> <table class="form-table" style="width:auto;"> <tr valign="top"> <th scope="row"><?php _e("Add to the form", 'contact-form-plugin'); ?> </th> <td colspan="3"><fieldset> <div> <label> <input type="checkbox" id="cntctfrm_attachment_explanations" name="cntctfrm_attachment_explanations" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_attachment_explanations'] && '1' == $cntctfrm_options['cntctfrm_attachment']) { echo 'checked="checked" '; } ?> /> <?php _e("Tips below the Attachment", 'contact-form-plugin'); ?> </label> <div class="bws_help_box dashicons dashicons-editor-help"> <div class="bws_hidden_help_text" style="min-width: 200px;"><img title="" src="<?php echo plugins_url('images/tooltip_attachment_tips.png', __FILE__); ?> " alt=""/></div> </div> </div> <div> <label> <input type="checkbox" id="cntctfrm_send_copy" name="cntctfrm_send_copy" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_send_copy']) { echo 'checked="checked" '; } ?> /> <?php _e("'Send me a copy' block", 'contact-form-plugin'); ?> </label> <div class="bws_help_box dashicons dashicons-editor-help"> <div class="bws_hidden_help_text" style="min-width: 200px;"><img title="" src="<?php echo plugins_url('images/tooltip_sendme_block.png', __FILE__); ?> " alt=""/></div> </div> </div> <div style="clear: both;"> <?php if (array_key_exists('captcha/captcha.php', $all_plugins) || array_key_exists('captcha-plus/captcha-plus.php', $all_plugins) || array_key_exists('captcha-pro/captcha_pro.php', $all_plugins)) { if (is_plugin_active('captcha/captcha.php') || is_plugin_active('captcha-plus/captcha-plus.php') || is_plugin_active('captcha-pro/captcha_pro.php')) { ?> <label><input type="checkbox" name="cntctfrm_display_captcha" value="1" <?php if (isset($cptch_options) && 1 == $cptch_options["cptch_contact_form"] || isset($cptchpls_options) && 1 == $cptchpls_options["cptchpls_contact_form"] || isset($cptchpr_options) && 1 == $cptchpr_options["cptchpr_contact_form"]) { echo 'checked="checked"'; } ?> /> Captcha by BestWebSoft</label> <?php } else { ?> <label><input disabled="disabled" type="checkbox" name="cntctfrm_display_captcha" value="1" <?php if (isset($cptch_options) && 1 == $cptch_options["cptch_contact_form"] || isset($cptchpls_options) && 1 == $cptchpls_options["cptchpls_contact_form"] || isset($cptchpr_options) && 1 == $cptchpr_options["cptchpr_contact_form"]) { echo 'checked="checked"'; } ?> /> Captcha by BestWebSoft</label> <span class="bws_info"><a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php _e('Activate captcha', 'contact-form-plugin'); ?> </a></span> <?php } } else { ?> <label><input disabled="disabled" type="checkbox" name="cntctfrm_display_captcha" value="1" /> Captcha by BestWebSoft</label> <span class="bws_info"><a href="http://bestwebsoft.com/products/captcha/?k=19ac1e9b23bea947cfc4a9b8e3326c03&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> "><?php _e('Download captcha', 'contact-form-plugin'); ?> </a></span> <?php } ?> </div> <?php if (!$bws_hide_premium_options_check) { ?> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e('Close', 'contact-form-plugin'); ?> "></button> <div class="bws_table_bg"></div> <div class="bws_pro_version"> <fieldset> <label><input disabled="disabled" type="checkbox" value="1" name="cntctfrmpr_display_privacy_check"> <?php _e('Agreement checkbox', 'contact-form-plugin'); ?> <span class="bws_info">(<?php _e('Required checkbox for submitting the form', 'contact-form-plugin'); ?> )</span></label><br /> <label><input disabled="disabled" type="checkbox" value="1" name="cntctfrmpr_display_optional_check"> <?php _e('Optional checkbox', 'contact-form-plugin'); ?> <span class="bws_info">(<?php _e('Optional checkbox, the results of which will be displayed in email', 'contact-form-plugin'); ?> )</span></label> </fieldset> </div> <div style="padding: 10px; "> * <?php _e('If you upgrade to Pro version all your settings will be saved.', 'contact-form-plugin'); ?> </div> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'contact-form-plugin'); ?> </div> <a class="bws_button" href="http://bestwebsoft.com/products/contact-form/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"> <?php _e('Learn More', 'contact-form-plugin'); ?> </a> <div class="clear"></div> </div> </div> <?php } ?> </fieldset></td> </tr> <tr valign="top"> <th scope="row"><?php _e("Delete an attachment file from the server after the email is sent", 'contact-form-plugin'); ?> </th> <td colspan="3"> <input type="checkbox" id="cntctfrm_delete_attached_file" name="cntctfrm_delete_attached_file" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_delete_attached_file']) { echo 'checked="checked" '; } ?> /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Email in HTML format sending", 'contact-form-plugin'); ?> </th> <td colspan="2"><input type="checkbox" name="cntctfrm_html_email" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_html_email']) { echo 'checked="checked" '; } ?> /></td> </tr> <tr valign="top"> <th scope="row"><?php _e("Display additional info in the email", 'contact-form-plugin'); ?> </th> <td style="width:15px;" class="cntctfrm_td_top_align"> <input type="checkbox" id="cntctfrm_display_add_info" name="cntctfrm_display_add_info" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_add_info']) { echo 'checked="checked" '; } ?> /> </td> <td class="cntctfrm_display_add_info_block" <?php if ('0' == $cntctfrm_options['cntctfrm_display_add_info']) { echo 'style="display:none"'; } ?> > <fieldset> <label><input type="checkbox" id="cntctfrm_display_sent_from" name="cntctfrm_display_sent_from" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_sent_from']) { echo 'checked="checked" '; } ?> /> <?php _e("Sent from (ip address)", 'contact-form-plugin'); ?> </label> <label class="bws_info"><?php _e("Example: Sent from (IP address):\t127.0.0.1", 'contact-form-plugin'); ?> </label><br /> <label><input type="checkbox" id="cntctfrm_display_date_time" name="cntctfrm_display_date_time" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_date_time']) { echo 'checked="checked" '; } ?> /> <?php _e("Date/Time", 'contact-form-plugin'); ?> </label> <label class="bws_info"><?php _e("Example: Date/Time:\tAugust 19, 2013 8:50 pm", 'contact-form-plugin'); ?> </label><br /> <label><input type="checkbox" id="cntctfrm_display_coming_from" name="cntctfrm_display_coming_from" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_coming_from']) { echo 'checked="checked" '; } ?> /> <?php _e("Sent from (referer)", 'contact-form-plugin'); ?> </label> <label class="bws_info"><?php _e("Example: Sent from (referer):\thttp://bestwebsoft.com/contacts/contact-us/", 'contact-form-plugin'); ?> </label><br /> <label><input type="checkbox" id="cntctfrm_display_user_agent" name="cntctfrm_display_user_agent" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_user_agent']) { echo 'checked="checked" '; } ?> /> <?php _e("Using (user agent)", 'contact-form-plugin'); ?> </label> <label class="bws_info"><?php _e("Example: Using (user agent):\tMozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36", 'contact-form-plugin'); ?> </label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Language settings for the field names in the form", 'contact-form-plugin'); ?> </th> <td colspan="2"> <select name="cntctfrm_languages" id="cntctfrm_languages" style="width:300px;"> <?php foreach ($lang_codes as $key => $val) { if (in_array($key, $cntctfrm_options['cntctfrm_language'])) { continue; } echo '<option value="' . esc_attr($key) . '"> ' . esc_html($val) . '</option>'; } ?> </select> <input type="button" class="button-primary" id="cntctfrm_add_language_button" value="<?php _e('Add a language', 'contact-form-plugin'); ?> " /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Change the names of the contact form fields and error messages", 'contact-form-plugin'); ?> </th> <td style="width:15px;" class="cntctfrm_td_top_align"> <input type="checkbox" id="cntctfrm_change_label" name="cntctfrm_change_label" value="1" <?php if ($cntctfrm_options['cntctfrm_change_label'] == '1') { echo 'checked="checked" '; } ?> /> </td> <td class="cntctfrm_change_label_block" <?php if ('0' == $cntctfrm_options['cntctfrm_change_label']) { echo 'style="display:none"'; } ?> > <div class="cntctfrm_label_language_tab cntctfrm_active" id="cntctfrm_label_en"><?php _e('English', 'contact-form-plugin'); ?> </div> <?php if (!empty($cntctfrm_options['cntctfrm_language'])) { foreach ($cntctfrm_options['cntctfrm_language'] as $val) { echo '<div class="cntctfrm_label_language_tab" id="cntctfrm_label_' . $val . '">' . $lang_codes[$val] . ' <span class="cntctfrm_delete" rel="' . $val . '">X</span></div>'; } } ?> <div class="clear"></div> <div class="cntctfrm_language_tab cntctfrm_tab_en"> <div class="cntctfrm_language_tab_block_mini" style="display:none;"><?php _e("click to expand/hide the list", 'contact-form-plugin'); ?> </div> <div class="cntctfrm_language_tab_block"> <input type="text" maxlength="250" name="cntctfrm_name_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_name_label']['en']; ?> " /> <span class="bws_info"><?php _e("Name:", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_address_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_address_label']['en']; ?> " /> <span class="bws_info"><?php _e("Address:", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_email_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_email_label']['en']; ?> " /> <span class="bws_info"><?php _e("Email Address:", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_phone_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_phone_label']['en']; ?> " /> <span class="bws_info"><?php _e("Phone number:", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_subject_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_subject_label']['en']; ?> " /> <span class="bws_info"><?php _e("Subject:", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_message_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_message_label']['en']; ?> " /> <span class="bws_info"><?php _e("Message:", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_label']['en']; ?> " /> <span class="bws_info"><?php _e("Attachment:", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_tooltip[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_tooltip']['en']; ?> " /> <span class="bws_info"><?php _e("Tips below the Attachment block", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_send_copy_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_send_copy_label']['en']; ?> " /> <span class="bws_info"><?php _e("Send me a copy", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_submit_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_submit_label']['en']; ?> " /> <span class="bws_info"><?php _e("Submit", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_name_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_name_error']['en']; ?> " /> <span class="bws_info"><?php _e("Error message for the Name field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_address_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_address_error']['en']; ?> " /> <span class="bws_info"><?php _e("Error message for the Address field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_email_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_email_error']['en']; ?> " /> <span class="bws_info"><?php _e("Error message for the Email field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_phone_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_phone_error']['en']; ?> " /> <span class="bws_info"><?php _e("Error message for the Phone field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_subject_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_subject_error']['en']; ?> " /> <span class="bws_info"><?php _e("Error message for the Subject field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_message_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_message_error']['en']; ?> " /> <span class="bws_info"><?php _e("Error message for the Message field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_error']['en']; ?> " /> <span class="bws_info"><?php _e("Error message about the file type for the Attachment field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_upload_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_upload_error']['en']; ?> " /> <span class="bws_info"><?php _e("Error message while uploading a file for the Attachment field to the server", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_move_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_move_error']['en']; ?> " /> <span class="bws_info"><?php _e("Error message while moving the file for the Attachment field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_size_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_size_error']['en']; ?> " /> <span class="bws_info"><?php _e("Error message when file size limit for the Attachment field is exceeded", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_captcha_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_captcha_error']['en']; ?> " /> <span class="bws_info"><?php _e("Error message for the Captcha field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_form_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_form_error']['en']; ?> " /> <span class="bws_info"><?php _e("Error message for the whole form", 'contact-form-plugin'); ?> </span><br /> </div> <?php if (!isset($contact_form_multi_active) && !isset($contact_form_multi_pro_active)) { ?> <span class="bws_info cntctfrm_shortcode_for_language" style="margin-left: 5px;"><?php _e("Use shortcode", 'contact-form-plugin'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=en]</span> <?php _e("or", 'contact-form-plugin'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form]</span> <?php _e("for this language", 'contact-form-plugin'); ?> </span> <?php } else { ?> <span class="bws_info cntctfrm_shortcode_for_language" style="margin-left: 5px;"><?php _e("Use shortcode", 'contact-form-plugin'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=en id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> <?php _e("or", 'contact-form-plugin'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> <?php _e("for this language", 'contact-form-plugin'); ?> </span> <?php } ?> </div> <?php if (!empty($cntctfrm_options['cntctfrm_language'])) { foreach ($cntctfrm_options['cntctfrm_language'] as $val) { ?> <div class="cntctfrm_language_tab hidden cntctfrm_tab_<?php echo $val; ?> "> <div class="cntctfrm_language_tab_block_mini" style="display:none;"><?php _e("click to expand/hide the list", 'contact-form-plugin'); ?> </div> <div class="cntctfrm_language_tab_block"> <input type="text" maxlength="250" name="cntctfrm_name_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_name_label'][$val])) { echo $cntctfrm_options['cntctfrm_name_label'][$val]; } ?> " /> <span class="bws_info"><?php _e("Name:", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_address_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_address_label'][$val])) { echo $cntctfrm_options['cntctfrm_address_label'][$val]; } ?> " /> <span class="bws_info"><?php _e("Address:", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_email_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_email_label'][$val])) { echo $cntctfrm_options['cntctfrm_email_label'][$val]; } ?> " /> <span class="bws_info"><?php _e("Email Address:", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_phone_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_phone_label'][$val])) { echo $cntctfrm_options['cntctfrm_phone_label'][$val]; } ?> " /> <span class="bws_info"><?php _e("Phone number:", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_subject_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_subject_label'][$val])) { echo $cntctfrm_options['cntctfrm_subject_label'][$val]; } ?> " /> <span class="bws_info"><?php _e("Subject:", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_message_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_message_label'][$val])) { echo $cntctfrm_options['cntctfrm_message_label'][$val]; } ?> " /> <span class="bws_info"><?php _e("Message:", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_attachment_label'][$val])) { echo $cntctfrm_options['cntctfrm_attachment_label'][$val]; } ?> " /> <span class="bws_info"><?php _e("Attachment:", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_tooltip[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_attachment_tooltip'][$val])) { echo $cntctfrm_options['cntctfrm_attachment_tooltip'][$val]; } ?> " /> <span class="bws_info"><?php _e("Tips below the Attachment block", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_send_copy_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_send_copy_label'][$val])) { echo $cntctfrm_options['cntctfrm_send_copy_label'][$val]; } ?> " /> <span class="bws_info"><?php _e("Send me a copy", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_submit_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_submit_label'][$val])) { echo $cntctfrm_options['cntctfrm_submit_label'][$val]; } ?> " /> <span class="bws_info"><?php _e("Submit", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_name_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_name_error'][$val])) { echo $cntctfrm_options['cntctfrm_name_error'][$val]; } ?> " /> <span class="bws_info"><?php _e("Error message for the Name field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_address_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_address_error'][$val])) { echo $cntctfrm_options['cntctfrm_address_error'][$val]; } ?> " /> <span class="bws_info"><?php _e("Error message for the Address field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_email_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_email_error'][$val])) { echo $cntctfrm_options['cntctfrm_email_error'][$val]; } ?> " /> <span class="bws_info"><?php _e("Error message for the Email field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_phone_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_phone_error'][$val])) { echo $cntctfrm_options['cntctfrm_phone_error'][$val]; } ?> " /> <span class="bws_info"><?php _e("Error message for the Phone field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_subject_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_subject_error'][$val])) { echo $cntctfrm_options['cntctfrm_subject_error'][$val]; } ?> " /> <span class="bws_info"><?php _e("Error message for the Subject field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_message_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_message_error'][$val])) { echo $cntctfrm_options['cntctfrm_message_error'][$val]; } ?> " /> <span class="bws_info"><?php _e("Error message for the Message field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_attachment_error'][$val])) { echo $cntctfrm_options['cntctfrm_attachment_error'][$val]; } ?> " /> <span class="bws_info"><?php _e("Error message about the file type for the Attachment field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_upload_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_attachment_upload_error'][$val])) { echo $cntctfrm_options['cntctfrm_attachment_upload_error'][$val]; } ?> " /> <span class="bws_info"><?php _e("Error message while uploading a file for the Attachment field to the server", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_move_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_attachment_move_error'][$val])) { echo $cntctfrm_options['cntctfrm_attachment_move_error'][$val]; } ?> " /> <span class="bws_info"><?php _e("Error message while moving the file for the Attachment field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_size_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_attachment_size_error'][$val])) { echo $cntctfrm_options['cntctfrm_attachment_size_error'][$val]; } ?> " /> <span class="bws_info"><?php _e("Error message when file size limit for the Attachment field is exceeded", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_captcha_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_captcha_error'][$val])) { echo $cntctfrm_options['cntctfrm_captcha_error'][$val]; } ?> " /> <span class="bws_info"><?php _e("Error message for the Captcha field", 'contact-form-plugin'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_form_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_form_error'][$val])) { echo $cntctfrm_options['cntctfrm_form_error'][$val]; } ?> " /> <span class="bws_info"><?php _e("Error message for the whole form", 'contact-form-plugin'); ?> </span><br /> </div> <?php if (!isset($contact_form_multi_active) && !isset($contact_form_multi_pro_active)) { ?> <span class="bws_info cntctfrm_shortcode_for_language" style="margin-left: 5px;"><?php _e("Use shortcode", 'contact-form-plugin'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=<?php echo $val; ?> ]</span> <?php _e("for this language", 'contact-form-plugin'); ?> </span> <?php } else { ?> <span class="bws_info cntctfrm_shortcode_for_language" style="margin-left: 5px;"><?php _e("Use shortcode", 'contact-form-plugin'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=<?php $val . ' id=' . $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> <?php _e("for this language", 'contact-form-plugin'); ?> </span> <?php } ?> </div> <?php } } ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Use the changed names of the contact form fields in the email', 'contact-form-plugin'); ?> </th> <td colspan="2"> <input type="checkbox" name="cntctfrm_change_label_in_email" value="1" <?php if ($cntctfrm_options['cntctfrm_change_label_in_email'] == '1') { echo 'checked="checked" '; } ?> /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Action after email is sent", 'contact-form-plugin'); ?> </th> <td colspan="2" class="cntctfrm_action_after_send_block"> <label><input type="radio" id="cntctfrm_action_after_send" name="cntctfrm_action_after_send" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_action_after_send']) { echo 'checked="checked" '; } ?> /> <?php _e("Display text", 'contact-form-plugin'); ?> </label><br /> <div class="cntctfrm_label_language_tab cntctfrm_active" id="cntctfrm_text_en"><?php _e('English', 'contact-form-plugin'); ?> </div> <?php if (!empty($cntctfrm_options['cntctfrm_language'])) { foreach ($cntctfrm_options['cntctfrm_language'] as $val) { echo '<div class="cntctfrm_label_language_tab" id="cntctfrm_text_' . $val . '">' . $lang_codes[$val] . ' <span class="cntctfrm_delete" rel="' . $val . '">X</span></div>'; } } ?> <div class="clear"></div> <div class="cntctfrm_language_tab cntctfrm_tab_en" style=" padding: 5px 10px 5px 5px;"> <input type="text" maxlength="250" name="cntctfrm_thank_text[en]" value="<?php echo $cntctfrm_options['cntctfrm_thank_text']['en']; ?> " /> <span class="bws_info"><?php _e("Text", 'contact-form-plugin'); ?> </span><br /> <?php if (!isset($contact_form_multi_active) && !isset($contact_form_multi_pro_active)) { ?> <span class="bws_info cntctfrm_shortcode_for_language"><?php _e("Use shortcode", 'contact-form-plugin'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=en]</span> <?php _e("or", 'contact-form-plugin'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form]</span> <?php _e("for this language", 'contact-form-plugin'); ?> </span> <?php } else { ?> <span class="bws_info cntctfrm_shortcode_for_language"><?php _e("Use shortcode", 'contact-form-plugin'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=en id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> <?php _e("or", 'contact-form-plugin'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> <?php _e("for this language", 'contact-form-plugin'); ?> </span> <?php } ?> </div> <?php if (!empty($cntctfrm_options['cntctfrm_language'])) { foreach ($cntctfrm_options['cntctfrm_language'] as $val) { ?> <div class="cntctfrm_language_tab hidden cntctfrm_tab_<?php echo $val; ?> " style=" padding: 5px 10px 5px 5px;"> <label><input type="text" maxlength="250" name="cntctfrm_thank_text[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_thank_text'][$val])) { echo $cntctfrm_options['cntctfrm_thank_text'][$val]; } ?> " /> <span class="bws_info"><?php _e("Text", 'contact-form-plugin'); ?> </span></label><br /> <?php if (!isset($contact_form_multi_active) && !isset($contact_form_multi_pro_active)) { ?> <span class="bws_info cntctfrm_shortcode_for_language"><?php _e("Use shortcode", 'contact-form-plugin'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=<?php echo $val; ?> ]</span> <?php _e("for this language", 'contact-form-plugin'); ?> </span> <?php } else { ?> <span class="bws_info cntctfrm_shortcode_for_language"><?php _e("Use shortcode", 'contact-form-plugin'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=<?php echo $val . ' id=' . $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> <?php _e("for this language", 'contact-form-plugin'); ?> </span> <?php } ?> </div> <?php } } ?> <div id="cntctfrm_before"></div> <br /> <input type="radio" id="cntctfrm_action_after_send_url" name="cntctfrm_action_after_send" value="0" <?php if ('0' == $cntctfrm_options['cntctfrm_action_after_send']) { echo 'checked="checked" '; } ?> /> <?php _e("Redirect to the page", 'contact-form-plugin'); ?> <br /> <label><input type="text" maxlength="250" name="cntctfrm_redirect_url" value="<?php echo $cntctfrm_options['cntctfrm_redirect_url']; ?> " onfocus="document.getElementById('cntctfrm_action_after_send_url').checked = true;" /> <span class="bws_info"><?php _e("Url", 'contact-form-plugin'); ?> </span></label> </td> </tr> </table> <?php if (!$bws_hide_premium_options_check) { ?> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e('Close', 'contact-form-plugin'); ?> "></button> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <th scope="row"><?php _e("Add field 'Reply-To' to the email header", 'contact-form-plugin'); ?> </th> <td colspan="2"> <input disabled="disabled" type="checkbox" id="cntctfrm_header_reply_to" name="cntctfrm_header_reply_to" value="1"> <span class="bws_info">(<?php _e("Field 'Reply-To' will be initialized by user email", 'contact-form-plugin'); ?> )</span> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Auto Response', 'contact-form-plugin'); ?> </th> <td colspan="2"> <input disabled="disabled" type="checkbox" value="1" name="cntctfrm_auto_response" checked="checked"/> <textarea name="cntctfrm_auto_response_message" style="position: relative; margin-left: 20px; z-index: -1;">Dear %%NAME%%, Thank you for contacting us. We have received your message and will reply to it shortly. Regards, %%SITENAME%% Team.</textarea><br/> <span class="bws_info" style="margin-left: 45px"><?php _e("You can use %%NAME%% to display data from the email field and %%MESSAGE%% to display data from the Message field, as well as %%SITENAME%% to display blog name.", 'contact-form-plugin'); ?> </span> </td> </tr> <tr valign="top"> <th scope="row" colspan="2"> * <?php _e('If you upgrade to Pro version all your settings will be saved.', 'contact-form-plugin'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'contact-form-plugin'); ?> </div> <a class="bws_button" href="http://bestwebsoft.com/products/contact-form/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"> <?php _e('Learn More', 'contact-form-plugin'); ?> </a> <div class="clear"></div> </div> </div> <?php } ?> </div> <!-- end of 'Additional' settings --> <input type="hidden" name="cntctfrm_form_submit" value="submit" /> <p class="submit"> <input id="bws-submit-button" type="submit" class="button-primary" value="<?php _e('Save Changes', 'contact-form-plugin'); ?> " /> </p> <?php wp_nonce_field($plugin_basename, 'cntctfrm_nonce_name'); ?> </form> <?php bws_form_restore_default_settings($plugin_basename); } } elseif ('appearance' == $_GET['action']) { if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } else { ?> <noscript> <div class="error"> <p> <strong><?php printf(__("Please enable JavaScript to change '%s', '%s' options and for fields sorting.", 'contact-form-plugin'), __("Form layout", 'contact-form-plugin'), __("Submit position", 'contact-form-plugin')); ?> </strong> </p> </div> </noscript> <form id="cntctfrm_settings_form" class="bws_form" method="post" action=""> <div id="cntctfrm_appearance_wrap" class="cntctfrm_appearance_<?php echo is_rtl() ? 'rtl' : 'ltr'; ?> "> <div id="<?php echo is_rtl() ? 'cntctfrm_right_table' : 'cntctfrm_left_table'; ?> "> <table class="form-table" style="width:auto;"> <tr valign="top"> <th scope="row"><?php _e("Form layout", 'contact-form-plugin'); ?> </th> <td colspan="2"> <fieldset> <input id="cntctfrm_layout_one_column" name="cntctfrm_layout" type="radio" value="1" <?php if ($cntctfrm_options['cntctfrm_layout'] === 1) { echo 'checked="checked"'; } ?> > <label for="cntctfrm_layout_one_column"><?php _e('One column', 'contact-form-plugin'); ?> </label> <br/> <input id="cntctfrm_layout_two_columns" name="cntctfrm_layout" type="radio" value="2" <?php if ($cntctfrm_options['cntctfrm_layout'] === 2) { echo 'checked="checked"'; } ?> > <label for="cntctfrm_layout_two_columns"><?php _e('Two columns', 'contact-form-plugin'); ?> </label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Submit position", 'contact-form-plugin'); ?> </th> <td colspan="2"> <fieldset> <input id="cntctfrm_submit_position_left" name="cntctfrm_submit_position" type="radio" value="left" <?php if ($cntctfrm_options['cntctfrm_submit_position'] == 'left') { echo 'checked="checked"'; } ?> > <label for="cntctfrm_submit_position_left"><?php _e('Left', 'contact-form-plugin'); ?> </label> <br/> <input id="cntctfrm_submit_position_right" name="cntctfrm_submit_position" type="radio" value="right" <?php if ($cntctfrm_options['cntctfrm_submit_position'] == 'right') { echo 'checked="checked"'; } ?> > <label for="cntctfrm_submit_position_right"><?php _e('Right', 'contact-form-plugin'); ?> </label> </fieldset> </td> </tr> </table> <?php if (!$bws_hide_premium_options_check) { ?> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e('Close', 'contact-form-plugin'); ?> "></button> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <th scope="row"><?php _e("Errors output", 'contact-form-plugin'); ?> </th> <td colspan="2"> <select name="cntctfrmpr_error_displaying" disabled='disabled'> <option value="labels"><?php _e("Display error messages", 'contact-form-plugin'); ?> </option> <option value="input_colors"><?php _e("Color of the input field errors.", 'contact-form-plugin'); ?> </option> <option value="both" selected="selected"><?php _e("Display error messages & color of the input field errors", 'contact-form-plugin'); ?> </option> </select> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Add placeholder to the input blocks", 'contact-form-plugin'); ?> </th> <td colspan="2"> <input disabled='disabled' type="checkbox" name="cntctfrmpr_placeholder" value="1" /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Add tooltips", 'contact-form-plugin'); ?> </th> <td colspan="2"> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_name" value="1" /> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_name"><?php _e("Name", 'contact-form-plugin'); ?> </label> </div> <?php if ('1' == $cntctfrm_options['cntctfrm_display_address_field']) { ?> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_address" value="1" /> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_address"><?php _e("Address", 'contact-form-plugin'); ?> </label> </div> <?php } ?> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_email" value="1" /> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_email"><?php _e("Email address", 'contact-form-plugin'); ?> </label> </div> <?php if ('1' == $cntctfrm_options['cntctfrm_display_phone_field']) { ?> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_phone" value="1" /> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_phone"><?php _e("Phone Number", 'contact-form-plugin'); ?> </label> </div> <?php } ?> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_subject" value="1" /> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_subject"><?php _e("Subject", 'contact-form-plugin'); ?> </label> </div> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_message" value="1" /> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_message"><?php _e("Message", 'contact-form-plugin'); ?> </label> </div> <?php if ('1' == $cntctfrm_options['cntctfrm_attachment_explanations']) { ?> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_attachment" value="1" /> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_attachment"><?php _e("Attachment", 'contact-form-plugin'); ?> </label> </div> <?php } ?> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_captcha" value="1" /> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_captcha">Captcha by BestWebSoft</label> </div> </td> </tr> <tr valign="top"> <th colspan="3" scope="row"> <input disabled='disabled' type="checkbox" id="cntctfrmpr_style_options" name="cntctfrmpr_style_options" value="1" checked="checked" /> <?php _e("Style options", 'contact-form-plugin'); ?> </th> </tr> <tr valign="top" class="cntctfrm_style_block"> <th scope="row"><?php _e("Text color", 'contact-form-plugin'); ?> </th> <td colspan="2"> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact-form-plugin'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_label_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e('Label text color', 'contact-form-plugin'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact-form-plugin'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_input_placeholder_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e("Placeholder color", 'contact-form-plugin'); ?> </div> </div> </td> </tr> <tr valign="top" class="cntctfrm_style_block"> <th scope="row"><?php _e("Errors color", 'contact-form-plugin'); ?> </th> <td colspan="2"> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact-form-plugin'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_error_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e('Error text color', 'contact-form-plugin'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact-form-plugin'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_error_input_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e('Background color of the input field errors', 'contact-form-plugin'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact-form-plugin'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_error_input_border_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e('Border color of the input field errors', 'contact-form-plugin'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" id="" value="<?php _e('Default', 'contact-form-plugin'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_input_placeholder_error_color" value="" class="cntctfrmpr_colorPicker " /> <div class="cntctfrm_label_block"><?php _e("Placeholder color of the input field errors", 'contact-form-plugin'); ?> </div> </div> </td> </tr> <tr valign="top" class="cntctfrm_style_block"> <th scope="row"><?php _e("Input fields", 'contact-form-plugin'); ?> </th> <td colspan="2"> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" id="" value="<?php _e('Default', 'contact-form-plugin'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_input_background" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e("Input fields background color", 'contact-form-plugin'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact-form-plugin'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_input_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e("Text fields color", 'contact-form-plugin'); ?> </div> </div> <div> <input disabled='disabled' size="8" type="text" value="" name="cntctfrmpr_border_input_width" /> <div class="cntctfrm_label_block"><?php _e('Border width in px, numbers only', 'contact-form-plugin'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact-form-plugin'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_border_input_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e('Border color', 'contact-form-plugin'); ?> </div> </div> </td> </tr> <tr valign="top" class="cntctfrm_style_block"> <th scope="row"><?php _e("Submit button", 'contact-form-plugin'); ?> </th> <td colspan="2"> <div> <input disabled='disabled' size="8" type="text" value="" name="cntctfrmpr_button_width" /> <div class="cntctfrm_label_block"><?php _e('Width in px, numbers only', 'contact-form-plugin'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact-form-plugin'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_button_backgroud" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e('Button color', 'contact-form-plugin'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact-form-plugin'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_button_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e("Button text color", 'contact-form-plugin'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact-form-plugin'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_border_button_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e('Border color', 'contact-form-plugin'); ?> </div> </div> </td> </tr> <tr valign="top"> <th scope="row" colspan="2"> * <?php _e('If you upgrade to Pro version all your settings will be saved.', 'contact-form-plugin'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'contact-form-plugin'); ?> </div> <a class="bws_button" href="http://bestwebsoft.com/products/contact-form/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"> <?php _e('Learn More', 'contact-form-plugin'); ?> </a> <div class="clear"></div> </div> </div> <?php } ?> </div> <?php if ($bws_hide_premium_options_check) { ?> <div class="clear"></div> <?php } ?> <div id="<?php echo is_rtl() ? 'cntctfrm_left_table' : 'cntctfrm_right_table'; ?> "> <h3><?php _e('Contact Form | Preview', 'contact-form-plugin'); ?> </h3> <span class="bws_info"><?php _e('Drag the necessary field to sort fields.', 'contact-form-plugin'); ?> </span> <?php $cntctfrm_classes = $cntctfrm_options['cntctfrm_layout'] === 1 ? ' cntctfrm_one_column' : ' cntctfrm_two_columns'; $cntctfrm_classes .= is_rtl() ? ' cntctfrm_rtl' : ' cntctfrm_ltr'; ?> <div id="cntctfrm_contact_form" class="cntctfrm_contact_form<?php echo $cntctfrm_classes; ?> "> <div class="cntctfrm_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_form_error']['en']; ?> </div> <div id="cntctfrm_wrap"> <?php $cntctfrm_ordered_fields = cntctfrm_get_ordered_fields(); for ($i = 1; $i <= 2; $i++) { $cntctfrm_column = $i == 1 ? 'first_column' : 'second_column'; ?> <ul id="cntctfrm_<?php echo $cntctfrm_column; ?> " class="cntctfrm_column" <?php if ($i == 2 && $cntctfrm_options['cntctfrm_layout'] === 1) { echo 'style="display: none;"'; } ?> > <?php foreach ($cntctfrm_ordered_fields[$cntctfrm_column] as $cntctfrm_field) { switch ($cntctfrm_field) { case 'cntctfrm_contact_name': if (1 == $cntctfrm_options['cntctfrm_display_name_field']) { ?> <li class="cntctfrm_field_wrap"> <div class="cntctfrm_label cntctfrm_label_name"> <label for="cntctfrm_contact_name"><?php echo $cntctfrm_options['cntctfrm_name_label']['en']; if (1 == $cntctfrm_options['cntctfrm_required_name_field']) { echo '<span class="required"> *</span>'; } ?> </label> </div> <div class="cntctfrm_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_name_error']['en']; ?> </div> <div class="cntctfrm_input cntctfrm_input_name"> <div class="cntctfrm_drag_wrap"></div> <input class="text bws_no_bind_notice" type="text" size="40" value="" name="cntctfrm_contact_name" id="cntctfrm_contact_name" /> </div> </li> <?php } break; case 'cntctfrm_contact_address': if (1 == $cntctfrm_options['cntctfrm_display_address_field']) { ?> <li class="cntctfrm_field_wrap"> <div class="cntctfrm_label cntctfrm_label_address"> <label for="cntctfrm_contact_address"><?php echo $cntctfrm_options['cntctfrm_address_label']['en']; if (1 == $cntctfrm_options['cntctfrm_required_address_field']) { echo '<span class="required"> *</span>'; } ?> </label> </div> <?php if (1 == $cntctfrm_options['cntctfrm_required_address_field']) { ?> <div class="cntctfrm_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_address_error']['en']; ?> </div> <?php } ?> <div class="cntctfrm_input cntctfrm_input_address"> <div class="cntctfrm_drag_wrap"></div> <input class="text bws_no_bind_notice" type="text" size="40" value="" name="cntctfrm_contact_address" id="cntctfrm_contact_address" /> </div> </li> <?php } break; case 'cntctfrm_contact_email': ?> <li class="cntctfrm_field_wrap"> <div class="cntctfrm_label cntctfrm_label_email"> <label for="cntctfrm_contact_email"><?php echo $cntctfrm_options['cntctfrm_email_label']['en']; if (1 == $cntctfrm_options['cntctfrm_required_email_field']) { echo '<span class="required"> *</span>'; } ?> </label> </div> <div class="cntctfrm_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_email_error']['en']; ?> </div> <div class="cntctfrm_input cntctfrm_input_email"> <div class="cntctfrm_drag_wrap"></div> <input class="text bws_no_bind_notice" type="text" size="40" value="" name="cntctfrm_contact_email" id="cntctfrm_contact_email" /> </div> </li> <?php break; case 'cntctfrm_contact_phone': if (1 == $cntctfrm_options['cntctfrm_display_phone_field']) { ?> <li class="cntctfrm_field_wrap"> <div class="cntctfrm_label cntctfrm_label_phone"> <label for="cntctfrm_contact_phone"><?php echo $cntctfrm_options['cntctfrm_phone_label']['en']; if (1 == $cntctfrm_options['cntctfrm_required_phone_field']) { echo '<span class="required"> *</span>'; } ?> </label> </div> <div class="cntctfrm_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_phone_error']['en']; ?> </div> <div class="cntctfrm_input cntctfrm_input_phone"> <div class="cntctfrm_drag_wrap"></div> <input class="text bws_no_bind_notice" type="text" size="40" value="" name="cntctfrm_contact_phone" id="cntctfrm_contact_phone" /> </div> </li> <?php } break; case 'cntctfrm_contact_subject': ?> <li class="cntctfrm_field_wrap"> <div class="cntctfrm_label cntctfrm_label_subject"> <label for="cntctfrm_contact_subject"><?php echo $cntctfrm_options['cntctfrm_subject_label']['en']; if (1 == $cntctfrm_options['cntctfrm_required_subject_field']) { echo '<span class="required"> *</span>'; } ?> </label> </div> <div class="cntctfrm_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_subject_error']['en']; ?> </div> <div class="cntctfrm_input cntctfrm_input_subject"> <div class="cntctfrm_drag_wrap"></div> <input class="text bws_no_bind_notice" type="text" size="40" value="" name="cntctfrm_contact_subject" id="cntctfrm_contact_subject" /> </div> </li> <?php break; case 'cntctfrm_contact_message': ?> <li class="cntctfrm_field_wrap"> <div class="cntctfrm_label cntctfrm_label_message"> <label for="cntctfrm_contact_message"><?php echo $cntctfrm_options['cntctfrm_message_label']['en']; if (1 == $cntctfrm_options['cntctfrm_required_message_field']) { echo '<span class="required"> *</span>'; } ?> </label> </div> <div class="cntctfrm_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_message_error']['en']; ?> </div> <div class="cntctfrm_input cntctfrm_input_message"> <div class="cntctfrm_drag_wrap"></div> <textarea class="bws_no_bind_notice" rows="5" cols="30" name="cntctfrm_contact_message" id="cntctfrm_contact_message"></textarea> </div> </li> <?php break; case 'cntctfrm_contact_attachment': if (1 == $cntctfrm_options['cntctfrm_attachment']) { ?> <li class="cntctfrm_field_wrap"> <div class="cntctfrm_label cntctfrm_label_attachment"> <label for="cntctfrm_contact_attachment"><?php echo $cntctfrm_options['cntctfrm_attachment_label']['en']; ?> </label> </div> <div class="cntctfrm_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_attachment_error']['en']; ?> </div> <div class="cntctfrm_input cntctfrm_input_attachment"> <div class="cntctfrm_drag_wrap"></div> <input class="bws_no_bind_notice" type="file" name="cntctfrm_contact_attachment" id="cntctfrm_contact_attachment" /> <?php if (1 == $cntctfrm_options['cntctfrm_attachment_explanations']) { ?> <label class="cntctfrm_contact_attachment_extensions"><?php echo $cntctfrm_options['cntctfrm_attachment_tooltip']['en']; ?> </label> <?php } ?> </div> </li> <?php } break; case 'cntctfrm_contact_send_copy': if (1 == $cntctfrm_options['cntctfrm_send_copy']) { ?> <li class="cntctfrm_field_wrap"> <div class="cntctfrm_checkbox cntctfrm_checkbox_send_copy"> <div class="cntctfrm_drag_wrap"></div> <input type="checkbox" value="1" name="cntctfrm_contact_send_copy" id="cntctfrm_contact_send_copy" class="bws_no_bind_notice" tyle="margin: 0;" /> <label for="cntctfrm_contact_send_copy"><?php echo $cntctfrm_options['cntctfrm_send_copy_label']['en']; ?> </label> </div> </li> <?php } break; case 'cntctfrm_captcha': if (is_plugin_active('captcha/captcha.php') && (isset($cptch_options) && 1 == $cptch_options['cptch_contact_form']) || is_plugin_active('captcha-plus/captcha-plus.php') && (isset($cptchpls_options) && 1 == $cptchpls_options['cptchpls_contact_form']) || is_plugin_active('captcha-pro/captcha_pro.php') && (isset($cptchpr_options) && 1 == $cptchpr_options['cptchpr_contact_form']) || is_plugin_active('google-captcha/google-captcha.php') && (isset($gglcptch_options) && 1 == $gglcptch_options['contact_form']) || is_plugin_active('google-captcha-pro/google-captcha-pro.php') && (isset($gglcptchpr_options) && 1 == $gglcptchpr_options['contact_form'])) { $cntctfrm_captcha_label = $cntctfrm_captcha_required_symbol = ''; if (is_plugin_active('captcha/captcha.php') && (isset($cptch_options) && 1 == $cptch_options['cptch_contact_form'])) { $cntctfrm_captcha_label = $cptch_options['cptch_label_form']; $cntctfrm_captcha_required_symbol = sprintf(' <span class="required">%s</span>', isset($cptch_options['cptch_required_symbol']) ? $cptch_options['cptch_required_symbol'] : ''); } elseif (is_plugin_active('captcha-plus/captcha-plus.php') && (isset($cptchpls_options) && 1 == $cptchpls_options['cptchpls_contact_form'])) { $cntctfrm_captcha_label = $cptchpls_options['cptchpls_label_form']; $cntctfrm_captcha_required_symbol = sprintf(' <span class="required">%s</span>', isset($cptchpls_options['cptchpls_required_symbol']) ? $cptchpls_options['cptchpls_required_symbol'] : ''); } elseif (is_plugin_active('captcha-pro/captcha_pro.php') && (isset($cptchpr_options) && 1 == $cptchpr_options['cptchpr_contact_form'])) { $cntctfrm_captcha_label = $cptchpr_options['cptchpr_label_form']; $cntctfrm_captcha_required_symbol = sprintf(' <span class="required">%s</span>', isset($cptchpr_options['cptchpr_required_symbol']) ? $cptchpr_options['cptchpr_required_symbol'] : ''); } if (!empty($cntctfrm_captcha_label)) { $cntctfrm_display_captcha_label = sprintf('%1$s%2$s', $cntctfrm_captcha_label, $cntctfrm_captcha_required_symbol); } else { $cntctfrm_display_captcha_label = ''; } ?> <li class="cntctfrm_field_wrap"> <div class="cntctfrm_label cntctfrm_label_captcha"> <label><?php echo $cntctfrm_display_captcha_label; ?> </label> </div> <div class="cntctfrm_input cntctfrm_input_captcha"> <div class="cntctfrm_drag_wrap"></div> <img src="<?php echo plugins_url('images/cptch.png', __FILE__); ?> "> <input id="cntctfrm_captcha" type="hidden" name="cntctfrm_captcha"> </div> </li> <?php } break; default: break; } } ?> </ul> <?php } ?> <div class="clear"></div> </div> <div class="cntctfrm_submit_wrap"> <?php $cntctfrm_direction = is_rtl() ? 'rtl' : 'ltr'; $cntctfrm_submit_position_value = array('ltr' => array('left' => 1, 'right' => 2), 'rtl' => array('left' => 2, 'right' => 1)); for ($i = 1; $i <= 2; $i++) { $cntctfrm_column = $i == 1 ? 'first_column' : 'second_column'; ?> <div id="cntctfrm_submit_<?php echo $cntctfrm_column; ?> " class="cntctfrm_column"> <?php if ($i == $cntctfrm_submit_position_value[$cntctfrm_direction][$cntctfrm_options['cntctfrm_submit_position']]) { ?> <div class="cntctfrm_input cntctfrm_input_submit" style="<?php printf('text-align: %s !important;', $cntctfrm_options['cntctfrm_submit_position']); ?> "> <input type="button" value="<?php echo $cntctfrm_options['cntctfrm_submit_label']['en']; ?> " class="bws_no_bind_notice" style="cursor: pointer; margin: 0; text-align: center;" /> </div> <?php } ?> </div> <?php } ?> <div class="clear"></div> </div> </div> <div id="cntctfrm_shortcode" class="cntctfrm_one_column"> <?php _e("If you would like to add the Contact Form to your website, just copy and paste this shortcode to your post or page or widget:", 'contact-form-plugin'); ?> <br/> <div> <div id="cntctfrm_shortcode_code"> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form<?php if (isset($contact_form_multi_active) || isset($contact_form_multi_pro_active)) { printf(' id=%s', $_SESSION['cntctfrmmlt_id_form']); } ?> ]</span> </div> </div> </div> </div> <div class="clear"></div> <input type="hidden" name="cntctfrm_form_appearance_submit" value="submit" /> <input type="hidden" id="cntctfrm_layout_first_column" name="cntctfrm_layout_first_column" value="<?php echo implode(',', $cntctfrm_options['cntctfrm_order_fields']['first_column']); ?> " /> <input type="hidden" id="cntctfrm_layout_second_column" name="cntctfrm_layout_second_column" value="<?php echo implode(',', $cntctfrm_options['cntctfrm_order_fields']['second_column']); ?> " /> <p class="submit"> <input id="bws-submit-button" type="submit" class="button-primary" value="<?php _e('Save Changes', 'contact-form-plugin'); ?> " /> </p> <?php wp_nonce_field($plugin_basename, 'cntctfrm_nonce_name'); ?> </div> </form> <?php bws_form_restore_default_settings($plugin_basename); } } elseif ('go_pro' == $_GET['action']) { bws_go_pro_tab_show($bws_hide_premium_options_check, $cntctfrm_plugin_info, $plugin_basename, 'contact_form.php', 'contact_form_pro.php', 'contact-form-pro/contact_form_pro.php', 'contact-form', '697c5e74f39779ce77850e11dbe21962', '77', isset($go_pro_result['pro_plugin_is_activated'])); } bws_plugin_reviews_block($cntctfrm_plugin_info['Name'], 'contact-form-plugin'); ?> </div> <?php }
function prflxtrflds_settings_page() { global $wpdb, $prflxtrflds_options, $wp_version, $prflxtrflds_plugin_info, $prflxtrflds_option_defaults; $plugin_basename = plugin_basename(__FILE__); /* Remove slug */ if (isset($_GET['remove']) && wp_verify_nonce($_GET['_wpnonce'], 'prflxtrflds_nonce_name')) { if (isset($_GET['prflxtrflds_field_id'])) { $field_id = filter_input(INPUT_GET, 'prflxtrflds_field_id', FILTER_SANITIZE_STRING); prflxtrflds_remove_field($field_id); } } /* Get all available fields and print it */ $available_fields = $wpdb->get_results("SELECT `field_id` FROM `" . $wpdb->base_prefix . "prflxtrflds_fields_id` LIMIT 1;", ARRAY_A); if (isset($_GET['tab-action']) && 'shortcode' == $_GET['tab-action']) { if (0 < sizeof($available_fields)) { if (isset($_REQUEST['prflxtrflds_form_submit']) && check_admin_referer($plugin_basename, 'prflxtrflds_nonce_name')) { $prflxtrflds_options['empty_value'] = stripslashes(esc_html($_POST['prflxtrflds_empty_value'])); $prflxtrflds_options['not_available_message'] = stripslashes(esc_html($_POST['prflxtrflds_not_available_message'])); $prflxtrflds_options['sort_sequence'] = $_POST['prflxtrflds_sort_sequence']; $prflxtrflds_options['show_empty_columns'] = isset($_POST['prflxtrflds_show_empty_columns']) ? 1 : 0; $prflxtrflds_options['show_id'] = isset($_POST['prflxtrflds_show_id']) ? 1 : 0; $prflxtrflds_options['header_table'] = $_POST['prflxtrflds_header_table']; $prflxtrflds_options['available_fields'] = !empty($_POST['prflxtrflds_options_available_fields']) ? $_POST['prflxtrflds_options_available_fields'] : array(); $prflxtrflds_options['available_values'] = !empty($_POST['prflxtrflds_options_available_values']) ? $_POST['prflxtrflds_options_available_values'] : array(); update_option('prflxtrflds_options', $prflxtrflds_options); $message = __('Settings saved', 'profile-extra-fields'); } if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $prflxtrflds_options = $prflxtrflds_option_defaults; update_option('prflxtrflds_options', $prflxtrflds_options); $message = __('All plugin settings were restored.', 'profile-extra-fields'); } } } ?> <div class="wrap"> <h1>Profile Extra Fields</h1> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['tab-action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=profile-extra-fields.php"><?php _e('Extra fields', 'profile-extra-fields'); ?> </a> <a class="nav-tab <?php if (isset($_GET['tab-action']) && 'userdata' == $_GET['tab-action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=profile-extra-fields.php&tab-action=userdata"><?php _e('User data', 'profile-extra-fields'); ?> </a> <?php if (0 < sizeof($available_fields)) { ?> <a class="nav-tab <?php if (isset($_GET['tab-action']) && 'shortcode' == $_GET['tab-action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=profile-extra-fields.php&tab-action=shortcode"><?php _e('Shortcode settings', 'profile-extra-fields'); ?> </a> <?php } ?> <a class="nav-tab <?php if (isset($_GET['tab-action']) && 'custom_code' == $_GET['tab-action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=profile-extra-fields.php&tab-action=custom_code"><?php _e('Custom code', 'profile-extra-fields'); ?> </a> </h2> <?php /* add new/edit entry */ if (isset($_POST['prflxtrflds_new_entry']) || isset($_GET['edit'])) { prflxtrflds_edit_field(); } elseif (!isset($_GET['tab-action'])) { ?> <form method="post" action="<?php get_admin_url(); ?> ?page=profile-extra-fields.php"> <input type="hidden" name="prflxtrflds_new_entry" value="1" /> <p> <input type="submit" class="button action" name="prflxtrflds_add_new_field" value="<?php _e('Add new field', 'profile-extra-fields'); ?> " /> </p> </form> <div class="prflxtrflds-wplisttable-fullwidth-sort-container"> <?php $prflxtrflds_fields_list_table = new Srrlxtrflds_Fields_List(); /* Wp list table to show all fields */ $prflxtrflds_fields_list_table->prepare_items(); if (isset($prflxtrflds_fields_list_table->items) && 1 < sizeof($prflxtrflds_fields_list_table->items)) { /* Show drag-n-drop message if items > 2 */ ?> <p class="hide-if-no-js prflxtrflds-hide-if-is-mobile"> <?php _e('Drag each item into the order you prefer display fields on user page', 'profile-extra-fields'); ?> </p> <?php } ?> <form class="prflxtrflds-wplisttable-searchform" method="get" action="<?php get_admin_url(); ?> ?page=profile-extra-fields.php"> <input type="hidden" name="page" value="profile-extra-fields.php" /> <?php wp_nonce_field('prflxtrflds_nonce_name', 'prflxtrflds_nonce_name', false); $prflxtrflds_fields_list_table->search_box('search', 'search_id'); ?> <?php $prflxtrflds_fields_list_table->display(); ?> </form> </div><!-- .prflxtrflds-wplisttable-container --> <?php } else { if (isset($_GET['tab-action']) && 'userdata' == $_GET['tab-action']) { global $prflxtrflds_userdatalist_table; if (!isset($prflxtrflds_userdatalist_table)) { $prflxtrflds_userdatalist_table = new Srrlxtrflds_Userdata_List(); } $prflxtrflds_userdatalist_table->prepare_items(); ?> <div class="prflxtrflds-wplisttable-fullwidth-container"> <form method="get" class="prflxtrflds-wplisttable-form"> <input type="hidden" name="page" value="profile-extra-fields.php" /> <input type="hidden" name="tab-action" value="userdata" /> <?php if (!empty($_GET['role'])) { ?> <input type="hidden" name="role" value="<?php echo $_GET['role']; ?> " /> <?php } $prflxtrflds_userdatalist_table->search_box('search', 'search_id'); $prflxtrflds_userdatalist_table->display(); ?> </form> </div> <?php } else { if (isset($_GET['tab-action']) && 'shortcode' == $_GET['tab-action'] && 0 < sizeof($available_fields)) { bws_show_settings_notice(); if (!empty($message)) { ?> <div class="updated fade below-h2"><p><?php echo $message; ?> </p></div> <?php } if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } else { ?> <br/> <div><?php printf(__("If you would like to add user data to your page or post, please use %s button", 'profile-extra-fields'), '<span class="bws_code"><img style="vertical-align: sub;" src="' . plugins_url('bws_menu/images/shortcode-icon.png', __FILE__) . '" alt=""/></span>'); ?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help"> <div class="bws_hidden_help_text" style="min-width: 180px;"> <?php printf(__("You can add user data to your page or post by clicking on %s button in the content edit block using the Visual mode. If the button isn't displayed, please use the shortcode %s, where you can specify a header position (top, left or right), a user role and a user ID", 'profile-extra-fields'), '<code><img style="vertical-align: sub;" src="' . plugins_url('bws_menu/images/shortcode-icon.png', __FILE__) . '" alt="" /></code>', '<code>[prflxtrflds_user_data display=* user_role=* user_id=*]</code>'); ?> </div> </div> </div> <form class="bws_form" method="post" action=""> <table class="form-table"> <tbody> <tr> <th><?php _e('Message for empty field', 'profile-extra-fields'); ?> </th> <td> <input type="text" name="prflxtrflds_empty_value" value="<?php echo $prflxtrflds_options['empty_value']; ?> " /> </td> </tr> <tr> <th><?php _e('Message for the field unavaliable for the user', 'profile-extra-fields'); ?> </th> <td> <input type="text" name="prflxtrflds_not_available_message" value="<?php echo $prflxtrflds_options['not_available_message']; ?> " /> </td> </tr> <tr> <th><?php _e('Sort by user name', 'profile-extra-fields'); ?> </th> <td> <select name="prflxtrflds_sort_sequence" > <option value="ASC" <?php selected($prflxtrflds_options['sort_sequence'], 'ASC'); ?> ><?php _e('ASC', 'profile-extra-fields'); ?> </option> <option value="DESC" <?php selected($prflxtrflds_options['sort_sequence'], 'DESC'); ?> ><?php _e('DESC', 'profile-extra-fields'); ?> </option> </select> </td> </tr> <tr> <th><?php _e('Show empty fields', 'profile-extra-fields'); ?> </th> <td> <label> <input type="checkbox" name="prflxtrflds_show_empty_columns" value="1" <?php checked($prflxtrflds_options['show_empty_columns']); ?> /> <?php _e('Show the field if the value is not filled in by any user', 'profile-extra-fields'); ?> </label> </td> </tr> <tr> <th><?php _e('Show user ID', 'profile-extra-fields'); ?> </th> <td> <input type="checkbox" name="prflxtrflds_show_id" value="1" <?php checked($prflxtrflds_options['show_id']); ?> /> </td> </tr> <tr> <th><?php _e('Position of the table header', 'profile-extra-fields'); ?> </th> <td> <select name="prflxtrflds_header_table" > <option value="top"<?php selected($prflxtrflds_options['header_table'], 'top'); ?> ><?php _e('Top', 'profile-extra-fields'); ?> </option> <option value="side"<?php selected($prflxtrflds_options['header_table'], 'side'); ?> ><?php _e('Side', 'profile-extra-fields'); ?> </option> </select> </td> </tr> </tbody> </table><!--.form-table--> <div class="prflxtrflds-wplisttable-container"> <?php $prflxtrflds_shortcodelist_table = new Srrlxtrflds_Shortcode_List(); /* Wp lis table for shortcode settings */ $prflxtrflds_shortcodelist_table->prepare_items(); $prflxtrflds_shortcodelist_table->views(); $prflxtrflds_shortcodelist_table->display(); ?> </div><!--.prflxtrflds-wplisttable-container--> <p class="submit"> <input type="hidden" name="prflxtrflds_form_submit" value="submit" /> <?php wp_nonce_field($plugin_basename, 'prflxtrflds_nonce_name'); ?> <input id="bws-submit-button" type="submit" class="button-primary" name="prflxtrflds_save_changes" value="<?php _e('Save Changes', 'profile-extra-fields'); ?> " /> </p> </form> <?php bws_form_restore_default_settings($plugin_basename); } } else { bws_custom_code_tab(); } } } bws_plugin_reviews_block($prflxtrflds_plugin_info['Name'], 'profile-extra-fields'); ?> </div><!--.wrap--> <?php }
function cstmsrch_settings_page() { global $wpdb, $cstmsrch_options, $cstmsrch_plugin_info, $wp_version, $cstmsrch_options_default; $message = $error = ''; $plugin_basename = plugin_basename(__FILE__); $args = array('_builtin' => false); $cstmsrch_result = get_post_types($args); if (isset($_REQUEST['cstmsrch_submit']) && check_admin_referer($plugin_basename, 'cstmsrch_nonce_name')) { $cstmsrch_options['post_types'] = isset($_REQUEST['cstmsrch_options']) ? $_REQUEST['cstmsrch_options'] : array(); update_option('cstmsrch_options', $cstmsrch_options); $message = __("Settings saved", 'custom-search'); } else { $args = array('_builtin' => false); $cstmsrch_result = get_post_types($args); if (empty($cstmsrch_result)) { $cstmsrch_options['post_types'] = array(); update_option('cstmsrch_options', $cstmsrch_options); } } if (isset($_POST['bws_restore_confirm']) && check_admin_referer(plugin_basename(__FILE__), 'bws_settings_nonce_name')) { $cstmsrch_options = $cstmsrch_options_default; update_option('cstmsrch_options', $cstmsrch_options); $message = __('All plugin settings were restored.', 'custom-search'); } /* GO PRO */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { $go_pro_result = bws_go_pro_tab_check($plugin_basename); if (!empty($go_pro_result['error'])) { $error = $go_pro_result['error']; } } ?> <div class="wrap"> <div class="icon32 icon32-bws" id="icon-options-general"></div> <h2><?php _e('Custom Search Settings', 'custom-search'); ?> </h2> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php echo !isset($_GET['action']) ? ' nav-tab-active' : ''; ?> " href="admin.php?page=custom_search.php"><?php _e('Settings', 'custom-search'); ?> </a> <a class="nav-tab" href="http://bestwebsoft.com/products/custom-search/faq" target="_blank"><?php _e('FAQ', 'custom-search'); ?> </a> <a class="nav-tab bws_go_pro_tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=custom_search.php&action=go_pro"><?php _e('Go PRO', 'custom-search'); ?> </a> </h2> <div class="updated fade" <?php if (!isset($_REQUEST['cstmsrch_submit'])) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <div class="error" <?php if ("" == $error) { echo 'style="display:none"'; } ?> ><p><strong><?php echo $error; ?> </strong></p></div> <div id="cstmsrch_settings_notice" class="updated fade" style="display:none"><p><strong><?php _e("Notice:", 'custom-search'); ?> </strong> <?php _e("The plugin's settings have been changed. In order to save them please don't forget to click the 'Save Changes' button.", 'custom-search'); ?> </p></div> <?php if (isset($_POST['bws_restore_default']) && check_admin_referer(plugin_basename(__FILE__), 'bws_settings_nonce_name')) { bws_form_restore_default_confirm(plugin_basename(__FILE__)); } else { if (!(isset($_GET['action']) && 'go_pro' == $_GET['action'])) { if (0 < count($cstmsrch_result)) { ?> <form method="post" action="" style="margin-top: 10px;" id="cstmsrch_settings_form"> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Enable Custom search for:', 'custom-search'); ?> </th> <td> <?php $cstmsrch_new_result = array_values($cstmsrch_result); $cstmsrch_select_all = ''; if (!array_diff($cstmsrch_new_result, $cstmsrch_options['post_types'])) { $cstmsrch_select_all = 'checked="checked"'; } ?> <div id="cstmsrch_div_select_all" style="display:none;"><label ><input id="cstmsrch_select_all" type="checkbox" <?php echo $cstmsrch_select_all; ?> /><span style="text-transform: capitalize; padding-left: 5px;"><strong><?php _e('All', 'custom-search'); ?> </strong></span></label></div> <?php foreach ($cstmsrch_result as $value) { ?> <label><input type="checkbox" <?php echo in_array($value, $cstmsrch_options['post_types']) ? 'checked="checked"' : ""; ?> name="cstmsrch_options[]" value="<?php echo $value; ?> "/><span style="text-transform: capitalize; padding-left: 5px;"><?php echo $value; ?> </span></label><br /> <?php } ?> </td> </tr> </table> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <th style="width: 190px !important;" scope="row"><?php _e('Enable Custom search for:', 'custom-search'); ?> </th> <td width="350"> <img title="" src="<?php echo plugins_url('images/dragging-arrow.png', __FILE__); ?> " alt="" /> <label><input type="checkbox" checked="checked" name="cstmsrchpr_options[]" value="post" disabled="disabled" /> <span>Post</span></label><br /> <img title="" src="<?php echo plugins_url('images/dragging-arrow.png', __FILE__); ?> " alt="" /> <label><input type="checkbox" checked="checked" name="cstmsrchpr_options[]" value="page" disabled="disabled" /> <span>Page</span></label><br /> <span class="bws_info"><?php _e('When you drag post types, you affect the order of their display in the frontend on the search page.', 'custom-search'); ?> </span> </td> </tr> <tr valign="top"> <th style="width: 190px !important;" scope="row"><?php _e('Search only by type of the current post', 'custom-search'); ?> </th> <td width="350"> <input type="checkbox" value="1" name="by_current_post_type" disabled="disabled" /><br /> <span class="bws_info"><?php _e('This option is used when you search on a single page/post/post type.', 'custom-search'); ?> </span> </td> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to a PRO version.', 'custom-search'); ?> <a href="http://bestwebsoft.com/products/custom-search/?k=f9558d294313c75b964f5f6fa1e5fd3c&pn=214&v=<?php echo $cstmsrch_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="custom-search Pro"><?php _e('Learn More', 'custom-search'); ?> </a> </div> <a class="bws_button" href="http://bestwebsoft.com/products/custom-search/buy/?k=f9558d294313c75b964f5f6fa1e5fd3c&pn=214&v=<?php echo $cstmsrch_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Custom Search Pro"> <?php _e('Go', 'custom-search'); ?> <strong>PRO</strong> </a> <div class="clear"></div> </div> </div> <p class="submit"> <input type="hidden" name="cstmsrch_submit" value="submit" /> <input type="submit" class="button-primary" value="<?php _e('Save Changes', 'custom-search'); ?> " /> <?php wp_nonce_field($plugin_basename, 'cstmsrch_nonce_name'); ?> </p> </form> <?php } else { ?> <p><?php _e('No custom post type found.', 'custom-search'); ?> </p> <?php } bws_form_restore_default_settings(plugin_basename(__FILE__)); bws_plugin_reviews_block($cstmsrch_plugin_info['Name'], 'custom-search-plugin'); } elseif ('go_pro' == $_GET['action']) { bws_go_pro_tab($cstmsrch_plugin_info, $plugin_basename, 'custom_search.php', 'custom_search_pro.php', 'custom-search-pro/custom-search-pro.php', 'custom-search', 'f9558d294313c75b964f5f6fa1e5fd3c', '214', isset($go_pro_result['pro_plugin_is_activated'])); } } ?> </div> <?php }
function rrrlgvwr_settings_page() { global $rrrlgvwr_options, $rrrlgvwr_options_default, $rrrlgvwr_plugin_info; $message = $error = ""; $plugin_basename = plugin_basename(__FILE__); $error_logging_enabled = ini_get('log_errors') && ini_get('log_errors') != 'Off'; /* Check if error logging enabled on the server */ $php_error_path = ini_get('error_log'); $php_error_log_name = substr($php_error_path, strripos($php_error_path, DIRECTORY_SEPARATOR) + 1); /* Leave only name of the php error log */ $home_path = substr(get_home_path(), strlen(get_home_path()) - 1) == '/' ? substr(get_home_path(), 0, strlen(get_home_path()) - 1) : get_home_path(); $wp_error_files = rrrlgvwr_find_log_files($home_path); /* Add in array all .log files in all subdir of home wp directory */ $saved_log = glob(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'saved_logs' . DIRECTORY_SEPARATOR . '*.txt'); /* Array of saved files in saved_logs */ $saved_log_name = str_replace(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'saved_logs' . DIRECTORY_SEPARATOR, '', $saved_log); /* Array of file's name in saved_logs */ if (!$error_logging_enabled) { $php_error_mes = __('Error logging on your server is disabled. Try to logging via WordPress function.', 'error-log-viewer'); } elseif (empty($php_error_path)) { $php_error_mes = __('Error log filename is not set. Try to logging via WordPress function.', 'error-log-viewer'); } elseif (strpos($php_error_path, "/") === false && strpos($php_error_path, "\\") === false) { $php_error_mes = sprintf(__('The current error_log value %s is not supported. Please change it to an absolute path.', 'error-log-viewer'), esc_html($php_error_path)); } elseif (!is_readable($php_error_path)) { $php_error_mes = sprintf(__('The log file %s does not exist or is inaccessible.', 'error-log-viewer'), esc_html($php_error_path)); } else { $php_error_mes = esc_html($php_error_path); } /* Save settings */ if (isset($_REQUEST['rrrlgvwr_settings_submit']) && check_admin_referer($plugin_basename, 'rrrlgvwr_nonce_name')) { /* Check for monitor file and search changes for sending email */ $rrrlgvwr_options['count_visible_log'] = 0; /* Total count of log */ $rrrlgvwr_options['file_path'] = ''; /* Save files path for sender */ $rrrlgvwr_options['php_error_log_visible'] = isset($_POST['rrrlgvwr_php_visible']) ? 1 : 0; if ($rrrlgvwr_options['php_error_log_visible'] == 1) { $rrrlgvwr_options['file_path'][0] = $php_error_path; $rrrlgvwr_options['count_visible_log'] += $rrrlgvwr_options['php_error_log_visible']; } foreach ($wp_error_files as $key => $file) { $name = str_replace(substr($file, 0, strripos($file, '/') + 1), '', $file); /* Name of log file without way */ $subname = substr($name, 0, strpos($name, '.')); /* Name of log file without extensions */ $subname = $key . "_" . $subname . '_visible'; /* Add '_visible' to the name */ if (is_readable($file)) { $rrrlgvwr_options[$subname] = isset($_POST[$subname]) ? 1 : 0; if ($file == $php_error_path && $rrrlgvwr_options['php_error_log_visible'] == 1) { continue; } if ($rrrlgvwr_options[$subname] == 1) { $rrrlgvwr_options['file_path'][$key + 1] = $file; $rrrlgvwr_options['count_visible_log'] += $rrrlgvwr_options[$subname]; } } elseif (!is_readable($file) && isset($_POST[$subname])) { $error = sprintf(__("File %s isn't readable, change permissions to the file", 'error-log-viewer'), esc_html($name)); } } /* Create log if not exists */ if (isset($_POST['rrrlgvwr_create_log'])) { switch ($_POST['rrrlgvwr_create_log']) { case 'htaccess': $create_mes = rrrlgvwr_edit_htaccess(); if (empty($create_mes)) { $message = __("File '.htaccess' updated successfully and plugin create 'php-errors.log' in plugin log folder", 'error-log-viewer'); } else { $error = $create_mes; } break; case 'config_ini_set': $create_mes = rrrlgvwr_edit_wpconfig_iniset(); if (empty($create_mes)) { $message = __("File 'wp-config' updated successfully and plugin create 'php-errors.log' in plugin log folder", 'error-log-viewer'); } else { $error = $create_mes; } break; case 'config_debug': $create_mes = rrrlgvwr_edit_wpconfig_debug(); if (empty($create_mes)) { $message = __("File 'wp-config' updated successfully and plugin create 'debug.log' in wp-content directory", 'error-log-viewer'); } else { $error = $create_mes; } break; } $wp_error_files = rrrlgvwr_find_log_files($home_path); } /* Sending email options */ $rrrlgvwr_options['send_email'] = isset($_POST['rrrlgvwr_send_email']) ? 1 : 0; if ($rrrlgvwr_options['send_email'] == 1 && $rrrlgvwr_options['file_path'] != '') { if (is_email($_POST['rrrlgvwr_email']) != false && !empty($_POST['rrrlgvwr_email'])) { $rrrlgvwr_options['email'] = $_POST['rrrlgvwr_email']; $rrrlgvwr_options['frequency_send'] = $_POST['rrrlgvwr_frequency_send']; $rrrlgvwr_options['hour_day'] = $_POST['rrrlgvwr_hour_day']; update_option('rrrlgvwr_options', $rrrlgvwr_options); rrrlgvwr_shedule_activation(); } else { $error = __("Make sure that the email field isn't empty or you wrote an email correctly", 'error-log-viewer'); } } elseif ($rrrlgvwr_options['send_email'] == 1 && $rrrlgvwr_options['file_path'] == '') { rrrlgvwr_shedule_deactivation(); $error = __('Select at least one log file', 'error-log-viewer'); } else { rrrlgvwr_shedule_deactivation(); } $message = __('Settings saved successfully', 'error-log-viewer'); update_option('rrrlgvwr_options', $rrrlgvwr_options); } /* Show selected file with necessary settings */ if (isset($_POST['rrrlgvwr_submit_show_content']) && check_admin_referer($plugin_basename, 'rrrlgvwr_nonce_name')) { if (isset($_POST['rrrlgvwr_select_log'])) { $rrrlgvwr_options['error_log_path'] = $_POST['rrrlgvwr_select_log']; $rrrlgvwr_options['confirm_filesize'] = filesize($rrrlgvwr_options['error_log_path']); } $rrrlgvwr_options['lines_count'] = $_POST['rrrlgvwr_lines_count']; update_option('rrrlgvwr_options', $rrrlgvwr_options); } /* Save content from textarea into the file in saved_logs */ if (isset($_POST['rrrlgvwr_save_content']) && check_admin_referer($plugin_basename, 'rrrlgvwr_nonce_name')) { if (isset($_POST['rrrlgvwr_newcontent']) && !empty($_POST['rrrlgvwr_newcontent'])) { $save_mes = rrrlgvwr_save_file($_POST['rrrlgvwr_newcontent']); if ($save_mes == '') { $message = __('File was saved successfully', 'error-log-viewer'); } else { $error = __("Plugin couldn't save the file. Try to change permissions to the directory, or try again", 'error-log-viewer'); } } $saved_log = glob(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'saved_logs' . DIRECTORY_SEPARATOR . '*.txt'); /* Refresh list of files in directory */ $saved_log_name = str_replace(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'saved_logs' . DIRECTORY_SEPARATOR, '', $saved_log); } /* Clear selected log file */ if (isset($_POST['rrrlgvwr_clear_file']) && check_admin_referer($plugin_basename, 'rrrlgvwr_nonce_name')) { $clear_mes = rrrlgvwr_clear_file($_POST['rrrlgvwr_clear_file_name']); if ($clear_mes == '') { $message = __('File was cleared successfully', 'error-log-viewer'); } else { $error = $clear_mes; } } /* Custom wp list table class */ $saved_logs = new Error_Log_Saved_Files(); if ($saved_logs->current_action()) { $saved_logs_action = $saved_logs->current_action(); } else { $saved_logs_action = isset($_REQUEST['saved_logs_action']) ? $_REQUEST['saved_logs_action'] : ''; } $rrrlgvwr_check_del = isset($_REQUEST['rrrlgvwr_check_del']) ? $_REQUEST['rrrlgvwr_check_del'] : 0; switch ($saved_logs_action) { case 'delete': $rrrlgvwr_check_dels = is_array($rrrlgvwr_check_del) ? $rrrlgvwr_check_del : array($rrrlgvwr_check_del); foreach ($rrrlgvwr_check_dels as $check_del) { if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'saved_logs' . DIRECTORY_SEPARATOR . $check_del . '.txt')) { if (@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'saved_logs' . DIRECTORY_SEPARATOR . $check_del . '.txt')) { $message = __('File was deleted successfully', 'error-log-viewer'); } else { $error = sprintf(__("Couldn't delete file %s, change permission to the 'wp-content' or 'error-log-viewer' plugin directory", 'error-log-viewer'), dirname(__FILE__) . DIRECTORY_SEPARATOR . 'saved_logs' . DIRECTORY_SEPARATOR . $check_del . '.txt'); } } } $saved_log = glob(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'saved_logs' . DIRECTORY_SEPARATOR . '*.txt'); /* Refresh list of files in directory */ $saved_log_name = str_replace(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'saved_logs' . DIRECTORY_SEPARATOR, '', $saved_log); break; default: break; } $saved_logs_data = array(); foreach ($saved_log_name as $name) { $date = str_replace('_', '-', substr($name, 0, strpos($name, '-'))) . "
" . str_replace('_', ':', substr($name, strpos($name, '-') + 1, strpos($name, '_log') - (strpos($name, '-') + 1))); $saved_logs_data[] = array('name' => $name, 'check' => substr($name, 0, strpos($name, '.')), 'title' => sprintf('<a target="_blank" class="row-title" href="' . plugin_dir_url(__FILE__) . 'saved_logs/' . $name . '">%1$s</a>', __('Saved log from', 'error-log-viewer')), 'date' => $date, 'size' => rrrlgvwr_file_size(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'saved_logs' . DIRECTORY_SEPARATOR . $name)); } $saved_logs->rrrlgvwr_saved_file = $saved_logs_data; $saved_logs->prepare_items(); if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $rrrlgvwr_options = $rrrlgvwr_options_default; update_option('rrrlgvwr_options', $rrrlgvwr_options); $message = __('All plugin settings were restored.', 'error-log-viewer'); } ?> <div class="wrap"> <h1><?php _e('Error Log Viewer Settings', 'error-log-viewer'); ?> </h1> <?php if ($rrrlgvwr_options['count_visible_log'] != 0) { ?> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (isset($_GET['tab']) && 'logmonitor' == $_GET['tab'] || !isset($_GET['tab'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=rrrlgvwr.php&tab=logmonitor"><?php _e('Log monitor', 'error-log-viewer'); ?> </a> <a class="nav-tab<?php if (isset($_GET['tab']) && 'settings' == $_GET['tab'] || !isset($_GET['tab']) && $rrrlgvwr_options['count_visible_log'] == 0) { echo ' nav-tab-active'; } ?> " href="admin.php?page=rrrlgvwr.php&tab=settings"><?php _e('Settings', 'error-log-viewer'); ?> </a> </h2> <?php } bws_show_settings_notice(); ?> <div class="updated fade below-h2" <?php if (empty($message) || "" != $error) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <div class="error below-h2" <?php if ("" == $error) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $error; ?> </strong></p></div> <?php if (!isset($_GET['tab']) && $rrrlgvwr_options['count_visible_log'] == 0 || isset($_GET['tab']) && 'settings' == $_GET['tab']) { if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } else { ?> <form class="bws_form" method="post" action="admin.php?page=rrrlgvwr.php&tab=settings"> <h3 class="title"><?php _e('PHP Error Log', 'error-log-viewer'); ?> </h3> <?php if ($error_logging_enabled && !empty($php_error_path) && is_readable($php_error_path)) { ?> <table class="form-table"> <tr valign="top"> <th scope="row" class="th-full"> <label for="rrrlgvwr-php-visible"> <input type="checkbox" name="rrrlgvwr_php_visible" id="rrrlgvwr-php-visible" <?php if (isset($rrrlgvwr_options['php_error_log_visible']) && $rrrlgvwr_options['php_error_log_visible'] == 1) { echo 'checked="checked"'; } ?> /> <?php echo esc_html($php_error_log_name); ?> </label> </td> <td><?php echo $php_error_mes; ?> </td> <?php if (file_exists($php_error_path)) { ?> <td> <?php if (filesize($php_error_path) == 0) { _e('The file is empty', 'error-log-viewer'); } else { echo rrrlgvwr_file_size($php_error_path); } ?> </td> <td> <?php _e('Last update', 'error-log-viewer'); echo ': ' . date('Y-m-d H:i:s', filemtime($php_error_path)); ?> </td> <?php } ?> </tr> </table> <?php } else { ?> <p><?php echo $php_error_mes; ?> </p> <?php } ?> <h3 class="title"><?php _e('WordPress Error Log', 'error-log-viewer'); ?> </h3> <?php if (count($wp_error_files) == 0) { ?> <p><?php _e("Plugin didn't find log files in your Wordpress directory. You can create log file by yourself or using the plugin.", 'error-log-viewer'); ?> </p> <?php } ?> <table class="form-table"> <?php if (count($wp_error_files) == 0) { ?> <tr valign="top"> <th scope="row" class="th-full"> <span><?php _e("Error logging via '.htaccess' using 'php_flag' and 'php_value'", 'error-log-viewer'); ?> </span> </th> <td> <fieldset> <legend class="screen-reader-text"><span><?php _e("Error logging via '.htaccess' using 'php_flag' and 'php_value'", 'error-log-viewer'); ?> </span></legend> <label for="rrrlgvwr-create-htaccess"> <input type="radio" name="rrrlgvwr_create_log" id="rrrlgvwr-create-htaccess" value="htaccess" /> <?php _e("Add the following code in your '.htaccess' file and create 'php-errors.log' file in 'log' directory in the plugin folder", 'error-log-viewer'); ?> </label> <pre class="rrrlgvwr-pre"># log php errors<br>php_flag log_errors on<br>php_flag display_errors off<br>php_value error_log <?php echo dirname(__FILE__) . DIRECTORY_SEPARATOR . "log" . DIRECTORY_SEPARATOR . "php-errors.log"; ?> </pre> </fieldset> </td> </tr> <tr valign="top"> <th scope="row" class="th-full"> <span> <?php _e("Error logging via 'wp-config.php' using 'ini_set'", 'error-log-viewer'); ?> </span> </th> <td> <fieldset> <legend class="screen-reader-text"><span><?php _e("Error logging via 'wp-config.php' using 'ini_set'", 'error-log-viewer'); ?> </span></legend> <label for="rrrlgvwr-create-config-ini-set"> <input type="radio" name="rrrlgvwr_create_log" id="rrrlgvwr-create-config-ini-set" value="config_ini_set" /> <?php _e("Add the following code in the 'wp-config.php' file and create 'php-errors.log' file in 'log' directory in the plugin folder", 'error-log-viewer'); ?> </label> <pre class="rrrlgvwr-pre">@ini_set('log_errors','On');<br>@ini_set('display_errors','Off');<br>@ini_set('error-log-viewer', '<?php echo dirname(__FILE__) . DIRECTORY_SEPARATOR . "log" . DIRECTORY_SEPARATOR . "php-errors.log"; ?> ');</pre> </fieldset> </td> </tr> <tr valign="top"> <th scope="row" class="th-full"> <span> <?php _e("Error logging via 'wp-config.php' using 'WP_DEBUG'", 'error-log-viewer'); ?> </span> </th> <td> <fieldset> <legend class="screen-reader-text"><span><?php _e("Error logging via 'wp-config.php' using 'WP_DEBUG'", 'error-log-viewer'); ?> </span></legend> <label for="rrrlgvwr-create-config-debug"> <input type="radio" name="rrrlgvwr_create_log" id="rrrlgvwr-create-config-debug" value="config_debug" /> <?php _e("Add the following code in the 'wp-config.php' file and create 'debug.log' in the 'wp-content' directory", 'error-log-viewer'); ?> </label> <pre class="rrrlgvwr-pre">define('WP_DEBUG', true);<br>define('WP_DEBUG_LOG', true);<br>define('WP_DEBUG_DISPLAY', false);<br>@ini_set('display_errors', 0);</pre> </fieldset> </td> </tr> <tr valign="top"> <th scope="row" class="th-full" colspan="2"> <?php _e("Files '.htaccess' and 'wp-config.php' are very important for normal working of your site. Please save them necessarily before changes. You can create custom file for logging and edit required file by yourself. See also", 'error-log-viewer'); ?> : <a target="_blank" href="https://codex.wordpress.org/Debugging_in_WordPress"><?php _e('Debugging on WordPress', 'error-log-viewer'); ?> </a> <a target="_blank" href="https://codex.wordpress.org/Editing_wp-config.php"><?php _e('Editing', 'error-log-viewer'); ?> wp-config.php</a> </th> </tr> <?php } foreach ($wp_error_files as $key => $file) { $name = str_replace(substr($file, 0, strripos($file, '/') + 1), '', $file); $subname = substr($name, 0, strpos($name, '.')); $id = $key . '-' . $subname; $subname = $key . '_' . $subname . '_visible'; ?> <tr valign="top"> <th scope="row" class="th-full"> <label for="rrrlgvwr-<?php echo $id; ?> "> <input type="checkbox" name="<?php echo $subname; ?> " id="rrrlgvwr-<?php echo $id; ?> " <?php if (isset($rrrlgvwr_options[$subname]) && $rrrlgvwr_options[$subname] == 1) { echo 'checked="checked"'; } ?> /> <?php echo esc_html($name); ?> </label> </th> <td><?php echo $file; ?> </td> <td> <?php if (filesize($file) == 0) { _e('The file is empty', 'error-log-viewer'); } else { echo rrrlgvwr_file_size($file); } ?> </td> <td> <?php _e('Last update', 'error-log-viewer'); echo ': ' . date('Y-m-d H:i:s', filemtime($file)); ?> </td> </tr> <?php } ?> </table> <h3 class="title"><?php _e('Sending Settings', 'error-log-viewer'); ?> </h3> <table class="form-table"> <tr valign="top"> <th scope="row" class="th-full" colspan="2"> <label for="rrrlgvwr-send-email"> <input type="checkbox" name="rrrlgvwr_send_email" id="rrrlgvwr-send-email" <?php if (isset($rrrlgvwr_options['send_email']) && $rrrlgvwr_options['send_email'] == 1) { echo 'checked="checked"'; } ?> /> <?php _e('Notify about new error logs (via email)', 'error-log-viewer'); ?> </label> </th> </tr> <tr valign="top" class="rrrlgvwr-email-field"> <th scope="row"> <?php _e('Email', 'error-log-viewer'); ?> </th> <td> <fieldset> <legend class="screen-reader-text"><span><?php _e('Email', 'error-log-viewer'); ?> </span></legend> <input type="text" class="regular-text code" name="rrrlgvwr_email" id="rrrlgvwr-email" value="<?php if (isset($rrrlgvwr_options['email'])) { echo $rrrlgvwr_options['email']; } ?> " /> </fieldset> </td> </tr> <tr valign="top" class="rrrlgvwr-interval-field"> <th scope="row"><?php _e('Send every', 'error-log-viewer'); ?> </th> <td> <fieldset> <legend class="screen-reader-text"><span><?php _e('Send every', 'error-log-viewer'); ?> </span> </legend> <input type="number" class="small-text" min="1" name="rrrlgvwr_frequency_send" value="<?php echo $rrrlgvwr_options['frequency_send']; ?> " /> <select name="rrrlgvwr_hour_day"> <option value="3600" <?php if ($rrrlgvwr_options['hour_day'] == 3600) { echo 'selected="selected"'; } ?> ><?php _e('Hour', 'error-log-viewer'); ?> </option> <option value="86400" <?php if ($rrrlgvwr_options['hour_day'] == 86400) { echo 'selected="selected"'; } ?> ><?php _e('Day', 'error-log-viewer'); ?> </option> </select> </fieldset> </td> </tr> </table> <p class="submit"> <input id="bws-submit-button" type="submit" name="rrrlgvwr_settings_submit" value="<?php _e('Save Settings', 'error-log-viewer'); ?> " class="button button-primary" /> <?php wp_nonce_field($plugin_basename, 'rrrlgvwr_nonce_name'); ?> </p> </form> <?php bws_form_restore_default_settings($plugin_basename); } } elseif (!isset($_GET['tab']) || isset($_GET['tab']) && 'logmonitor' == $_GET['tab']) { ?> <form method="post" action="admin.php?page=rrrlgvwr.php&tab=logmonitor"> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('File', 'error-log-viewer'); ?> </th> <?php if (isset($rrrlgvwr_options['count_visible_log']) && $rrrlgvwr_options['count_visible_log'] > 1) { ?> <td> <fieldset> <legend class="screen-reader-text"><span><?php _e('File', 'error-log-viewer'); ?> </span></legend> <select name="rrrlgvwr_select_log"> <?php if ($rrrlgvwr_options['php_error_log_visible'] == 1) { ?> <option value="<?php echo $php_error_path; ?> "<?php if ($rrrlgvwr_options['error_log_path'] == $php_error_path) { echo 'selected="selected"'; } ?> ><?php echo $php_error_log_name; ?> </option> <?php } foreach ($wp_error_files as $key => $file) { $name = str_replace(substr($file, 0, strripos($file, '/') + 1), '', $file); $subname = substr($name, 0, strpos($name, '.')); $subname = $key . "_" . $subname . '_visible'; if ($rrrlgvwr_options[$subname] == 1) { if ($file == $php_error_path && $rrrlgvwr_options['php_error_log_visible'] == 1) { continue; } ?> <option value="<?php echo $file; ?> "<?php if ($rrrlgvwr_options['error_log_path'] == $file) { echo 'selected="selected"'; } ?> ><?php echo $name; ?> </option> <?php } } ?> </select> </fieldset> </td> <?php } elseif (isset($rrrlgvwr_options['count_visible_log']) && $rrrlgvwr_options['count_visible_log'] == 1) { ?> <td> <fieldset> <legend class="screen-reader-text"><span><?php _e('File', 'error-log-viewer'); ?> </span></legend> <span> <?php if ($rrrlgvwr_options['php_error_log_visible'] == 1) { echo $php_error_log_name; $rrrlgvwr_options['error_log_path'] = $php_error_path; update_option('rrrlgvwr_options', $rrrlgvwr_options); } else { foreach ($wp_error_files as $key => $file) { $name = str_replace(substr($file, 0, strripos($file, '/') + 1), '', $file); $subname = substr($name, 0, strpos($name, '.')); $subname = $key . "_" . $subname . '_visible'; if (isset($rrrlgvwr_options[$subname]) && $rrrlgvwr_options[$subname] == 1) { echo $name; $rrrlgvwr_options['error_log_path'] = $file; update_option('rrrlgvwr_options', $rrrlgvwr_options); } } } ?> </span> </fieldset> </td> <?php } ?> </tr> <tr valign="top"> <th scope="row"><?php _e('Show', 'error-log-viewer'); ?> </th> <td> <fieldset> <legend class="screen-reader-text"><span><?php _e('Show', 'error-log-viewer'); ?> </span></legend> <label for="rrrlgvwr-show-line"> <input type="radio" name="rrrlgvwr_show_content" id="rrrlgvwr-show-line" value="lines" checked="checked" /> <span><?php _e('last', 'error-log-viewer'); ?> </span> <input type="number" class="small-text" min="1" name="rrrlgvwr_lines_count" value="<?php echo $rrrlgvwr_options['lines_count']; ?> " /> <span><?php _e('lines', 'error-log-viewer'); ?> </span> </label><br> <label for="rrrlgvwr-show-date"> <input type="radio" name="rrrlgvwr_show_content" id="rrrlgvwr-show-date" value="date" /> <span><?php _e('log from', 'error-log-viewer'); ?> </span> <input type="text" id="rrrlgvwr-from" name="rrrlgvwr_from" /> <span class="rrrlgvwr-indent"><?php _e('to', 'error-log-viewer'); ?> </span> <input type="text" id="rrrlgvwr-to" name="rrrlgvwr_to" /> </label><br> <div class="hide-if-js rrrlgvwr-date-search-mes"> <p> <span><?php _e('JavaScript is disable on your site. To search logs by dates, please enter in the first and second field dates among which you want see the log. Your entry should look like', 'error-log-viewer'); ?> </span> <code>07/10/2015<span class="rrrlgvwr-indent"><?php _e('to', 'error-log-viewer'); ?> </span>07/19/2015.</code> <span><?php _e('The first two numbers means month, the second two numbers means day of months, the last four numbers means year', 'error-log-viewer'); ?> </span> </p> </div> <label for="rrrlgvwr-show-all"> <input type="radio" name="rrrlgvwr_show_content" id="rrrlgvwr-show-all" value="all" /> <span><?php _e('full file', 'error-log-viewer'); ?> </span> </label> <?php if (filesize($rrrlgvwr_options['error_log_path']) > 10485760) { ?> <div class="hide-if-js rrrlgvwr-date-search-mes"> <p><?php _e('File size is more than 10 Mb. Be careful to check this option', 'error-log-viewer'); ?> </p> </div> <?php } ?> </fieldset> </td> </tr> </table> <p class="submit"> <input type="submit" name="rrrlgvwr_submit_show_content" class="button button-primary" value="<?php _e('View', 'error-log-viewer'); ?> " /> <?php if (!empty($rrrlgvwr_options['error_log_path']) && $rrrlgvwr_options['error_log_path'] == $php_error_path) { ?> <span class="rrrlgvwr-indent"><?php _e('or', 'error-log-viewer'); ?> </span> <input type="submit" name="rrrlgvwr_save_content" class="button" value="<?php _e('Save as TXT file', 'error-log-viewer'); ?> " /> <?php } ?> </p> <?php if (!empty($rrrlgvwr_options['error_log_path'])) { ?> <textarea name="rrrlgvwr_newcontent" class="large-text code" rows="16" readonly="readonly"> <?php if (isset($_POST['rrrlgvwr_submit_show_content'])) { switch ($_POST['rrrlgvwr_show_content']) { case 'lines': esc_textarea(rrrlgvwr_read_last_lines($rrrlgvwr_options['error_log_path'], $rrrlgvwr_options['lines_count'])); break; case 'date': $first_date = strtotime($_POST['rrrlgvwr_from']); $last_date = strtotime($_POST['rrrlgvwr_to']); esc_textarea(rrrlgvwr_read_lines_by_date($rrrlgvwr_options['error_log_path'], $first_date, $last_date)); break; case 'all': esc_textarea(rrrlgvwr_read_full_file($rrrlgvwr_options['error_log_path'])); break; default: esc_textarea(rrrlgvwr_read_last_lines($rrrlgvwr_options['error_log_path'], $rrrlgvwr_options['lines_count'])); break; } } else { esc_textarea(rrrlgvwr_read_last_lines($rrrlgvwr_options['error_log_path'], $rrrlgvwr_options['lines_count'])); } ?> </textarea> <?php if ($rrrlgvwr_options['error_log_path'] != $php_error_path) { ?> <table class="form-table"> <tr valign="top"> <th scope="row"> <span><?php _e('File', 'error-log-viewer'); ?> </span> <a target="_blank" href="<?php echo str_replace($home_path, get_home_url(), $rrrlgvwr_options['error_log_path']); ?> "> <?php echo str_replace(substr($rrrlgvwr_options['error_log_path'], 0, strripos($rrrlgvwr_options['error_log_path'], '/') + 1), '', $rrrlgvwr_options['error_log_path']); ?> </a> <span> <?php _e('with size', 'error-log-viewer'); echo ' ' . rrrlgvwr_file_size($file); _e('Last update', 'error-log-viewer'); echo ': ' . date('Y-m-d H:i:s', filemtime($file)); ?> <span> </th> </tr> </table> <p class="submit"> <input type="submit" class="button button-primary" name="rrrlgvwr_clear_file" id="rrrlgvwr-clear-file" value="<?php _e('Clear log file', 'error-log-viewer'); ?> " /> <input type="hidden" value="<?php echo $rrrlgvwr_options['error_log_path']; ?> " name="rrrlgvwr_clear_file_name" /> </p> <?php } } wp_nonce_field($plugin_basename, 'rrrlgvwr_nonce_name'); ?> </form> <?php if (!empty($rrrlgvwr_options['error_log_path']) && $rrrlgvwr_options['error_log_path'] == $php_error_path) { ?> <h3 class="title"><?php _e('Saved log files', 'error-log-viewer'); ?> </h3> <form class="rrrlgvwr-saved-logs-table" method="post" action="admin.php?page=rrrlgvwr.php&tab=logmonitor"> <?php $saved_logs->display(); wp_nonce_field($plugin_basename, 'rrrlgvwr_nonce_name'); ?> </form> <?php } } bws_plugin_reviews_block($rrrlgvwr_plugin_info['Name'], 'error-log-viewer'); ?> </div> <?php }
function gllr_settings_page() { global $gllr_options, $wp_version, $gllr_plugin_info, $gllr_option_defaults; $error = $message = ""; $plugin_basename = plugin_basename(__FILE__); if (!function_exists('get_plugins')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $all_plugins = get_plugins(); $cstmsrch_options = get_option('cstmsrch_options'); if ($cstmsrch_options) { $option_name = 'cstmsrch_options'; } else { $cstmsrch_options = get_option('cstmsrchpr_options'); if ($cstmsrch_options) { $option_name = 'cstmsrchpr_options'; } else { $cstmsrch_options = get_option('bws_custom_search'); if ($cstmsrch_options) { $option_name = 'bws_custom_search'; } else { $cstmsrch_options = $option_name = ''; } } } /* Save data for settings page */ if (isset($_REQUEST['gllr_form_submit']) && check_admin_referer($plugin_basename, 'gllr_nonce_name')) { $gllr_request_options = array(); $gllr_request_options["gllr_custom_size_name"] = $gllr_options["gllr_custom_size_name"]; $gllr_request_options["gllr_custom_size_px"] = array(array(intval(trim($_REQUEST['gllr_custom_image_size_w_album'])), intval(trim($_REQUEST['gllr_custom_image_size_h_album']))), array(intval(trim($_REQUEST['gllr_custom_image_size_w_photo'])), intval(trim($_REQUEST['gllr_custom_image_size_h_photo'])))); $gllr_request_options["border_images"] = isset($_REQUEST['gllr_border_images']) ? 1 : 0; $gllr_request_options["border_images_width"] = intval(trim($_REQUEST['gllr_border_images_width'])); $gllr_request_options["border_images_color"] = trim($_REQUEST['gllr_border_images_color']); $gllr_request_options["custom_image_row_count"] = intval(trim($_REQUEST['gllr_custom_image_row_count'])); if ("" == $gllr_request_options["custom_image_row_count"] || 1 > $gllr_request_options["custom_image_row_count"]) { $gllr_request_options["custom_image_row_count"] = 1; } $gllr_request_options["start_slideshow"] = isset($_REQUEST['gllr_start_slideshow']) ? 1 : 0; $gllr_request_options["slideshow_interval"] = !isset($_REQUEST['gllr_slideshow_interval']) || empty($_REQUEST['gllr_slideshow_interval']) ? 2000 : intval($_REQUEST['gllr_slideshow_interval']); $gllr_request_options["single_lightbox_for_multiple_galleries"] = isset($_REQUEST['gllr_single_lightbox_for_multiple_galleries']) ? 1 : 0; $gllr_request_options["order_by"] = $_REQUEST['gllr_order_by']; $gllr_request_options["order"] = $_REQUEST['gllr_order']; $gllr_request_options["image_text"] = isset($_REQUEST['gllr_image_text']) ? 1 : 0; $gllr_request_options["return_link"] = isset($_REQUEST['gllr_return_link']) ? 1 : 0; $gllr_request_options["return_link_page"] = $_REQUEST['gllr_return_link_page']; $gllr_request_options["return_link_url"] = esc_url($_REQUEST['gllr_return_link_url']); $gllr_request_options["return_link_shortcode"] = isset($_REQUEST['gllr_return_link_shortcode']) ? 1 : 0; $gllr_request_options["return_link_text"] = stripslashes(esc_html($_REQUEST['gllr_return_link_text'])); $gllr_request_options["read_more_link_text"] = stripslashes(esc_html($_REQUEST['gllr_read_more_link_text'])); $gllr_request_options["rewrite_template"] = isset($_REQUEST['gllr_rewrite_template']) ? 1 : 0; if ($cstmsrch_options && !empty($cstmsrch_options)) { if (isset($_REQUEST['gllr_add_to_search'])) { if (!in_array('gallery', $cstmsrch_options['post_types'])) { array_push($cstmsrch_options['post_types'], 'gallery'); } } else { if (in_array('gallery', $cstmsrch_options['post_types'])) { unset($cstmsrch_options['post_types'][array_search('gallery', $cstmsrch_options['post_types'])]); } } update_option($option_name, $cstmsrch_options); } /* Array merge incase this version has added new options */ $gllr_options = array_merge($gllr_options, $gllr_request_options); /* Check select one point in the blocks Arithmetic actions and Difficulty on settings page */ update_option('gllr_options', $gllr_options); $message = __("Settings are saved", 'gallery-plugin'); } /* GO PRO */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { $go_pro_result = bws_go_pro_tab_check($plugin_basename); if (!empty($go_pro_result['error'])) { $error = $go_pro_result['error']; } } /* Display form on the setting page */ if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $gllr_options = $gllr_option_defaults; update_option('gllr_options', $gllr_options); $message = __('All plugin settings were restored.', 'gallery-plugin'); } $result = apply_filters('bws_handle_demo_data', 'gllr_plugin_upgrade', 'gllr_settings'); if (!empty($result) && is_array($result)) { $error = $result['error']; $message = $result['done']; if (!empty($result['done'])) { $gllr_options = $result['options']; } } ?> <div class="wrap"> <div class="icon32 icon32-bws" id="icon-options-general"></div> <h2><?php _e('Gallery Settings', 'gallery-plugin'); ?> </h2> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=gallery-plugin.php"><?php _e('Settings', 'gallery-plugin'); ?> </a> <a class="nav-tab" href="http://bestwebsoft.com/products/gallery/faq/" target="_blank"><?php _e('FAQ', 'gallery-plugin'); ?> </a> <a class="nav-tab bws_go_pro_tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=gallery-plugin.php&action=go_pro"><?php _e('Go PRO', 'gallery-plugin'); ?> </a> </h2> <div id="gllr_settings_message" class="updated fade" <?php if ("" == $message) { echo 'style="display:none"'; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <div class="error" <?php if ("" == $error) { echo 'style="display:none"'; } ?> ><p><strong><?php echo $error; ?> </strong></p></div> <?php if (!isset($_GET['action'])) { if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } elseif (isset($_POST['bws_handle_demo']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_demo_confirm(); } else { ?> <noscript><div class="error"><p><?php _e('Please enable JavaScript to use the option to renew images.', 'gallery-plugin'); ?> </p></div></noscript> <?php bws_show_settings_notice(); ?> <p><?php _e("If you would like to add a Single Gallery to your page or post, just copy and paste this shortcode into your post or page:", 'gallery-plugin'); ?> <span class="bws_code">[print_gllr id=Your_gallery_post_id]</span> </p> <table class="form-table hide-if-no-js"> <tr valign="top"> <th scope="row"><?php _e('Update images for gallery', 'gallery-plugin'); ?> </th> <td style="position:relative"> <input type="button" value="<?php _e('Update images', 'gallery-plugin'); ?> " id="gllr_ajax_update_images" name="ajax_update_images" class="button" /> <div id="gllr_img_loader"><img src="<?php echo plugins_url('images/ajax-loader.gif', __FILE__); ?> " alt="loader" /></div> </td> </tr> </table> <br/> <form class="bws_form" method="post" action="admin.php?page=gallery-plugin.php"> <table class="form-table"> <tr valign="top" class="gllr_width_labels"> <th scope="row"><?php _e('Image size for the album cover', 'gallery-plugin'); ?> </th> <td> <label><?php _e('Image size', 'gallery-plugin'); ?> <?php echo $gllr_options["gllr_custom_size_name"][0]; ?> </label><br /> <label> <input type="number" name="gllr_custom_image_size_w_album" min="1" max="10000" value="<?php echo $gllr_options["gllr_custom_size_px"][0][0]; ?> " /> <?php _e('Width (in px)', 'gallery-plugin'); ?> </label><br /> <label> <input type="number" name="gllr_custom_image_size_h_album" min="1" max="10000" value="<?php echo $gllr_options["gllr_custom_size_px"][0][1]; ?> " /> <?php _e('Height (in px)', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top" class="gllr_width_labels"> <th scope="row"><?php _e('Image size for thumbnails', 'gallery-plugin'); ?> </th> <td> <label><?php _e('Image size', 'gallery-plugin'); ?> <?php echo $gllr_options["gllr_custom_size_name"][1]; ?> </label><br /> <label> <input type="number" name="gllr_custom_image_size_w_photo" min="1" max="10000" value="<?php echo $gllr_options["gllr_custom_size_px"][1][0]; ?> " /> <?php _e('Width (in px)', 'gallery-plugin'); ?> </label><br /> <label> <input type="number" name="gllr_custom_image_size_h_photo" min="1" max="10000" value="<?php echo $gllr_options["gllr_custom_size_px"][1][1]; ?> " /> <?php _e('Height (in px)', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top"> <td colspan="2"><span class="bws_info"><?php _e('WordPress will create a new thumbnail with the specified dimensions when you upload a new photo.', 'gallery-plugin'); ?> </span></td> </tr> </table> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top" class="gllr_width_labels"> <th scope="row"><?php _e('Image size in the lightbox', 'gallery-plugin'); ?> </th> <td> <label><?php _e('Image size', 'gallery-plugin'); ?> full-photo</label><br /> <label><input disabled class="gllrprfssnl_size_photo_full" type="number" name="gllrprfssnl_custom_image_size_w_full" value="1024" /> <?php _e('Max width (in px)', 'gallery-plugin'); ?> </label><br /> <label><input disabled class="gllrprfssnl_size_photo_full" type="number" name="gllrprfssnl_custom_image_size_h_full" value="1024" /> <?php _e('Max height (in px)', 'gallery-plugin'); ?> </label><br /> <input disabled type="checkbox" name="gllrprfssnl_size_photo_full" value="1" /> <?php _e('Display a full size image in the lightbox', 'gallery-plugin'); ?> </td> </tr> <tr valign="top" class="gllr_width_labels"> <th scope="row"><?php _e('Crop position', 'gallery-plugin'); ?> </th> <td> <label> <select disabled> <option value="center"><?php _e('center', 'gallery-plugin'); ?> </option> </select> <?php _e('Horizontal', 'gallery-plugin'); ?> </label><br /> <label> <select disabled> <option value="center"><?php _e('center', 'gallery-plugin'); ?> </option> </select> <?php _e('Vertical', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Lightbox background', 'gallery-plugin'); ?> </th> <td> <input disabled class="button button-small gllrprfssnl_lightbox_default" type="button" value="<?php _e('Default', 'gallery-plugin'); ?> "> <br /> <input disabled type="text" size="8" value="0.7" name="gllrprfssnl_background_lightbox_opacity" /> <?php _e('Background transparency (from 0 to 1)', 'gallery-plugin'); ?> <br /> <label><input disabled id="gllrprfssnl_background_lightbox_color" type="minicolors" name="gllrprfssnl_background_lightbox_color" value="#777777" id="gllrprfssnl_background_lightbox_color" /> <?php _e('Select a background color', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top"> <th scope="row" colspan="2"> * <?php _e('If you upgrade to Pro version all your settings and galleries will be saved.', 'gallery-plugin'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'gallery-plugin'); ?> </div> <div class="bws_pro_links"> <span class="bws_trial_info"> <a href="http://bestwebsoft.com/products/gallery/trial/?k=63a36f6bf5de0726ad6a43a165f38fe5&pn=79&v=<?php echo $gllr_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Gallery Pro Plugin"><?php _e('Start Your Trial', 'gallery-plugin'); ?> </a> <?php _e('or', 'gallery-plugin'); ?> </span> <a class="bws_button" href="http://bestwebsoft.com/products/gallery/?k=63a36f6bf5de0726ad6a43a165f38fe5&pn=79&v=<?php echo $gllr_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Gallery Pro Plugin"><?php _e('Learn More', 'gallery-plugin'); ?> </a> </div> <div class="gllr_clear"></div> </div> </div> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Images with border', 'gallery-plugin'); ?> </th> <td> <input type="checkbox" name="gllr_border_images" value="1" <?php if (1 == $gllr_options["border_images"]) { echo 'checked="checked"'; } ?> /><br /> <input type="number" min="0" max="10000" value="<?php echo $gllr_options["border_images_width"]; ?> " name="gllr_border_images_width" /> <?php _e('Border width in px, just numbers', 'gallery-plugin'); ?> <br /> <label><input type="minicolors" name="gllr_border_images_color" maxlength="7" value="<?php echo $gllr_options["border_images_color"]; ?> " id="gllr_border_images_color" /> <?php _e('Select a border color', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Number of images in the row', 'gallery-plugin'); ?> </th> <td> <input type="number" name="gllr_custom_image_row_count" min="1" max="10000" value="<?php echo $gllr_options["custom_image_row_count"]; ?> " /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Start slideshow', 'gallery-plugin'); ?> </th> <td> <input type="checkbox" name="gllr_start_slideshow" value="1" <?php if (1 == $gllr_options["start_slideshow"]) { echo 'checked="checked"'; } ?> /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Slideshow interval', 'gallery-plugin'); ?> </th> <td> <input type="number" name="gllr_slideshow_interval" min="1" max="1000000" value="<?php echo $gllr_options["slideshow_interval"]; ?> " /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Use single lightbox for multiple galleries on one page', 'gallery-plugin'); ?> </th> <td> <input type="checkbox" name="gllr_single_lightbox_for_multiple_galleries" value="1" <?php if (1 == $gllr_options["single_lightbox_for_multiple_galleries"]) { echo 'checked="checked"'; } ?> /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Sort images by', 'gallery-plugin'); ?> </th> <td> <label class="label_radio"><input type="radio" name="gllr_order_by" value="ID" <?php if ('ID' == $gllr_options["order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('Attachment ID', 'gallery-plugin'); ?> </label><br /> <label class="label_radio"><input type="radio" name="gllr_order_by" value="title" <?php if ('title' == $gllr_options["order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('Image Name', 'gallery-plugin'); ?> </label><br /> <label class="label_radio"><input type="radio" name="gllr_order_by" value="date" <?php if ('date' == $gllr_options["order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('Date', 'gallery-plugin'); ?> </label><br /> <label class="label_radio"><input type="radio" name="gllr_order_by" value="meta_value_num" <?php if ('meta_value_num' == $gllr_options["order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('Sorting order in the Gallery', 'gallery-plugin'); ?> </label><br /> <label class="label_radio"><input type="radio" name="gllr_order_by" value="rand" <?php if ('rand' == $gllr_options["order_by"]) { echo 'checked="checked"'; } ?> /> <?php _e('Random', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Sort images', 'gallery-plugin'); ?> </th> <td> <label class="label_radio"><input type="radio" name="gllr_order" value="ASC" <?php if ('ASC' == $gllr_options["order"]) { echo 'checked="checked"'; } ?> /> <?php _e('ASC (ascending order from lowest to highest values - 1, 2, 3; a, b, c)', 'gallery-plugin'); ?> </label><br /> <label class="label_radio"><input type="radio" name="gllr_order" value="DESC" <?php if ('DESC' == $gllr_options["order"]) { echo 'checked="checked"'; } ?> /> <?php _e('DESC (descending order from highest to lowest values - 3, 2, 1; c, b, a)', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Display text under the image', 'gallery-plugin'); ?> </th> <td> <label><input type="checkbox" name="gllr_image_text" value="1" <?php if (1 == $gllr_options["image_text"]) { echo 'checked="checked"'; } ?> /> <?php _e('Turn off the checkbox, if you want to display text just in a lightbox', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Display the Back link', 'gallery-plugin'); ?> </th> <td> <input type="checkbox" name="gllr_return_link" value="1" <?php if (1 == $gllr_options["return_link"]) { echo 'checked="checked"'; } ?> /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Display the Back link in the shortcode', 'gallery-plugin'); ?> </th> <td> <input type="checkbox" name="gllr_return_link_shortcode" value="1" <?php if (1 == $gllr_options["return_link_shortcode"]) { echo 'checked="checked"'; } ?> /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('The Back link text', 'gallery-plugin'); ?> </th> <td> <input type="text" name="gllr_return_link_text" maxlength="250" value="<?php echo $gllr_options["return_link_text"]; ?> " style="width:200px;" /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('The Back link URL', 'gallery-plugin'); ?> </th> <td> <label><input type="radio" value="gallery_template_url" name="gllr_return_link_page" <?php if ('gallery_template_url' == $gllr_options["return_link_page"]) { echo 'checked="checked"'; } ?> /><?php _e('Gallery page (Page with Gallery Template)', 'gallery-plugin'); ?> </label><br /> <label><input type="radio" maxlength="250" value="custom_url" name="gllr_return_link_page" id="gllr_return_link_url" <?php if ('custom_url' == $gllr_options["return_link_page"]) { echo 'checked="checked"'; } ?> /> <input type="text" onfocus="document.getElementById('gllr_return_link_url').checked = true;" value="<?php echo $gllr_options["return_link_url"]; ?> " name="gllr_return_link_url" /> <?php _e('(Full URL to custom page)', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('The Read More link text', 'gallery-plugin'); ?> </th> <td> <input type="text" name="gllr_read_more_link_text" maxlength="250" value="<?php echo $gllr_options["read_more_link_text"]; ?> " style="width:200px;" /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Add gallery to the search', 'gallery-plugin'); ?> </th> <td> <?php if (array_key_exists('custom-search-plugin/custom-search-plugin.php', $all_plugins) || array_key_exists('custom-search-pro/custom-search-pro.php', $all_plugins)) { if (is_plugin_active('custom-search-plugin/custom-search-plugin.php') || is_plugin_active('custom-search-pro/custom-search-pro.php')) { ?> <input type="checkbox" name="gllr_add_to_search" value="1" <?php if (in_array('gallery', $cstmsrch_options['post_types'])) { echo 'checked="checked"'; } ?> /> <span class="bws_info"> (<?php _e('Using', 'gallery-plugin'); ?> Custom Search <?php _e('powered by', 'gallery-plugin'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>)</span> <?php } else { ?> <input disabled="disabled" type="checkbox" name="gllr_add_to_search" value="1" <?php if (in_array('gallery', $cstmsrch_options['post_types'])) { echo 'checked="checked"'; } ?> /> <span class="bws_info">(<?php _e('Using', 'gallery-plugin'); ?> Custom Search <?php _e('powered by', 'gallery-plugin'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php _e('Activate', 'gallery-plugin'); ?> Custom Search</a></span> <?php } } else { ?> <input disabled="disabled" type="checkbox" name="gllr_add_to_search" value="1" /> <span class="bws_info">(<?php _e('Using', 'gallery-plugin'); ?> Custom Search <?php _e('powered by', 'gallery-plugin'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="http://bestwebsoft.com/products/custom-search/"><?php _e('Download', 'gallery-plugin'); ?> Custom Search</a></span> <?php } ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Rewrite templates after update', 'gallery-plugin'); ?> </th> <td> <input type="checkbox" name="gllr_rewrite_template" value="1" <?php if (1 == $gllr_options['rewrite_template']) { echo 'checked="checked"'; } ?> /> <span class="bws_info"><?php printf(__("Turn off the checkbox, if You edited the file '%s' or '%s' file in your theme folder and You don't want to rewrite them", 'gallery-plugin'), 'gallery-template.php', 'gallery-single-template.php'); ?> </span> </td> </tr> </table> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top" class="gllr_width_labels"> <th scope="row"><?php _e('Use pagination for images', 'gallery-plugin'); ?> </th> <td> <input disabled type="checkbox" name="gllrprfssnl_images_pagination" value="1" /><br /> <label><input disabled type="number" name="gllrprfssnl_images_per_page" value="" /> <?php _e('per page', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top" class="gllr_width_labels"> <th scope="row"><?php _e('The lightbox helper', 'gallery-plugin'); ?> </th> <td> <label><input disabled type="radio" name="gllrprfssnl_fancybox_helper" value="none" /> <?php _e('Do not use', 'gallery-plugin'); ?> </label><br /> <label><input disabled type="radio" name="gllrprfssnl_fancybox_helper" value="button" /> <?php _e('Button helper', 'gallery-plugin'); ?> </label><br /> <label><input disabled type="radio" name="gllrprfssnl_fancybox_helper" value="thumbnail" /> <?php _e('Thumbnail helper', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top" class="gllr_width_labels"> <th scope="row"><?php _e('Display Like buttons in the lightbox', 'gallery-plugin'); ?> </th> <td> <label><input disabled type="checkbox" name="gllrprfssnl_like_button_fb" value="1" /> <?php _e('FaceBook', 'gallery-plugin'); ?> </label><br /> <label><input disabled type="checkbox" name="gllrprfssnl_like_button_twit" value="1" /> <?php _e('Twitter', 'gallery-plugin'); ?> </label><br /> <label><input disabled type="checkbox" name="gllrprfssnl_like_button_pint" value="1" /> <?php _e('Pinterest', 'gallery-plugin'); ?> </label><br /> <label><input disabled type="checkbox" name="gllrprfssnl_like_button_g_plusone" value="1" /> <?php _e('Google +1', 'gallery-plugin'); ?> </label> </td> </tr> <tr valign="top" class="gllr_width_labels"> <th scope="row"><?php _e('Slug for gallery item', 'gallery-plugin'); ?> </th> <td> <input type="text" name="gllrprfssnl_slug" value="gallery" disabled /> <span class="bws_info"><?php _e('for any structure of permalinks except the default structure', 'gallery-plugin'); ?> </span> </td </tr> <tr valign="top"> <th scope="row"><?php _e('Title for lightbox button', 'gallery-plugin'); ?> </th> <td> <input type="text" name="gllrprfssnl_lightbox_button_text" disabled value="" /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Display all images in the lightbox instead of going into a single gallery', 'gallery-plugin'); ?> </th> <td> <input type="checkbox" name="gllrpr_hide_single_gallery" value="1" disabled /> <span class="bws_info">(<?php printf(__('When using the gallery template or a shortcode with `%s` parameter', 'gallery-plugin'), 'display=short'); ?> )</span> </td> </tr> <tr valign="top"> <th scope="row" colspan="2"> * <?php _e('If you upgrade to Pro version all your settings and galleries will be saved.', 'gallery-plugin'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'gallery-plugin'); ?> </div> <div class="bws_pro_links"> <span class="bws_trial_info"> <a href="http://bestwebsoft.com/products/gallery/trial/?k=63a36f6bf5de0726ad6a43a165f38fe5&pn=79&v=<?php echo $gllr_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Gallery Pro Plugin"><?php _e('Start Your Trial', 'gallery-plugin'); ?> </a> <?php _e('or', 'gallery-plugin'); ?> </span> <a class="bws_button" href="http://bestwebsoft.com/products/gallery/?k=63a36f6bf5de0726ad6a43a165f38fe5&pn=79&v=<?php echo $gllr_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Gallery Pro Plugin"><?php _e('Learn More', 'gallery-plugin'); ?> </a> </div> <div class="gllr_clear"></div> </div> </div> <input type="hidden" name="gllr_form_submit" value="submit" /> <p class="submit"> <input id="bws-submit-button" type="submit" class="button-primary" value="<?php _e('Save Changes', 'gallery-plugin'); ?> " /> </p> <?php wp_nonce_field($plugin_basename, 'gllr_nonce_name'); ?> </form> <?php do_action('bws_show_demo_button'); bws_form_restore_default_settings($plugin_basename); } } elseif ('go_pro' == $_GET['action']) { bws_go_pro_tab($gllr_plugin_info, $plugin_basename, 'gallery-plugin.php', 'gallery-plugin-pro.php', 'gallery-plugin-pro/gallery-plugin-pro.php', 'gallery', '63a36f6bf5de0726ad6a43a165f38fe5', '79', isset($go_pro_result['pro_plugin_is_activated']), '7'); } bws_plugin_reviews_block($gllr_plugin_info['Name'], 'gallery-plugin'); ?> </div> <?php }
function pplrpsts_settings_page() { global $pplrpsts_options, $pplrpsts_plugin_info, $pplrpsts_options_defaults; $error = $message = ""; /* Save data for settings page */ if (isset($_REQUEST['pplrpsts_form_submit']) && check_admin_referer(plugin_basename(__FILE__), 'pplrpsts_nonce_name')) { $pplrpsts_options['widget_title'] = !empty($_POST['pplrpsts_widget_title']) ? stripslashes(esc_html($_POST['pplrpsts_widget_title'])) : null; $pplrpsts_options['count'] = !empty($_POST['pplrpsts_count']) ? intval($_POST['pplrpsts_count']) : 2; $pplrpsts_options['excerpt_length'] = !empty($_POST['pplrpsts_excerpt_length']) ? intval($_POST['pplrpsts_excerpt_length']) : 10; $pplrpsts_options['excerpt_more'] = !empty($_POST['pplrpsts_excerpt_more']) ? stripslashes(esc_html($_POST['pplrpsts_excerpt_more'])) : '...'; if (!empty($_POST['pplrpsts_no_preview_img']) && pplrpsts_is_200($_POST['pplrpsts_no_preview_img']) && getimagesize($_POST['pplrpsts_no_preview_img'])) { $pplrpsts_options['no_preview_img'] = $_POST['pplrpsts_no_preview_img']; } else { $pplrpsts_options['no_preview_img'] = plugins_url('images/no_preview.jpg', __FILE__); } $pplrpsts_options['order_by'] = !empty($_POST['pplrpsts_order_by']) ? $_POST['pplrpsts_order_by'] : 'comment_count'; if ("" == $error) { /* Update options in the database */ update_option('pplrpsts_options', $pplrpsts_options); $message = __("Settings saved.", 'bws-popular-posts'); } } /* Add restore function */ if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer(plugin_basename(__FILE__), 'bws_settings_nonce_name')) { $pplrpsts_options = $pplrpsts_options_defaults; update_option('pplrpsts_options', $pplrpsts_options); $message = __('All plugin settings were restored.', 'bws-popular-posts'); } /* end */ /* Display form on the setting page */ ?> <div class="wrap"> <h1><?php _e('Popular Posts Settings', 'bws-popular-posts'); ?> </h1> <?php bws_show_settings_notice(); ?> <div class="updated fade" <?php if ($message == "" || "" != $error) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <div class="error" <?php if ("" == $error) { echo "style=\"display:none\""; } ?> ><p><?php echo $error; ?> </p></div> <?php if (!isset($_GET['action'])) { if (isset($_REQUEST['bws_restore_default']) && check_admin_referer(plugin_basename(__FILE__), 'bws_settings_nonce_name')) { bws_form_restore_default_confirm(plugin_basename(__FILE__)); } else { ?> <form class="bws_form" method="post" action="admin.php?page=popular-posts.php"> <p><?php _e('If you would like to display popular posts with a widget, you need to add the widget "Popular Posts Widget" in the Widgets tab.', 'bws-popular-posts'); ?> </p> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Widget title', 'bws-popular-posts'); ?> </th> <td> <input name="pplrpsts_widget_title" type="text" maxlength="250" value="<?php echo $pplrpsts_options['widget_title']; ?> "/> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Number of posts', 'bws-popular-posts'); ?> </th> <td> <input name="pplrpsts_count" type="number" min="1" max="10000" value="<?php echo $pplrpsts_options['count']; ?> "/> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Excerpt length', 'bws-popular-posts'); ?> </th> <td> <input name="pplrpsts_excerpt_length" type="number" min="1" max="10000" value="<?php echo $pplrpsts_options['excerpt_length']; ?> "/> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('"Read more" text', 'bws-popular-posts'); ?> </th> <td> <input name="pplrpsts_excerpt_more" type="text" maxlength="250" value="<?php echo $pplrpsts_options['excerpt_more']; ?> "/> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Default image (full URL), if no featured image is available', 'bws-popular-posts'); ?> </th> <td> <input name="pplrpsts_no_preview_img" type="text" maxlength="250" value="<?php echo $pplrpsts_options['no_preview_img']; ?> "/> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Order by number of', 'bws-popular-posts'); ?> </th> <td><fieldset> <label><input name="pplrpsts_order_by" type="radio" value="comment_count" <?php if ('comment_count' == $pplrpsts_options['order_by']) { echo 'checked="checked"'; } ?> /> <?php _e('comments', 'bws-popular-posts'); ?> </label><br /> <label><input name="pplrpsts_order_by" type="radio" value="views_count" <?php if ('views_count' == $pplrpsts_options['order_by']) { echo 'checked="checked"'; } ?> /> <?php _e('views', 'bws-popular-posts'); ?> </label> </fieldset></td> </tr> </table> <p class="submit"> <input id="bws-submit-button" type="submit" class="button-primary" value="<?php _e('Save Changes', 'bws-popular-posts'); ?> " /> <input type="hidden" name="pplrpsts_form_submit" value="submit" /> <?php wp_nonce_field(plugin_basename(__FILE__), 'pplrpsts_nonce_name'); ?> </p> </form> <?php bws_form_restore_default_settings(plugin_basename(__FILE__)); } } bws_plugin_reviews_block($pplrpsts_plugin_info["Name"], 'bws-popular-posts'); ?> </div> <?php }
function pgntn_settings_page() { global $pgntn_options, $pgntn_plugin_info, $title, $pgntn_option_defaults; $message = $error = ""; $array_classes = array(); if (isset($_REQUEST['pgntn_form_submit']) && check_admin_referer(plugin_basename(__FILE__), 'pgntn_nonce_name')) { /* Takes all the changed settings on the plugin's admin page and saves them in array 'pgntn_options'. */ if (isset($_REQUEST['pgntn_where_display'])) { $pgntn_options['where_display'] = array(); foreach ($_REQUEST['pgntn_where_display'] as $pgntn_position) { $pgntn_options['where_display'][] = $pgntn_position; } } else { $pgntn_options['where_display'] = array(); } if (isset($_REQUEST['pgntn_display_standard_pagination'])) { $pgntn_options['display_standard_pagination'] = array(); foreach ($_REQUEST['pgntn_display_standard_pagination'] as $pgntn_position) { $pgntn_options['display_standard_pagination'][] = $pgntn_position; } } else { $pgntn_options['display_standard_pagination'] = array(); } $pgntn_options['loop_position'] = isset($_REQUEST['pgntn_loop_position']) ? $_REQUEST['pgntn_loop_position'] : 'bottom'; $pgntn_options['display_count_page'] = isset($_REQUEST['pgntn_display_count_page']) ? intval($_REQUEST['pgntn_display_count_page']) : $pgntn_options['display_count_page']; $pgntn_options['display_info'] = isset($_REQUEST['pgntn_display_info']) ? 1 : 0; $pgntn_options['display_next_prev'] = isset($_REQUEST['pgntn_display_next_prev']) ? 1 : 0; $pgntn_options['prev_text'] = isset($_REQUEST['pgntn_prev_text']) ? stripslashes(esc_html($_REQUEST['pgntn_prev_text'])) : $pgntn_options['prev_text']; $pgntn_options['next_text'] = isset($_REQUEST['pgntn_next_text']) ? stripslashes(esc_html($_REQUEST['pgntn_next_text'])) : $pgntn_options['next_text']; $pgntn_options['show_all'] = isset($_REQUEST['pgntn_show_all']) ? intval($_REQUEST['pgntn_show_all']) : 0; $pgntn_options['width'] = isset($_REQUEST['pgntn_width']) ? intval($_REQUEST['pgntn_width']) : $pgntn_options['width']; $pgntn_options['align'] = isset($_REQUEST['pgntn_align']) ? $_REQUEST['pgntn_align'] : $pgntn_options['align']; $pgntn_options['background_color'] = isset($_REQUEST['pgntn_background_color']) ? stripslashes(esc_html($_REQUEST['pgntn_background_color'])) : $pgntn_options['background_color']; $pgntn_options['current_background_color'] = isset($_REQUEST['pgntn_current_background_color']) ? stripslashes(esc_html($_REQUEST['pgntn_current_background_color'])) : $pgntn_options['current_background_color']; $pgntn_options['text_color'] = isset($_REQUEST['pgntn_text_color']) ? stripslashes(esc_html($_REQUEST['pgntn_text_color'])) : $pgntn_options['text_color']; $pgntn_options['current_text_color'] = isset($_REQUEST['pgntn_current_text_color']) ? stripslashes(esc_html($_REQUEST['pgntn_current_text_color'])) : $pgntn_options['current_text_color']; $pgntn_options['border_color'] = isset($_REQUEST['pgntn_border_color']) ? stripslashes(esc_html($_REQUEST['pgntn_border_color'])) : $pgntn_options['border_color']; $pgntn_options['border_width'] = isset($_REQUEST['pgntn_border_width']) ? intval($_REQUEST['pgntn_border_width']) : $pgntn_options['border_width']; $pgntn_options['border_radius'] = isset($_REQUEST['pgntn_border_radius']) ? intval($_REQUEST['pgntn_border_radius']) : $pgntn_options['border_radius']; $pgntn_options['additional_pagination_style'] = isset($_REQUEST['pgntn_additional_pagination_style']) ? stripslashes(esc_html($_REQUEST['pgntn_additional_pagination_style'])) : $pgntn_options['additional_pagination_style']; $pgntn_options['display_custom_pagination'] = isset($_REQUEST['pgntn_display_custom_pagination']) ? 1 : 0; $pgntn_options['margin_left'] = isset($_REQUEST['pgntn_margin_left']) ? intval($_REQUEST['pgntn_margin_left']) : $pgntn_options['margin_left']; $pgntn_options['margin_right'] = isset($_REQUEST['pgntn_margin_right']) ? intval($_REQUEST['pgntn_margin_right']) : $pgntn_options['margin_right']; update_option('pgntn_options', $pgntn_options); $message = __('Settings saved.', 'pagination'); } /* Add restore function */ if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer(plugin_basename(__FILE__), 'bws_settings_nonce_name')) { $pgntn_options = $pgntn_option_defaults; update_option('pgntn_options', $pgntn_options); $message = __('All plugin settings were restored.', 'pagination'); } ?> <div class="wrap" id="pgntn_settings_page"> <h2><?php echo $title; ?> </h2> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=pagination.php"><?php _e('Settings', 'pagination'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'appearance' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=pagination.php&action=appearance"><?php _e('Appearance', 'pagination'); ?> </a> </h2> <div class="updated fade" <?php if ('' == $message || $error != "") { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <?php if (isset($_REQUEST['bws_restore_default']) && check_admin_referer(plugin_basename(__FILE__), 'bws_settings_nonce_name')) { bws_form_restore_default_confirm(plugin_basename(__FILE__)); } else { ?> <?php bws_show_settings_notice(); ?> <div id="pgntn_empty_page_type" class="updated"<?php if (!empty($pgntn_options['where_display']) || isset($_GET['action']) && 'appearance' == $_GET['action']) { echo ' style="display: none;"'; } ?> > <p><strong><?php _e("Notice:", 'pagination'); ?> </strong> <?php _e('Choose some page types to display plugin`s pagination in frontend of your site.', 'pagination'); ?> </p> </div> <div class="error"<?php if (empty($error)) { echo " style=\"display:none\""; } ?> ><p><strong><?php echo $error; ?> </strong></p></div> <div<?php if (isset($_GET['action']) && 'appearance' == $_GET['action']) { echo ' style="display: none;"'; } ?> > <p><?php _e('If you would like to display pagination block in a different place on your site, add the following strings into the file', 'pagination'); ?> <i>index.php</i> <?php _e('of your theme', 'pagination'); ?> :<br /> <code>if ( function_exists( 'pgntn_display_pagination' ) ) pgntn_display_pagination( 'posts' );</code><br/> <?php _e('Also you can display pagination block for paginated posts or pages. Add the following strings into to the appropriate templates source code of your theme', 'pagination'); ?> :<br /> <code>if ( function_exists( 'pgntn_display_pagination' ) ) pgntn_display_pagination( 'multipage' );</code><br/> <?php _e('Paste this into the comments template if you want to display pagination for comments', 'pagination'); ?> :<br> <code>if ( function_exists( 'pgntn_display_pagination' ) ) pgntn_display_pagination( 'comments' );</code> </p> </div> <form class="bws_form" method="post" action=""> <div<?php if (isset($_GET['action']) && 'appearance' == $_GET['action']) { echo ' style="display: none;"'; } ?> > <table class="form-table"><!-- main settings --> <tr> <th scope="row"><?php _e('Display pagination', 'pagination'); ?> </th> <td> <input type="checkbox" id="pgntn_everywhere" value="everywhere" name="pgntn_where_display[]"<?php if (in_array('everywhere', $pgntn_options['where_display'])) { echo ' checked="checked"'; } ?> /><label for="pgntn_everywhere"><strong><?php _e('everywhere', 'pagination'); ?> </strong></label><br /> <input type="checkbox" id="pgntn_on_home" class="pgntn_where_display" value="home" name="pgntn_where_display[]"<?php if (in_array('everywhere', $pgntn_options['where_display']) || in_array('home', $pgntn_options['where_display'])) { echo ' checked="checked"'; } ?> /><label for="pgntn_on_home"><?php _e('on home page', 'pagination'); ?> </label><br /> <input type="checkbox" id="pgntn_on_blog" class="pgntn_where_display" value="blog" name="pgntn_where_display[]"<?php if (in_array('everywhere', $pgntn_options['where_display']) || in_array('blog', $pgntn_options['where_display'])) { echo ' checked="checked"'; } ?> /><label for="pgntn_on_blog"><?php _e('on blog page', 'pagination'); ?> </label><br /> <input type="checkbox" id="pgntn_on_archives" class="pgntn_where_display" value="archives" name="pgntn_where_display[]"<?php if (in_array('everywhere', $pgntn_options['where_display']) || in_array('archives', $pgntn_options['where_display'])) { echo ' checked="checked"'; } ?> /><label for="pgntn_on_archives"><?php _e('on archive pages ( by categories, date, tags etc. )', 'pagination'); ?> </label><br /> <input type="checkbox" id="pgntn_on_search" class="pgntn_where_display" value="search" name="pgntn_where_display[]"<?php if (in_array('everywhere', $pgntn_options['where_display']) || in_array('search', $pgntn_options['where_display'])) { echo ' checked="checked"'; } ?> /><label for="pgntn_on_search"><?php _e('on search results page', 'pagination'); ?> </label><br /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Pagination position', 'pagination'); ?> </th> <td> <select name="pgntn_loop_position"> <option value="top"<?php echo "top" == $pgntn_options['loop_position'] ? ' selected="selected"' : ""; ?> ><?php _e('above the main content', 'pagination'); ?> </option> <option value="bottom"<?php echo "bottom" == $pgntn_options['loop_position'] ? ' selected="selected"' : ""; ?> ><?php _e('below the main content', 'pagination'); ?> </option> <option value="both"<?php echo "both" == $pgntn_options['loop_position'] ? ' selected="selected"' : ""; ?> ><?php _e('above and below the main content', 'pagination'); ?> </option> <option value="function"<?php echo "function" == $pgntn_options['loop_position'] ? ' selected="selected"' : ""; ?> ><?php _e('via function only', 'pagination'); ?> </option> <select> </td> </tr><!-- .pgntn_nav_position --> <tr> <th scope="row"><label for ="pgntn_display_info"><?php _e("Display 'Page __ of __' block", 'pagination'); ?> </label></th> <td> <input type="checkbox" value="1" id="pgntn_display_info" name="pgntn_display_info"<?php echo 1 == $pgntn_options['display_info'] ? ' checked="checked"' : ''; ?> /> </td> </tr> <tr> <th scope="row"><label for ="pgntn_display_next_prev"><?php _e('Display Next/Previous arrows', 'pagination'); ?> </label></th> <td> <input type="checkbox" value="1" id="pgntn_display_next_prev" name="pgntn_display_next_prev"<?php echo 1 == $pgntn_options['display_next_prev'] ? ' checked="checked"' : ''; ?> /> <div class="pgntn_links_text"> <input type="text" maxlength='250' value="<?php echo $pgntn_options['prev_text']; ?> "<?php echo 0 == $pgntn_options['display_next_prev'] ? 'disabled="disabled"' : ''; ?> name="pgntn_prev_text" id="pgntn_prev_text" /><span class="pgntn_info"> <?php _e('text for previous page link', 'pagination'); ?> </span><br/> <input type="text" maxlength='250' value="<?php echo $pgntn_options['next_text']; ?> "<?php echo 0 == $pgntn_options['display_next_prev'] ? 'disabled="disabled"' : ''; ?> name="pgntn_next_text" id="pgntn_next_text" /><span class="pgntn_info"> <?php _e('text for next page link', 'pagination'); ?> </span><br/> </div><!-- .pgntn_links_text --> </td> </tr> <tr> <th scope="row"><?php _e('Type of output', 'pagination'); ?> </th> <td> <fieldset> <label><input type="radio" value="1" id="pgntn_show_all" name="pgntn_show_all"<?php echo 1 == $pgntn_options['show_all'] ? ' checked="checked"' : ''; ?> /> <?php _e('all numbers of pages', 'pagination'); ?> </label><br /> <label><input type="radio" value="0" id="pgntn_show_not_all" name="pgntn_show_all"<?php echo 0 == $pgntn_options['show_all'] ? ' checked="checked"' : ''; ?> /> <?php _e('shorthand output', 'pagination'); ?> </label><br /> <input type="number" min="1" step="1" value="<?php echo $pgntn_options['display_count_page']; ?> "<?php echo 1 == $pgntn_options['show_all'] ? ' disabled="disabled"' : ''; ?> id="pgntn_display_count_page" name="pgntn_display_count_page" /><span class="pgntn_info"> <?php _e('numbers to either side of current page, but not including current page.', 'pagination'); ?> </span> </fieldset> </td> </tr> <tr> <th scope="row"><div><?php _e('Hide standard pagination', 'pagination'); ?> </div></th> <td> <div class="pgntn_input"> <input id="pgntn_display_posts_pagination" name='pgntn_display_standard_pagination[]' type='checkbox' value='posts' <?php if (!empty($pgntn_options['display_standard_pagination']) && in_array('posts', $pgntn_options['display_standard_pagination'])) { echo 'checked="checked"'; } ?> /> <label for="pgntn_display_posts_pagination"><?php _e('posts pagination', 'pagination'); ?> </label><br /> <input id="pgntn_display_multipage_pagination" name='pgntn_display_standard_pagination[]' type='checkbox' value='multipage' <?php if (!empty($pgntn_options['display_standard_pagination']) && in_array('multipage', $pgntn_options['display_standard_pagination'])) { echo 'checked="checked"'; } ?> /> <label for="pgntn_display_multipage_pagination"><?php _e('on paginated posts or pages', 'pagination'); ?> </label><br /> <input id="pgntn_display_comments_pagination" name='pgntn_display_standard_pagination[]' type='checkbox' value='comments' <?php if (!empty($pgntn_options['display_standard_pagination']) && in_array('comments', $pgntn_options['display_standard_pagination'])) { echo 'checked="checked"'; } ?> /> <label for="pgntn_display_comments_pagination"><?php _e('comments pagination', 'pagination'); ?> </label><br /> </div><!-- .pgntn_input --> <div class="bws_help_box dashicons dashicons-editor-help"> <div class="bws_hidden_help_text" style="min-width: 200px;"><?php _e('Used for standard WordPress themes or themes, which use standard CSS-classes for displaying pagination blocks', 'pagination'); ?> </div> </div><!-- .pgntn_help_box --> </td> </tr> <tr> <th scope="row"><?php _e('Hide custom pagination', 'pagination'); ?> </th> <td> <div class="pgntn_input"> <input id="pgntn_display_custom_pagination" name='pgntn_display_custom_pagination' type='checkbox' value='1' <?php if (1 == $pgntn_options['display_custom_pagination']) { echo 'checked="checked"'; } ?> /> <input type="text" maxlength='250' value="<?php echo $pgntn_options['additional_pagination_style']; ?> " id="pgntn_additional_pagination_style" name="pgntn_additional_pagination_style"<?php echo 0 == $pgntn_options['display_custom_pagination'] ? ' disabled="disabled"' : ''; ?> /> </div><!-- .pgntn_input --> <div class="bws_help_box dashicons dashicons-editor-help"> <div class="bws_hidden_help_text" style="min-width: 200px;"> <?php _e('Enter one (or more comma-separated) CSS-classes or ID of blocks which you would like to hide.', 'pagination'); ?> <br /> <?php _e('Example', 'pagination'); ?> :<br /> <code>#nav_block</code><br /> <?php _e("or", 'pagination'); ?> <br /> <code>.pagination</code><br /> <?php _e("or", 'pagination'); ?> <br /> <code>#nav_block, .pagination</code> </div> </div><!-- .pgntn_help_box --> </td> </tr> </table><!-- end of main settings --> </div> <div<?php if (!(isset($_GET['action']) && 'appearance' == $_GET['action'])) { echo ' style="display: none;"'; } ?> > <table class="form-table"><!-- additional settings --> <tr> <th scope="row"><?php _e('Page pagination block width', 'pagination'); ?> </th> <td> <input type="number" step="1" min="0" max="100" value="<?php echo $pgntn_options['width']; ?> " id="pgntn_width" name="pgntn_width" /> <span class="bws_info">%</span> </td> </tr> <tr> <th scope="row"><?php _e('Pagination align', 'pagination'); ?> </th> <td><fieldset> <input type="radio" value="left" <?php echo $pgntn_options['align'] == "left" ? 'checked="checked"' : ""; ?> id="pgntn_align_left" name="pgntn_align" /> <label for="pgntn_align_left"><?php _e('Left', 'pagination'); ?> </label><br /> <input type="radio" value="center" <?php echo $pgntn_options['align'] == "center" ? 'checked="checked"' : ""; ?> id="pgntn_align_center" name="pgntn_align" /> <label for="pgntn_align_center"><?php _e('Center', 'pagination'); ?> </label><br /> <input type="radio" value="right" <?php echo $pgntn_options['align'] == "right" ? 'checked="checked"' : ""; ?> id="pgntn_align_right" name="pgntn_align" /> <label for="pgntn_align_right"><?php _e('Right', 'pagination'); ?> </label> </fieldset></td> </tr> <tr> <th scope="row"><?php _e('Left margin', 'pagination'); ?> </th> <td> <input type="number" step="1" min="0" max="10000" value="<?php echo !empty($pgntn_options['margin_left']) ? $pgntn_options['margin_left'] : '0'; ?> " id="pgntn_margin_left" class="pgntn_margin" name="pgntn_margin_left"<?php echo $pgntn_options['align'] == "center" ? ' disabled="disabled"' : ''; ?> /> <span class="bws_info">px</span> </td> </tr> <tr> <th scope="row"><?php _e('Right margin', 'pagination'); ?> </th> <td> <input type="number" step="1" min="0" max="10000" value="<?php echo !empty($pgntn_options['margin_right']) ? $pgntn_options['margin_right'] : '0'; ?> " id="pgntn_margin_right" class="pgntn_margin" name="pgntn_margin_right"<?php echo $pgntn_options['align'] == "center" ? ' disabled="disabled"' : ''; ?> /> <span class="bws_info">px</span> </td> </tr> <tr> <th scope="row"><?php _e('Background color', 'pagination'); ?> </th> <td> <input type="text" maxlength='7' value="<?php echo $pgntn_options['background_color']; ?> " id="pgntn_background_color" name="pgntn_background_color" /> <div class="pgntn_color_picker"></div> </td> </tr> <tr> <th scope="row"><?php _e('Background color for current page', 'pagination'); ?> </th> <td> <input type="text" maxlength='7' value="<?php echo $pgntn_options['current_background_color']; ?> " id="pgntn_current_background_color" name="pgntn_current_background_color" /> <div class="pgntn_color_picker"></div> </td> </tr> <tr> <th scope="row"><?php _e('Text color for page', 'pagination'); ?> </th> <td> <input type="text" maxlength='7' value="<?php echo $pgntn_options['text_color']; ?> " id="pgntn_text_color" name="pgntn_text_color" /> <div class="pgntn_color_picker"></div> </td> </tr> <tr> <th scope="row"><?php _e('Text color for current page', 'pagination'); ?> </th> <td> <input type="text" maxlength='7' value="<?php echo $pgntn_options['current_text_color']; ?> " id="pgntn_current_text_color" name="pgntn_current_text_color" /> <div class="pgntn_color_picker"></div> </td> </tr> <tr> <th scope="row"><?php _e('Border color', 'pagination'); ?> </th> <td> <input type="text" maxlength='7' value="<?php echo $pgntn_options['border_color']; ?> " id="pgntn_border_color" name="pgntn_border_color" /> <div class="pgntn_color_picker"></div> </td> </tr> <tr> <th scope="row"><?php _e('Border width', 'pagination'); ?> </th> <td> <input type="number" step="1" min="0" max="1000" value="<?php echo !empty($pgntn_options['border_width']) ? $pgntn_options['border_width'] : '0'; ?> " id="pgntn_border_width" name="pgntn_border_width" /> <span class="bws_info">px</span> </td> </tr> <tr> <th scope="row"><?php _e('Border radius', 'pagination'); ?> </th> <td> <input type="number" step="1" min="0" max="1000" value="<?php echo !empty($pgntn_options['border_radius']) ? $pgntn_options['border_radius'] : '0'; ?> " id="pgntn_border_radius" name="pgntn_border_radius" /> <span class="bws_info">px</span> </td> </tr> </table><!-- end of additional settings --> </div> <p class="submit"> <input id="bws-submit-button" type="submit" class="button-primary" value="<?php _e('Save Changes', 'pagination'); ?> " /> <input type="hidden" name="pgntn_form_submit" value="submit" /> <?php wp_nonce_field(plugin_basename(__FILE__), 'pgntn_nonce_name'); ?> </p> </form> <?php bws_form_restore_default_settings(plugin_basename(__FILE__)); } bws_plugin_reviews_block($pgntn_plugin_info['Name'], 'pagination'); ?> </div> <?php }
function gglstmp_settings_page() { global $gglstmp_url_home, $gglstmp_settings, $gglstmp_option_defaults, $gglstmp_url, $wp_version, $gglstmp_plugin_info; if (!isset($_GET['action']) || 'go_pro' != $_GET['action']) { require_once dirname(__FILE__) . '/includes/pro_banners.php'; } $message = $error = ""; $gglstmp_robots = get_option('gglstmp_robots'); $gglstmp_url_robot = ABSPATH . "robots.txt"; $plugin_basename = plugin_basename(__FILE__); /* Check htaccess plugin */ $gglstmp_htaccess_active = false; if (is_multisite() && !is_subdomain_install()) { $all_plugins = get_plugins(); $is_network = is_network_admin(); $admin_url = $is_network ? network_admin_url('/') : admin_url('/'); $gglstmp_htaccess = gglstmp_plugin_status(array('htaccess/htaccess.php', 'htaccess-pro/htaccess-pro.php'), $all_plugins, $is_network); $gglstmp_htaccess_options = false; if ($gglstmp_htaccess['status'] == 'actived') { if ($gglstmp_htaccess['plugin'] == 'htaccess/htaccess.php') { global $htccss_options; register_htccss_settings(); $gglstmp_htaccess_options =& $htccss_options; $gglstmp_htaccess_prefix = 'htccss'; } if ($gglstmp_htaccess['plugin'] == 'htaccess-pro/htaccess-pro.php') { global $htccsspr_options; register_htccsspr_settings(); $gglstmp_htaccess_options =& $htccsspr_options; $gglstmp_htaccess_prefix = 'htccsspr'; } $gglstmp_htaccess_active = true; $gglstmp_htaccess_options_name = "{$gglstmp_htaccess_prefix}_options"; $gglstmp_htaccess_function_generate = "{$gglstmp_htaccess_prefix}_generate_htaccess"; $gglstmp_htaccess_function_check = "{$gglstmp_htaccess_prefix}_check_xml_access"; if (function_exists($gglstmp_htaccess_function_check)) { $gglstmp_htaccess_check = $gglstmp_htaccess_function_check(); if ($gglstmp_htaccess_check != $gglstmp_htaccess_options['allow_xml']) { $gglstmp_htaccess_options['allow_xml'] = $gglstmp_htaccess_check; update_site_option($gglstmp_htaccess_options_name, $gglstmp_htaccess_options); } } } } if (is_multisite()) { $home_url = preg_replace("/[^a-zA-ZА-Яа-я0-9\\s]/", "_", str_replace('http://', '', str_replace('https://', '', site_url()))); $gglstmp_url_sitemap = ABSPATH . "sitemap_" . $home_url . ".xml"; } else { $gglstmp_url_sitemap = ABSPATH . "sitemap.xml"; } if (isset($_REQUEST['gglstmp_submit']) && check_admin_referer($plugin_basename, 'gglstmp_nonce_name')) { if (isset($_POST['bws_hide_premium_options'])) { $hide_result = bws_hide_premium_options($gglstmp_settings); $gglstmp_settings = $hide_result['options']; } if ($gglstmp_htaccess_active && $gglstmp_htaccess_options && function_exists($gglstmp_htaccess_function_generate)) { $gglstmp_allow_xml = isset($_POST['gglstmp_allow_xml']) && $_POST['gglstmp_allow_xml'] == 1 ? 1 : 0; if ($gglstmp_allow_xml != $gglstmp_htaccess_options['allow_xml']) { $gglstmp_htaccess_options['allow_xml'] = $gglstmp_allow_xml; update_site_option($gglstmp_htaccess_options_name, $gglstmp_htaccess_options); $gglstmp_htaccess_function_generate(); } } $gglstmp_settings['post_type'] = isset($_REQUEST['gglstmp_post_types']) ? $_REQUEST['gglstmp_post_types'] : array(); $gglstmp_settings['taxonomy'] = isset($_REQUEST['gglstmp_taxonomies']) ? $_REQUEST['gglstmp_taxonomies'] : array(); /*============================ Adding location of sitemap file to the robots.txt =============*/ $gglstmp_robots_flag = isset($_POST['gglstmp_checkbox']) ? 1 : 0; if (file_exists($gglstmp_url_robot) && !is_multisite()) { if (!is_writable($gglstmp_url_robot)) { @chmod($gglstmp_url_robot, 0755); } if (is_writable($gglstmp_url_robot)) { $file_content = file_get_contents($gglstmp_url_robot); if (isset($_POST['gglstmp_checkbox']) && !preg_match('|Sitemap: ' . $gglstmp_url_home . 'sitemap.xml|', $file_content)) { file_put_contents($gglstmp_url_robot, $file_content . "\nSitemap: " . $gglstmp_url_home . "sitemap.xml"); } elseif (preg_match("|Sitemap: " . $gglstmp_url_home . "sitemap.xml|", $file_content) && !isset($_POST['gglstmp_checkbox'])) { $file_content = preg_replace("|\nSitemap: " . $gglstmp_url_home . "sitemap.xml|", '', $file_content); file_put_contents($gglstmp_url_robot, $file_content); } } else { $error = __('Cannot edit "robots.txt". Check your permissions', 'google-sitemap-plugin'); $gglstmp_robots_flag = 0; } } if (false === get_option('gglstmp_robots')) { add_option('gglstmp_robots', $gglstmp_robots_flag); } else { update_option('gglstmp_robots', $gglstmp_robots_flag); } $gglstmp_robots = get_option('gglstmp_robots'); update_option('gglstmp_settings', $gglstmp_settings); if (!isset($_POST['gglstmp_authorize']) && !isset($_POST['gglstmp_logout']) && !isset($_POST['gglstmp_menu'])) { $message .= " " . __("Settings saved", 'google-sitemap-plugin'); } } /*## check banner */ $bws_hide_premium_options_check = bws_hide_premium_options_check($gglstmp_settings); if (isset($_POST['gglstmp_new']) && check_admin_referer($plugin_basename, 'gglstmp_nonce_name')) { $message = __("Your Sitemap file has been created in the site root directory", 'google-sitemap-plugin'); gglstmp_sitemapcreate(); } $gglstmp_result = get_post_types('', 'names'); unset($gglstmp_result['revision']); unset($gglstmp_result['attachment']); unset($gglstmp_result['nav_menu_item']); $gglstmp_result_taxonomies = array('category' => 'Post category', 'post_tag' => 'Post tag'); /* GO PRO */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { $go_pro_result = bws_go_pro_tab_check($plugin_basename, 'gglstmp_settings'); if (!empty($go_pro_result['error'])) { $error = $go_pro_result['error']; } elseif (!empty($go_pro_result['message'])) { $message = $go_pro_result['message']; } } if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $gglstmp_settings = $gglstmp_option_defaults; @unlink($gglstmp_url_sitemap); /* remove sitemap.xml */ /* clear robots.txt */ if (file_exists($gglstmp_url_robot) && !is_multisite()) { if (!is_writable($gglstmp_url_robot)) { @chmod($gglstmp_url_robot, 0755); } if (is_writable($gglstmp_url_robot)) { $file_content = file_get_contents($gglstmp_url_robot); if (preg_match("|Sitemap: " . $gglstmp_url_home . "sitemap.xml|", $file_content)) { $file_content = preg_replace("|\nSitemap: " . $gglstmp_url_home . "sitemap.xml|", '', $file_content); file_put_contents($gglstmp_url_robot, $file_content); } } else { $error = __('Cannot edit "robot.txt". Check your permissions', 'google-sitemap-plugin'); } } if (false === get_option('gglstmp_robots')) { add_option('gglstmp_robots', 0); } else { update_option('gglstmp_robots', 0); } $gglstmp_robots = get_option('gglstmp_robots'); update_option('gglstmp_settings', $gglstmp_settings); $message = __('All plugin settings were restored.', 'google-sitemap-plugin'); } ?> <div class="wrap"> <h1 style="line-height: normal;"><?php _e("Google Sitemap Settings", 'google-sitemap-plugin'); ?> </h1> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=google-sitemap-plugin.php"><?php _e('Settings', 'google-sitemap-plugin'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'custom_links' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=google-sitemap-plugin.php&action=custom_links"><?php _e('Custom links', 'google-sitemap-plugin'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'extra' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=google-sitemap-plugin.php&action=extra"><?php _e('Extra settings', 'google-sitemap-plugin'); ?> </a> <a class="nav-tab bws_go_pro_tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=google-sitemap-plugin.php&action=go_pro"><?php _e('Go PRO', 'google-sitemap-plugin'); ?> </a> </h2> <?php if (!isset($_GET['action']) && is_multisite() && !is_subdomain_install() && count(glob(ABSPATH . "sitemap*.xml")) > 0 && (!$gglstmp_htaccess_active || $gglstmp_htaccess_options['allow_xml'] == 0)) { ?> <div id="gglstmp_check_sitemap_block" class="error below-h2"> <p> <?php printf('<strong>%s</strong> %s', __('Warning:', 'google-sitemap-plugin'), sprintf(__('To have an access to subsites XML files, please add the following rule %s to your %s file in %s after line %s or you can use option %s', 'google-sitemap-plugin') . '.', '<code>RewriteRule ([^/]+\\.xml)$ $1 [L]</code>', '<strong>.htaccess</strong>', sprintf('<strong>"%s"</strong>', ABSPATH), '<strong>"RewriteBase"</strong>', sprintf('<strong>"%s"</strong>', __('Allow access to XML files', 'google-sitemap-plugin')))); ?> </p> <div style="margin: .5em 0; padding: 2px;"> <form action="admin.php?page=google-sitemap-plugin.php" method='post' id="gglstmp_check_sitemap"> <input type="submit" class="button-secondary" name="gglstmp_check_sitemap" value="<?php _e('Сheck Access', 'google-sitemap-plugin'); ?> " /> <?php wp_nonce_field($plugin_basename, 'gglstmp_nonce_sitemap'); ?> </form> <?php if (isset($_POST['gglstmp_check_sitemap']) && check_admin_referer($plugin_basename, 'gglstmp_nonce_sitemap')) { $gglstmp_background = array('200' => '#f8fdf5', '404' => '#fdf6f6'); if ($gglstmp_settings['sitemap'] && file_exists($gglstmp_settings['sitemap']['path'])) { $gglstmp_status = gglstmp_check_sitemap($gglstmp_settings['sitemap']['loc']); printf('<div style="margin: 10px 0 0; padding: 2px 5px; background-color: %s;"><a href="%s">%s</a> - %s</div>', $gglstmp_background[$gglstmp_status['code']], $gglstmp_settings['sitemap']['loc'], $gglstmp_settings['sitemap']['file'], $gglstmp_status['message']); } } ?> </div> </div> <?php } bws_show_settings_notice(); ?> <div class="updated fade below-h2" <?php if ("" != $error || $message == "") { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $message; ?> .</strong></p></div> <div class="error below-h2" <?php if ("" == $error) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $error; ?> .</strong></p></div> <?php if (!isset($_GET['action'])) { if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } else { ?> <form class="bws_form" action="admin.php?page=google-sitemap-plugin.php" method='post' name="gglstmp_auth"> <?php /*=============================== Creating sitemap file ====================================*/ if (file_exists($gglstmp_url_sitemap)) { if (is_multisite()) { echo '<p><a href="' . $gglstmp_url_home . "sitemap_" . $home_url . '.xml" target="_new">' . __("The Sitemap file", 'google-sitemap-plugin') . "</a> " . __("already exists. If you would like to replace it with a new one, please choose the necessary box below", 'google-sitemap-plugin') . ".</p>"; } else { echo '<p><a href="' . $gglstmp_url_home . 'sitemap.xml" target="_new">' . __("The Sitemap file", 'google-sitemap-plugin') . "</a> " . __("already exists. If you would like to replace it with a new one, please choose the necessary box below", 'google-sitemap-plugin') . ".</p>"; } } else { gglstmp_sitemapcreate(); if (is_multisite()) { echo '<p><a href="' . $gglstmp_url_home . "sitemap_" . $home_url . '.xml" target="_new">' . __("Your Sitemap file", 'google-sitemap-plugin') . "</a> " . __("has been created in the site root directory", 'google-sitemap-plugin') . ".</p>"; } else { echo '<p><a href="' . $gglstmp_url_home . 'sitemap.xml" target="_new">' . __("Your Sitemap file", 'google-sitemap-plugin') . "</a> " . __("has been created in the site root directory", 'google-sitemap-plugin') . ".</p>"; } } ?> <table class="form-table"> <tr valign="top"> <td colspan="2"> <label><input type='checkbox' name='gglstmp_new' value="1" /> <?php _e("create a new sitemap file or update the existing one", 'google-sitemap-plugin'); ?> </label> </td> </tr> <?php if (is_multisite()) { ?> <tr valign="top"> <td colspan="2"> <label><input type='checkbox' disabled="disabled" name='gglstmp_checkbox' value="1" <?php if (1 == $gglstmp_robots) { echo 'checked="checked"'; } ?> /> <?php _e("add sitemap file path in robots.txt", 'google-sitemap-plugin'); ?> </label> <p style="color:red"><?php _e("Since you are using multisiting, the plugin does not allow to add a sitemap to robots.txt", 'google-sitemap-plugin'); ?> </div> </td> </tr> <?php } else { ?> <tr valign="top"> <td colspan="2"> <!-- for robots.txt we need to use site_url instead home_url ! --> <label><input type='checkbox' name='gglstmp_checkbox' value="1" <?php if (1 == $gglstmp_robots) { echo 'checked="checked"'; } ?> /> <?php _e("add sitemap file path in", 'google-sitemap-plugin'); ?> <a href="<?php echo site_url('/'); ?> robots.txt" target="_new">robots.txt</a></label> </td> </tr> <?php } ?> <tr valign="top"> <th scope="row" colspan="2"><?php _e('Please choose the necessary post types and taxonomies the links to which are to be added to the sitemap', 'google-sitemap-plugin'); ?> :</th> </tr> <tr valign="top"> <td colspan="2"> <fieldset> <?php foreach ($gglstmp_result as $key => $value) { ?> <label><input type="checkbox" <?php if (in_array($value, $gglstmp_settings['post_type'])) { echo 'checked="checked"'; } ?> name="gglstmp_post_types[]" value="<?php echo $value; ?> "/><span style="text-transform: capitalize; padding-left: 5px;"><?php echo $value; ?> </span></label><br /> <?php } ?> </fieldset> </td> </tr> <tr valign="top"> <td colspan="2"> <fieldset> <?php foreach ($gglstmp_result_taxonomies as $key => $value) { ?> <label><input type="checkbox" <?php if (in_array($key, $gglstmp_settings['taxonomy'])) { echo 'checked="checked"'; } ?> name="gglstmp_taxonomies[]" value="<?php echo $key; ?> "/><span style="padding-left: 5px;"><?php echo $value; ?> </span></label><br /> <?php } ?> </fieldset> </td> </tr> <?php if (is_multisite() && !is_subdomain_install()) { $gglstmp_plugin_name = isset($gglstmp_htaccess['plugin_info']['Name']) ? $gglstmp_htaccess['plugin_info']['Name'] : 'Htaccess by BestWebSoft'; $gglstmp_attr_checked = $gglstmp_attr_disabled = ''; $gglstmp_plugin_notice = sprintf(__('This option will be applied to all websites in the network', 'google-sitemap-plugin')); if ('deactivated' == $gglstmp_htaccess['status']) { $gglstmp_attr_disabled = 'disabled="disabled"'; $gglstmp_plugin_notice = sprintf(__('You should %s to use this functionality', 'google-sitemap-plugin'), sprintf('<a href="%splugins.php">%s%s %s</a>', $admin_url, __('activate', 'google-sitemap-plugin'), is_network_admin() ? ' ' . __('for network', 'google-sitemap-plugin') : '', $gglstmp_plugin_name)); } elseif ('not_installed' == $gglstmp_htaccess['status']) { $gglstmp_attr_disabled = 'disabled="disabled"'; $gglstmp_plugin_notice = sprintf(__('You should %s to use this functionality', 'google-sitemap-plugin'), sprintf('<a href="http://bestwebsoft.com/products/htaccess/?k=bc745b0c9d4b19ba95ae2c861418e0df&pn=83&v=%s&wp_v=%s">%s %s</a>', $gglstmp_plugin_info["Version"], $wp_version, __('download', 'google-sitemap-plugin'), $gglstmp_plugin_name)); } if ('1' == $gglstmp_htaccess_options['allow_xml'] && $gglstmp_attr_disabled == '') { $gglstmp_attr_checked = 'checked="checked"'; } ?> <tr valign="top" id="gglstmp_allow_xml_block"> <th scope="row"><?php _e('Allow access to XML files', 'google-sitemap-plugin'); ?> </th> <td> <label><input <?php printf("%s %s", $gglstmp_attr_checked, $gglstmp_attr_disabled); ?> type="checkbox" name="gglstmp_allow_xml" value="1" /></label> <div class="bws_help_box dashicons dashicons-editor-help"> <div class="bws_hidden_help_text" style="min-width: 270px;"> <p><?php _e('The following string will be added to your .htaccess file', 'google-sitemap-plugin'); ?> :</p> <code>RewriteRule ([^/]+\.xml)$ $1 [L]</code> </div> </div> <span class="bws_info"><?php echo $gglstmp_plugin_notice; ?> </span><br /> </td> </tr> <?php } ?> </table> <?php gglstmp_pro_block('gglstmp_frequency_block'); if (!function_exists('curl_init')) { ?> <p class="gglstmp_error"> <strong><?php _e("This hosting does not support сURL, so you cannot add a sitemap file automatically", 'google-sitemap-plugin'); ?> .</strong> <br /> <span class="bws_info"> <?php echo __('You can always add your sitemap to Google Webmaster Tools manually. For more info see', 'google-sitemap-plugin') . ' <a target="_blank" href="https://docs.google.com/document/d/1VOJx_OaasVskCqi9fsAbUmxfsckoagPU5Py97yjha9w/edit">' . __('the instruction', 'google-sitemap-plugin') . '</a>.'; ?> </span> </p> <?php } else { ?> <table class="form-table"> <tr id="gglstmp_google_webmaster" valign="top"> <th scope="row"><?php _e('Remote work with Google Webmaster Tools', 'google-sitemap-plugin'); ?> </th> <td> <?php $gglstmp_client = gglstmp_client(); $gglstmp_blog_prefix = '_' . get_current_blog_id(); if (isset($_POST['gglstmp_logout']) && check_admin_referer($plugin_basename, 'gglstmp_nonce_name')) { unset($_SESSION['gglstmp_authorization_code' . $gglstmp_blog_prefix]); unset($gglstmp_settings['authorization_code']); update_option('gglstmp_settings', $gglstmp_settings); } if (isset($_POST['gglstmp_authorization_code']) && !empty($_POST['gglstmp_authorization_code']) && check_admin_referer($plugin_basename, 'gglstmp_nonce_name')) { try { $gglstmp_client->authenticate($_POST['gglstmp_authorization_code']); $gglstmp_settings['authorization_code'] = $_SESSION['gglstmp_authorization_code' . $gglstmp_blog_prefix] = $gglstmp_client->getAccessToken(); update_option('gglstmp_settings', $gglstmp_settings); } catch (Exception $e) { } } if (!isset($_SESSION['gglstmp_authorization_code' . $gglstmp_blog_prefix]) && isset($gglstmp_settings['authorization_code'])) { $_SESSION['gglstmp_authorization_code' . $gglstmp_blog_prefix] = $gglstmp_settings['authorization_code']; } if (isset($_SESSION['gglstmp_authorization_code' . $gglstmp_blog_prefix])) { $gglstmp_client->setAccessToken($_SESSION['gglstmp_authorization_code' . $gglstmp_blog_prefix]); } if ($gglstmp_client->getAccessToken()) { ?> <div id="gglstmp_logout_button"> <input class="button-secondary" name="gglstmp_logout" type="submit" value="<?php _e('Log out from Google Webmaster Tools', 'google-sitemap-plugin'); ?> " /> </div> <?php $gglstmp_menu_ad = __("add this site to Google Webmaster Tools", 'google-sitemap-plugin'); $gglstmp_menu_del = __("delete this site from Google Webmaster Tools", 'google-sitemap-plugin'); $gglstmp_menu_inf = __("get info about this site in Google Webmaster Tools", 'google-sitemap-plugin'); ?> <fieldset> <label><input type='radio' name='gglstmp_menu' value="ad" /> <?php echo $gglstmp_menu_ad; ?> </label><br /> <label><input type='radio' name='gglstmp_menu' value="del" /> <?php echo $gglstmp_menu_del; ?> </label><br /> <label><input type='radio' name='gglstmp_menu' value="inf" /> <?php echo $gglstmp_menu_inf; ?> </label> </fieldset> <?php if (isset($_POST['gglstmp_menu']) && check_admin_referer($plugin_basename, 'gglstmp_nonce_name')) { $gglstmp_wmt = new Google_Service_Webmasters($gglstmp_client); $gglstmp_sv = new Google_Service_SiteVerification($gglstmp_client); switch ($_POST['gglstmp_menu']) { case 'inf': gglstmp_info_site($gglstmp_wmt, $gglstmp_sv); break; case 'ad': gglstmp_add_site($gglstmp_wmt, $gglstmp_sv); break; case 'del': gglstmp_del_site($gglstmp_wmt, $gglstmp_sv); break; default: break; } } } else { $gglstmp_state = mt_rand(); $gglstmp_client->setState($gglstmp_state); $_SESSION['gglstmp_state' . $gglstmp_blog_prefix] = $gglstmp_client; $gglstmp_auth_url = $gglstmp_client->createAuthUrl(); ?> <p><?php _e("Please authorize via your Google Account in order to add or delete a site and a sitemap file automatically or get information about this site in Google Webmaster Tools", 'google-sitemap-plugin'); ?> .</p> <a id="gglstmp_authorization_button" class="button-primary" href="<?php echo $gglstmp_auth_url; ?> " target="_blank" onclick="window.open(this.href,'','top='+(screen.height/2-560/2)+',left='+(screen.width/2-640/2)+',width=640,height=560,resizable=0,scrollbars=0,menubar=0,toolbar=0,status=1,location=0').focus(); return false;"><?php _e('Get Authorization Code', 'google-sitemap-plugin'); ?> </a> <div id="gglstmp_authorization_form"> <input id="gglstmp_authorization_code" name="gglstmp_authorization_code" type="text" autocomplete="off" maxlength="100" /> <input id="gglstmp_authorize" class="button-primary" name="gglstmp_authorize" type="submit" value="<?php _e('Authorize', 'google-sitemap-plugin'); ?> "> </div> <?php if (isset($_POST['gglstmp_authorization_code']) && isset($_POST['gglstmp_authorize']) && check_admin_referer($plugin_basename, 'gglstmp_nonce_name')) { ?> <div id="gglstmp_authorize_error"><?php _e('Invalid authorization code. Please, try again', 'google-sitemap-plugin'); ?> .</div> <?php } } ?> <br /> <span class="bws_info"> <?php echo __('You can always add your sitemap to Google Webmaster Tools manually. For more info see', 'google-sitemap-plugin') . ' <a target="_blank" href="https://docs.google.com/document/d/1VOJx_OaasVskCqi9fsAbUmxfsckoagPU5Py97yjha9w/edit">' . __('the instruction', 'google-sitemap-plugin') . '</a>.'; ?> </span> </td> </tr> </table> <?php } ?> <input type="hidden" name="gglstmp_submit" value="submit" /> <p class="submit"> <input id="bws-submit-button" type="submit" class="button-primary" value="<?php _e('Save Changes', 'google-sitemap-plugin'); ?> " /> </p> <?php wp_nonce_field($plugin_basename, 'gglstmp_nonce_name'); ?> </form> <?php bws_form_restore_default_settings($plugin_basename); ?> <div class="clear"></div> <?php } } elseif (in_array($_GET['action'], array('extra', 'custom_links'))) { gglstmp_pro_block("gglstmp_{$_GET['action']}_block", false); } elseif ('go_pro' == $_GET['action']) { bws_go_pro_tab_show($bws_hide_premium_options_check, $gglstmp_plugin_info, $plugin_basename, 'google-sitemap-plugin.php', 'google-sitemap-pro.php', 'google-sitemap-pro/google-sitemap-pro.php', 'google-sitemap', '28d4cf0b4ab6f56e703f46f60d34d039', '83', isset($go_pro_result['pro_plugin_is_activated'])); } bws_plugin_reviews_block($gglstmp_plugin_info['Name'], 'google-sitemap-plugin'); ?> </div> <?php }
function mltlngg_settings_page() { global $mltlngg_options, $mltlngg_default_options, $mltlngg_plugin_info, $mltlngg_languages, $wp_version; $mltlngg_message_value = array('success' => '', 'error' => ''); /* Change settings options */ if (isset($_POST['mltlngg_settings_form_was_send']) && check_admin_referer('mltlngg_settings_form', 'mltlngg_settings_form_field')) { if (isset($_POST['bws_hide_premium_options'])) { $hide_result = bws_hide_premium_options($mltlngg_options); $mltlngg_options = $hide_result['options']; } $mltlngg_options['enabled_new_language'] = isset($_POST['mltlngg_new_language_enable']) ? true : false; $mltlngg_options['autosave_editor_content'] = isset($_POST['mltlngg_autosave_editor_content']) ? true : false; $mltlngg_options['display_alternative_link'] = isset($_POST['mltlngg_display_alternative_link']) ? true : false; $mltlngg_options['hide_link_slug'] = isset($_POST['mltlngg_hide_link_slug']) ? true : false; $mltlngg_options['wp_localization'] = isset($_POST['mltlngg_wp_localization']) ? true : false; $mltlngg_options['language_switcher'] = isset($_POST['mltlngg_language_switcher']) ? $_POST['mltlngg_language_switcher'] : 'drop-down-list'; $mltlngg_options['search'] = $_POST['mltlngg_search']; update_option('mltlngg_options', $mltlngg_options); $mltlngg_message_value['success'] = __('Settings saved', 'multilanguage'); } /* Adding language */ if (isset($_POST['mltlngg_add_new_language_form_was_send']) && !empty($_POST['mltlngg_lang_list']) && check_admin_referer('mltlngg_add_new_language_form', 'mltlngg_add_new_language_field')) { if (preg_match('/^([a-z]{2,3}|[a-z]{2,3}[_][A-Z]{2,3})-(.+?)$/u', $_POST['mltlngg_lang_list'], $matches)) { /* If language data is correct */ $done = mltlngg_add_language($matches[1], $matches[2]); /* Add new language (locale, name) */ if ($done) { $mltlngg_message_value['success'] = __('Language added', 'multilanguage'); } } else { /* If language data is incorrect */ $mltlngg_message_value['error'] = __('Incorrect language data', 'multilanguage'); } } /* Change priority and default language options */ if (isset($_POST['mltlngg_language_form_was_send']) && check_admin_referer('mltlngg_current_languages_form', 'mltlngg_current_languages_field')) { if (isset($_POST['mltlngg_language_form_submit'])) { foreach ($mltlngg_options['list_of_languages'] as $key => $mltlngg_language_to_action) { if (isset($_POST[$mltlngg_language_to_action['locale']]) && NULL != $_POST[$mltlngg_language_to_action['locale']]) { $mltlngg_options['list_of_languages'][$key]['priority'] = $_POST[$mltlngg_language_to_action['locale']]; } $mltlngg_priority[$key] = $mltlngg_options['list_of_languages'][$key]['priority']; } /* change default langguage */ if (isset($_POST['mltlngg_default_lang']) && !is_null($_POST['mltlngg_default_lang'])) { foreach ($mltlngg_options['list_of_languages'] as $key => $language) { /* if language data have been finded */ if (array_search($_POST['mltlngg_default_lang'], $language, true)) { $mltlngg_options['default_language'] = $_POST['mltlngg_default_lang']; $mltlngg_options['list_of_languages'][$key]['enable'] = true; break; } } } /* Sorting list of language by priority */ array_multisort($mltlngg_priority, SORT_ASC, $mltlngg_options['list_of_languages']); update_option('mltlngg_options', $mltlngg_options); $mltlngg_message_value['success'] = __('Settings saved', 'multilanguage'); } } /* Actions for table of languages */ if (!isset($_POST['mltlngg_language_form_submit'])) { if (isset($_POST['mltlngg_language']) && check_admin_referer('mltlngg_current_languages_form', 'mltlngg_current_languages_field')) { if (isset($_POST['action']) && -1 != $_POST['action']) { $action = $_POST['action']; $language = $_POST['mltlngg_language']; } elseif (isset($_POST['action2']) && -1 != $_POST['action2']) { $action = $_POST['action2']; $language = $_POST['mltlngg_language']; } } elseif (isset($_GET['mltlngg_language']) && wp_verify_nonce($_GET['_wpnonce'], 'mltlngg-action')) { $action = $_GET['action']; $language = $_GET['mltlngg_language']; } $action_result = isset($action) && in_array($action, array('enable', 'disable', 'delete')) ? mltlngg_actions($action, $language) : array(); if (isset($action_result['error'])) { $mltlngg_message_value['error'] .= $action_result['error']; } if (isset($action_result['success'])) { $mltlngg_message_value['success'] .= $action_result['success']; } } if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer(plugin_basename(__FILE__), 'bws_settings_nonce_name')) { $mltlngg_options = $mltlngg_default_options; update_option('mltlngg_options', $mltlngg_options); $mltlngg_message_value['success'] = __('All plugin settings were restored.', 'multilanguage'); } $bws_hide_premium_options_check = bws_hide_premium_options_check($mltlngg_options); /* GO PRO */ if (isset($_GET['tab']) && 'go_pro' == $_GET['tab']) { $go_pro_result = bws_go_pro_tab_check(plugin_basename(__FILE__), 'mltlngg_options'); if (!empty($go_pro_result['error'])) { $mltlngg_message_value['error'] = $go_pro_result['error']; } elseif (!empty($go_pro_result['message'])) { $mltlngg_message_value['success'] = $go_pro_result['message']; } } ?> <div class="wrap" id="mltlngg-settings"> <h1><?php _e('Multilanguage Settings', 'multilanguage'); if (!(isset($_GET['tab']) && in_array($_GET['tab'], array('settings', 'go_pro')))) { ?> <a class="page-title-action hide-if-no-js" href="#" id="mltlngg-add-lang-link"><?php _e('Add language', 'multilanguage'); ?> </a> <?php } ?> </h1> <!-- Display language tab on setting page --> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['tab'])) { echo ' nav-tab-active'; } ?> " href="<?php echo admin_url('admin.php?page=mltlngg_settings', ''); ?> "><?php _e('Languages', 'multilanguage'); ?> </a> <a class="nav-tab<?php if (isset($_GET['tab']) && 'settings' == $_GET['tab']) { echo ' nav-tab-active'; } ?> " href="<?php echo admin_url('admin.php?page=mltlngg_settings&tab=settings', ''); ?> "><?php _e('Settings', 'multilanguage'); ?> </a> <a class="nav-tab <?php if (isset($_GET['tab']) && 'custom_code' == $_GET['tab']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=mltlngg_settings&tab=custom_code"><?php _e('Custom code', 'multilanguage'); ?> </a> <a class="nav-tab bws_go_pro_tab<?php if (isset($_GET['tab']) && 'go_pro' == $_GET['tab']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=mltlngg_settings&tab=go_pro"><?php _e('Go PRO', 'multilanguage'); ?> </a> </h2><!-- .nav-tab-wrapper --> <?php if (!empty($mltlngg_message_value['error'])) { ?> <div class="error below-h2"><p><strong><?php echo $mltlngg_message_value['error']; ?> </strong></p></div> <?php } elseif (!empty($mltlngg_message_value['success'])) { ?> <div class="updated fade below-h2"><p><strong><?php echo $mltlngg_message_value['success']; ?> </strong></p></div> <?php } if (!empty($hide_result['message'])) { ?> <div class="updated fade below-h2"><p><strong><?php echo $hide_result['message']; ?> </strong></p></div> <?php } bws_show_settings_notice(); /* Display tab of setting page */ if (!isset($_GET['tab'])) { /* Form for adding new language */ mltlngg_add_language_form(); ?> <!-- /form for adding new language --> <form class="bws_form" name="mltlngg_current_languages_form" method="post" action="" id="mltlngg-current-languages-form"> <!-- display table of languages, source - table.php --> <?php mltlngg_table(); wp_nonce_field('mltlngg_current_languages_form', 'mltlngg_current_languages_field'); ?> <!-- /table of languages --> <br> <input id="bws-submit-button" type="submit" name="mltlngg_language_form_submit" class="button-primary" value="<?php _e('Save changes', 'multilanguage'); ?> "> <input type="hidden" name="mltlngg_language_form_was_send" value="1" /> </form><!-- #mltlngg_current_languages_form --> <div><p> </p></div> <?php } elseif ('settings' == $_GET['tab']) { if (isset($_REQUEST['bws_restore_default']) && check_admin_referer(plugin_basename(__FILE__), 'bws_settings_nonce_name')) { bws_form_restore_default_confirm(plugin_basename(__FILE__)); } else { ?> <p><?php _e('If you would like to display Language switcher with a widget, you need to add the widget "Multilanguage" in the Widgets tab.', 'multilanguage'); ?> </p> <div> <?php printf(__("If you would like to add a Language switcher to your page or post, please use %s button", 'multilanguage'), '<code><img style="vertical-align: sub;" src="' . plugins_url('bws_menu/images/shortcode-icon.png', __FILE__) . '" alt=""/></code>'); ?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help"> <div class="bws_hidden_help_text" style="min-width: 260px;"> <?php printf(__("You can add Language switcher to your page or post by clicking on %s button in the content edit block using the Visual mode. If the button isn't displayed, please use the shortcode %s.", 'multilanguage'), '<code><img style="vertical-align: sub;" src="' . plugins_url('bws_menu/images/shortcode-icon.png', __FILE__) . '" alt="" /></code>', '<code>[multilanguage_switcher]</code>'); ?> </div> </div> </div> <p><?php _e('Also, you can paste the following strings into the template source code', 'multilanguage'); ?> <code><?php if ( function_exists( 'mltlngg_display_switcher' ) ) mltlngg_display_switcher(); ?></code> <!-- Table with options form --> <form class="bws_form" name="mltlngg_settings_form" method="post" action="" id="mltlngg-current-languages-form"> <table class="form-table" style="max-width: 700px;"> <tr valign="middle"> <th scope="row"><?php _e('Enable new language', 'multilanguage'); ?> </th> <td> <input id="mltlngg_new_language_enable" name="mltlngg_new_language_enable" type="checkbox" value="true" <?php echo true == $mltlngg_options['enabled_new_language'] ? ' checked' : ''; ?> > <span class="bws_info"><?php _e("The newly added language will be enabled automatically", 'multilanguage'); ?> </span> </td> </tr> <tr valign="middle"> <th scope="row"><?php _e('Autosave translation in the editor', 'multilanguage'); ?> </th> <td> <input name="mltlngg_autosave_editor_content" type="checkbox" value="true" <?php echo true == $mltlngg_options['autosave_editor_content'] ? ' checked' : ''; ?> > <span class="bws_info"><?php _e("When switching edit posts/pages translation tab, the changes made in the previous tab will be saved automatically (only when the Javascript is enabled)", 'multilanguage'); ?> </span> </td> </tr> <tr valign="middle"> <th scope="row"><?php _e('Switch Wordpress localization', 'multilanguage'); ?> </th> <td><input name="mltlngg_wp_localization" type="checkbox" value="true" <?php echo true == $mltlngg_options['wp_localization'] ? ' checked' : ''; ?> > <span class="bws_info"><?php _e("When changing the language in the frontend, WordPress localization will also be changed (only in case additional WordPress language packs are installed)", 'multilanguage'); ?> </span></td> </tr> <tr valign="middle"> <th scope="row"><?php _e('Language switcher', 'multilanguage'); ?> </th> <td> <fieldset> <div style="clear: both;"> <label> <input name="mltlngg_language_switcher" type="radio" value="drop-down-list" <?php if ($mltlngg_options['language_switcher'] == 'drop-down-list') { echo 'checked'; } ?> /> <?php _e('Drop-down languages list', 'multilanguage'); ?> </label> <div class="bws_help_box dashicons dashicons-editor-help mltlngg_thumb_block"> <div class="bws_hidden_help_text"><img title="" src="<?php echo plugins_url('images/tooltip_drop_down_list.png', __FILE__); ?> " alt="" /></div> </div> </div> <div> <label> <input name="mltlngg_language_switcher" type="radio" value="drop-down-icons" <?php if ($mltlngg_options['language_switcher'] == 'drop-down-icons') { echo 'checked'; } ?> /> <?php _e('Drop-down flag icons', 'multilanguage'); ?> </label> <div class="bws_help_box dashicons dashicons-editor-help mltlngg_thumb_block"> <div class="bws_hidden_help_text"><img title="" src="<?php echo plugins_url('images/tooltip_drop_down_icons.png', __FILE__); ?> " alt="" /></div> </div> </div> <div> <label> <input name="mltlngg_language_switcher" type="radio" value="flags-icons" <?php if ($mltlngg_options['language_switcher'] == 'flags-icons') { echo 'checked'; } ?> /> <?php _e('Flag icons', 'multilanguage'); ?> </label> <div class="bws_help_box dashicons dashicons-editor-help mltlngg_thumb_block"> <div class="bws_hidden_help_text"><img title="" src="<?php echo plugins_url('images/tooltip_flags_icons.png', __FILE__); ?> " alt="" /></div> </div> </div> </fieldset> </td> </tr> <tr valign="middle"> <th scope="row"><?php _e("Display alternative page links", 'multilanguage'); ?> </th> <td> <input type="checkbox" id="mltlngg_display_alternative_link" name="mltlngg_display_alternative_link" value="1" <?php echo true == $mltlngg_options['display_alternative_link'] ? ' checked="checked"' : ''; ?> /> <div class="bws_help_box dashicons dashicons-editor-help mltlngg_thumb_block"> <div class="bws_hidden_help_text" style="width: 200px;"> <p><?php printf(__('With this option, there will be added links to your current page for each language from your site into the tag %s', 'multilanguage'), '<head>'); ?> </p> </div> </div> </td> </tr> <tr valign="middle"> <th scope="row"><?php _e("Hide link slug for default language", 'multilanguage'); ?> </th> <td> <input type="checkbox" id="mltlngg_hide_link_slug" name="mltlngg_hide_link_slug" value="1" <?php echo true == $mltlngg_options['hide_link_slug'] ? ' checked="checked"' : ''; ?> /> </td> </tr> <tr valign="middle"> <th scope="row"><?php _e('Default searching by', 'multilanguage'); ?> </th> <td> <fieldset> <label> <input type="radio" name="mltlngg_search" value="single" <?php if ('single' == $mltlngg_options['search']) { echo ' checked'; } ?> /> <?php _e('selected language', 'multilanguage'); ?> </label><br> <label> <input type="radio" name="mltlngg_search" value="all" <?php if ('all' == $mltlngg_options['search']) { echo ' checked'; } ?> /> <?php _e('all available languages', 'multilanguage'); ?> </label> </fieldset> </td> </tr> </table><!-- .form-table --> <?php if (!$bws_hide_premium_options_check) { ?> <div class="bws_pro_version_bloc" style="overflow: visible;"> <div class="bws_pro_version_table_bloc"> <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e('Close', 'multilanguage'); ?> "></button> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="middle"> <th scope="row"><?php _e("Determining the locale using the user's IP", 'multilanguage'); ?> </th> <td> <input type="checkbox" disabled id="mltlngg_determining_locale" name="mltlngg_determining_locale" value="true" /> </td> </tr> <tr valign="middle" class="mltlngg_display_add_block"> <th><?php _e('Update GeoIP', 'multilanguage'); ?> </th> <td> <label style="display: inline-block;margin-right: 20px;"><?php _e('every', 'multilanguage'); ?> <input type="number" value="3" style="width: 50px;" disabled="disabled" /> <?php _e('months', 'multilanguage'); ?> </label> <div style="display: inline-block;position: relative;"> <input type="submit" class="button bwsplgns_need_disable" value="<?php _e('Update now', 'multilanguage'); ?> " disabled="disabled" /> </div> <div class="bws_help_box bws_help_box_left dashicons dashicons-editor-help" style="position: relative;z-index: 10;"> <div class="bws_hidden_help_text" style="min-width: 220px;"> <p style="text-indent: 15px;"> <?php _e('This option allows you to download lists with registered IP addresses all over the world to the database (from', 'multilanguage'); ?> <a href="https://www.maxmind.com" target="_blank">https://www.maxmind.com</a>). </p> <p style="text-indent: 15px;"> <?php _e('With this, you receive an information about each IP address, and to which country it belongs to. You can select the desired frequency for IP database updating', 'multilanguage'); ?> . </p> <p style="text-indent: 15px;"> <?php _e('If you need to update GeoIP immediately, please click on the "Update now" button and wait until the operation is finished', 'multilanguage'); ?> . </p> <noscript> <div class="update-nag" style="margin-top: 0;"><?php _e('Due to the fact that JavaScript is disabled, GeoIP will be updated via wp_cron', 'multilanguage'); ?> .</div> </noscript> <p style="text-indent: 15px;"> <?php _e('Read more about', 'multilanguage'); ?> <a href="https://www.maxmind.com/en/geoip2-services-and-databases" target="_blank">GeoIp</a>. </p> </div> </div> <p id="bwscntrtbl_message"><?php _e('Last update was carried out', 'multilanguage'); ?> 2016-01-22 12:59:04</p> </td> </tr> <tr valign="top"> <th scope="row" colspan="2"> * <?php _e('If you upgrade to Pro version all your settings will be saved.', 'multilanguage'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'multilanguage'); ?> </div> <a class="bws_button" href="http://bestwebsoft.com/products/multilanguage/?k=fa164f00821ed3a87e6f78cb3f5c277b&pn=143&v=<?php echo $mltlngg_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Multilanguage Pro"><?php _e('Learn More', 'multilanguage'); ?> </a> <div class="clear"></div> </div> </div> <?php } ?> <p> <input id="bws-submit-button" type="submit" name="mltlngg_settings_form_submit" class="button-primary" value="<?php _e('Save changes', 'multilanguage'); ?> "> <input type="hidden" name="mltlngg_settings_form_was_send" value="1"> <?php wp_nonce_field('mltlngg_settings_form', 'mltlngg_settings_form_field'); ?> </p> </form><!-- name="mltlngg_settings_form" --> <!-- /table with options form --> <?php bws_form_restore_default_settings(plugin_basename(__FILE__)); } } elseif ('custom_code' == $_GET['tab']) { bws_custom_code_tab(); } elseif ('go_pro' == $_GET['tab']) { bws_go_pro_tab_show($bws_hide_premium_options_check, $mltlngg_plugin_info, plugin_basename(__FILE__), 'mltlngg_settings', 'mltlnggpr_settings', 'multilanguage-pro/multilanguage-pro.php', 'multilanguage', 'fa164f00821ed3a87e6f78cb3f5c277b', '143', isset($go_pro_result['pro_plugin_is_activated'])); } bws_plugin_reviews_block($mltlngg_plugin_info['Name'], 'multilanguage'); ?> </div><!-- .wrap --> <?php }
function gglcptch_settings_page() { global $gglcptch_options, $gglcptch_plugin_info, $wp_version, $gglcptch_allow_url_fopen, $gglcptch_default_options; $plugin_basename = plugin_basename(__FILE__); $message = $error = ''; if (!isset($_GET['action'])) { $all_plugins = get_plugins(); $gglcptch_sizes_v2 = array('normal' => __('Normal', 'google-captcha'), 'compact' => __('Compact', 'google-captcha')); /* Private and public keys */ $gglcptch_keys = array('public' => array('display_name' => __('Site key', 'google-captcha'), 'form_name' => 'gglcptch_public_key', 'error_msg' => ''), 'private' => array('display_name' => __('Secret Key', 'google-captcha'), 'form_name' => 'gglcptch_private_key', 'error_msg' => '')); /* Checked forms */ $gglcptch_forms = array(array('login_form', __('Login form', 'google-captcha')), array('registration_form', __('Registration form', 'google-captcha')), array('reset_pwd_form', __('Reset password form', 'google-captcha')), array('comments_form', __('Comments form', 'google-captcha'))); /* Google captcha themes */ $gglcptch_themes = array(array('red', 'Red'), array('white', 'White'), array('blackglass', 'Blackglass'), array('clean', 'Clean')); /* Save data for settings page */ if (isset($_POST['gglcptch_form_submit']) && check_admin_referer($plugin_basename, 'gglcptch_nonce_name')) { if (isset($_POST['bws_hide_premium_options'])) { $hide_result = bws_hide_premium_options($gglcptch_options); $gglcptch_options = $hide_result['options']; } if (!$_POST['gglcptch_public_key'] || '' == $_POST['gglcptch_public_key']) { $gglcptch_keys['public']['error_msg'] = __('Enter site key', 'google-captcha'); $error = __("WARNING: The captcha will not display while you don't fill key fields.", 'google-captcha'); } else { $gglcptch_keys['public']['error_msg'] = ''; } if (!$_POST['gglcptch_private_key'] || '' == $_POST['gglcptch_private_key']) { $gglcptch_keys['private']['error_msg'] = __('Enter secret key', 'google-captcha'); $error = __("WARNING: The captcha will not display while you don't fill key fields.", 'google-captcha'); } else { $gglcptch_keys['private']['error_msg'] = ''; } $gglcptch_options['public_key'] = trim(stripslashes(esc_html($_POST['gglcptch_public_key']))); $gglcptch_options['private_key'] = trim(stripslashes(esc_html($_POST['gglcptch_private_key']))); $gglcptch_options['login_form'] = isset($_POST['gglcptch_login_form']) ? 1 : 0; $gglcptch_options['registration_form'] = isset($_POST['gglcptch_registration_form']) ? 1 : 0; $gglcptch_options['reset_pwd_form'] = isset($_POST['gglcptch_reset_pwd_form']) ? 1 : 0; $gglcptch_options['comments_form'] = isset($_POST['gglcptch_comments_form']) ? 1 : 0; $gglcptch_options['contact_form'] = isset($_POST['gglcptch_contact_form']) ? 1 : 0; $gglcptch_options['recaptcha_version'] = $_POST['gglcptch_recaptcha_version']; $gglcptch_options['theme'] = $_POST['gglcptch_theme']; $gglcptch_options['theme_v2'] = $_POST['gglcptch_theme_v2']; foreach (get_editable_roles() as $role => $fields) { $gglcptch_options[$role] = isset($_POST['gglcptch_' . $role]) ? 1 : 0; } update_option('gglcptch_options', $gglcptch_options); $message = __('Settings saved', 'google-captcha'); } if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $gglcptch_options = $gglcptch_default_options; update_option('gglcptch_options', $gglcptch_options); $message = __('All plugin settings were restored.', 'google-captcha'); } } $bws_hide_premium_options_check = bws_hide_premium_options_check($gglcptch_options); /* GO PRO */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { $go_pro_result = bws_go_pro_tab_check($plugin_basename, 'gglcptch_options'); if (!empty($go_pro_result['error'])) { $error = $go_pro_result['error']; } elseif (!empty($go_pro_result['message'])) { $message = $go_pro_result['message']; } } ?> <div class="wrap"> <h2><?php _e('Google Captcha Settings', 'google-captcha'); ?> </h2> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=google-captcha.php"><?php _e('Settings', 'google-captcha'); ?> </a> <a class="nav-tab" href="http://bestwebsoft.com/products/google-captcha/faq/" target="_blank"><?php _e('FAQ', 'google-captcha'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> bws_go_pro_tab" href="admin.php?page=google-captcha.php&action=go_pro"><?php _e('Go PRO', 'google-captcha'); ?> </a> </h2> <?php bws_show_settings_notice(); ?> <div class="updated fade" <?php if ("" == $message) { echo 'style="display:none"'; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <div class="error" <?php if ("" == $error) { echo 'style="display:none"'; } ?> ><p><strong><?php echo $error; ?> </strong></p></div> <?php if (!empty($hide_result['message'])) { ?> <div class="updated fade"><p><strong><?php echo $hide_result['message']; ?> </strong></p></div> <?php } if (!$gglcptch_allow_url_fopen && $gglcptch_options['recaptcha_version'] == 'v2') { printf('<div class="error"><p><strong>%s</strong> <a href="http://php.net/manual/en/filesystem.configuration.php" target="_blank">%s</a></p></div>', __('Google Captcha version 2 will not work correctly, since the option "allow_url_fopen" is disabled in the PHP settings of your hosting.', 'google-captcha'), __('Read more.', 'google-captcha')); } if (!isset($_GET['action'])) { if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } else { ?> <p><?php _e('If you would like to add the Google Captcha to your own form, just copy and paste this shortcode to your form:', 'google-captcha'); ?> <span class="bws_code">[bws_google_captcha]</span></p> <form class="bws_form" method="post" action="admin.php?page=google-captcha.php"> <h3><?php _e('Authentication', 'google-captcha'); ?> </h3> <p><?php printf(__('Before you are able to do something, you must to register %s here %s', 'google-captcha'), '<a target="_blank" href="https://www.google.com/recaptcha/admin#list">', '</a>.'); ?> </p> <p><?php _e('Enter site key and secret key, that you get after registration.', 'google-captcha'); ?> </p> <table id="gglcptch-keys" class="form-table"> <?php foreach ($gglcptch_keys as $key => $fields) { ?> <tr valign="top"> <th scope="row"><?php echo $fields['display_name']; ?> </th> <td> <input type="text" name="<?php echo $fields['form_name']; ?> " value="<?php echo $gglcptch_options[$key . '_key']; ?> " maxlength="200" /> <label class="gglcptch_error_msg"><?php echo $fields['error_msg']; ?> </label> </td> </tr> <?php } ?> </table> <h3><?php _e('Options', 'google-captcha'); ?> </h3> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Enable reCAPTCHA for', 'google-captcha'); ?> </th> <td> <?php foreach ($gglcptch_forms as $form) { ?> <label><input type="checkbox" name="<?php echo 'gglcptch_' . $form[0]; ?> " value=<?php echo $form[0]; if ('1' == $gglcptch_options[$form[0]]) { echo ' checked'; } ?> > <?php echo $form[1]; ?> </label><br /> <?php } if (isset($all_plugins['contact-form-plugin/contact_form.php']) || isset($all_plugins['contact-form-pro/contact_form_pro.php'])) { if (is_plugin_active('contact-form-plugin/contact_form.php') || is_plugin_active('contact-form-pro/contact_form_pro.php')) { ?> <label><input type="checkbox" name="gglcptch_contact_form" value="contact_form"<?php if ('1' == $gglcptch_options['contact_form']) { echo ' checked'; } ?> > Contact Form</label> <span class="bws_info">(<?php _e('powered by', 'google-captcha'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>)</span><br /> <?php } else { ?> <label><input type="checkbox" disabled name="gglcptch_contact_form" value="contact_form"<?php if ('1' == $gglcptch_options['contact_form']) { echo ' checked'; } ?> > Contact Form</label> <span class="bws_info">(<?php _e('powered by', 'google-captcha'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="<?php echo admin_url('plugins.php'); ?> "><?php _e('Activate', 'google-captcha'); ?> Contact Form</a></span><br /> <?php } } else { ?> <label><input type="checkbox" disabled name="gglcptch_contact_form" value="contact_form"<?php if ('1' == $gglcptch_options['contact_form']) { echo ' checked'; } ?> > Contact Form</label> <span class="bws_info">(<?php _e('powered by', 'google-captcha'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="http://bestwebsoft.com/products/contact-form/?k=d70b58e1739ab4857d675fed2213cedc&pn=75&v=<?php echo $gglcptch_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> "><?php _e('Download', 'google-captcha'); ?> Contact Form</a></span><br /> <?php } ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Hide reCAPTCHA in Comments form for', 'google-captcha'); ?> </th> <td> <?php foreach (get_editable_roles() as $role => $fields) { ?> <label><input type="checkbox" name="<?php echo 'gglcptch_' . $role; ?> " value=<?php echo $role; if (isset($gglcptch_options[$role]) && '1' == $gglcptch_options[$role]) { echo ' checked'; } ?> > <?php echo $fields['name']; ?> </label><br/> <?php } ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('reCAPTCHA version', 'google-captcha'); ?> </th> <td> <fieldset> <label><input type="radio" name="gglcptch_recaptcha_version" value="v1"<?php if ('v1' == $gglcptch_options['recaptcha_version']) { echo ' checked="checked"'; } ?> > <?php _e('version', 'google-captcha'); ?> 1</label><br/> <label><input type="radio" name="gglcptch_recaptcha_version" value="v2"<?php if ('v2' == $gglcptch_options['recaptcha_version']) { echo ' checked="checked"'; } ?> > <?php _e('version', 'google-captcha'); ?> 2</label> </fieldset> </td> </tr> <tr class="gglcptch_theme_v1" valign="top"> <th scope="row"> <?php _e('reCAPTCHA theme', 'google-captcha'); ?> <br/><span class="bws_info">(<?php _e('for version', 'google-captcha'); ?> 1)</span> </th> <td> <select name="gglcptch_theme"> <?php foreach ($gglcptch_themes as $theme) { ?> <option value=<?php echo $theme[0]; if ($theme[0] == $gglcptch_options['theme']) { echo ' selected'; } ?> > <?php echo $theme[1]; ?> </option> <?php } ?> </select> </td> </tr> <tr class="gglcptch_theme_v2" valign="top"> <th scope="row"> <?php _e('reCAPTCHA theme', 'google-captcha'); ?> <br/><span class="bws_info">(<?php _e('for version', 'google-captcha'); ?> 2)</span> </th> <td> <select name="gglcptch_theme_v2"> <option value="light" <?php if ('light' == $gglcptch_options['theme_v2']) { echo ' selected'; } ?> >light</option> <option value="dark" <?php if ('dark' == $gglcptch_options['theme_v2']) { echo ' selected'; } ?> >dark</option> </select> </td> </tr> </table> <?php if (!$bws_hide_premium_options_check) { ?> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e('Close', 'google-captcha'); ?> "></button> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <th scope="row"><?php _e('reCAPTCHA language', 'google-captcha'); ?> </th> <td> <select disabled name="gglcptch_language"> <option value="en" selected="selected">English (US)</option> </select> <div style="margin: 5px 0 0;"> <?php $gglcptch_multilanguage = $gglcptch_use_multilanguage = $gglcptch_multilanguage_message = ''; if (array_key_exists('multilanguage/multilanguage.php', $all_plugins) || array_key_exists('multilanguage-pro/multilanguage-pro.php', $all_plugins)) { if (is_plugin_active('multilanguage/multilanguage.php') || is_plugin_active('multilanguage-pro/multilanguage-pro.php')) { $gglcptch_use_multilanguage = $gglcptch_options["use_multilanguage_locale"] == 1 ? 'checked="checked"' : ''; } else { $gglcptch_multilanguage = 'disabled="disabled"'; $gglcptch_multilanguage_message = sprintf('<a href="plugins.php">%s Multilanguage</a>', __('Activate', 'google-captcha')); } } else { $gglcptch_multilanguage = 'disabled="disabled"'; $gglcptch_multilanguage_message = sprintf('<a href="http://bestwebsoft.com/products/multilanguage/?k=390f8e0d92066f2b73a14429d02dcee7&pn=281&v=%s&wp_v=%s">%s Multilanguage</a>', $gglcptch_plugin_info["Version"], $wp_version, __('Download', 'google-captcha')); } ?> <input id="gglcptch_use_multilanguage_locale" type="checkbox" name="gglcptch_use_multilanguage_locale" value="1" <?php printf('%s %s', $gglcptch_use_multilanguage, $gglcptch_multilanguage); ?> /> <label for="gglcptch_use_multilanguage_locale"><?php _e('Use the current site language', 'google-captcha'); ?> </label> <span class="bws_info">(<?php _e('Using', 'google-captcha'); ?> Multilanguage by BestWebSoft) <?php echo $gglcptch_multilanguage_message; ?> </span> </div> </td> </tr> <tr valign="top"> <th scope="row"> <?php _e('reCAPTCHA size', 'google-captcha'); ?> <br/><span class="bws_info">(<?php _e('for version', 'google-captcha'); ?> 2)</span> </th> <td><fieldset> <?php foreach ($gglcptch_sizes_v2 as $value => $name) { printf('<div class="gglcptch_size_v2"><label><input disabled type="radio" name="gglcptch_size_v2" value="%s"%s> %s</label></div>', $value, $name == 'Normal' ? ' checked="checked"' : '', $name); } ?> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"> <strong>Contact Form 7</strong><br/> <?php _e('Enable CAPTCHA', 'google-captcha'); ?> </th> <td> <?php if (array_key_exists('contact-form-7/wp-contact-form-7.php', $all_plugins)) { if (is_plugin_active('contact-form-7/wp-contact-form-7.php')) { ?> <br/><input disabled='disabled' type="checkbox" name="gglcptchpr_cf7" value="1" /> <?php } else { ?> <span class="bws_info"><?php _e('You should', 'google-captcha'); ?> <a href="<?php echo admin_url('plugins.php'); ?> "><?php _e('activate', 'google-captcha'); ?> Contact Form 7</a> <?php _e('to use this functionality', 'google-captcha'); ?> </span><br/> <input disabled='disabled' type="checkbox" name="gglcptchpr_cf7" value="1" /> <?php } } else { ?> <span class="bws_info"><?php _e('You should', 'google-captcha'); ?> <a target="_blank" href="http://wordpress.org/plugins/contact-form-7/"><?php _e('download', 'google-captcha'); ?> Contact Form 7</a> <?php _e('to use this functionality', 'google-captcha'); ?> </span><br/> <input disabled='disabled' type="checkbox" name="gglcptchpr_cf7" value="1" /> <?php } ?> </td> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'google-captcha'); ?> </div> <a class="bws_button" href="http://bestwebsoft.com/products/google-captcha/?k=b850d949ccc1239cab0da315c3c822ab&pn=109&v=<?php echo $gglcptch_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Google Captcha Pro (reCAPTCHA)"> <?php _e('Learn More', 'google-captcha'); ?> </a> <div class="clear"></div> </div> </div> <?php } ?> <p class="submit"> <input id="bws-submit-button" type="submit" class="button-primary" value="<?php _e('Save Changes', 'google-captcha'); ?> " name="gglcptch_save_changes" /> <input type="hidden" name="gglcptch_form_submit" value="submit" /> <?php wp_nonce_field($plugin_basename, 'gglcptch_nonce_name'); ?> </p> </form> <?php bws_form_restore_default_settings($plugin_basename); } } elseif ('go_pro' == $_GET['action']) { bws_go_pro_tab_show($bws_hide_premium_options_check, $gglcptch_plugin_info, $plugin_basename, 'google-captcha.php', 'google-captcha-pro.php', 'google-captcha-pro/google-captcha-pro.php', 'google-captcha', 'b850d949ccc1239cab0da315c3c822ab', '109', isset($go_pro_result['pro_plugin_is_activated'])); } bws_plugin_reviews_block($gglcptch_plugin_info['Name'], 'google-captcha'); ?> </div> <?php }
function gglcptch_settings_page() { global $gglcptch_options, $gglcptch_plugin_info, $wp_version, $gglcptch_default_options; $plugin_basename = plugin_basename(__FILE__); $message = $error = ''; $all_plugins = get_plugins(); $is_network = is_multisite() && is_network_admin(); $is_main_site = is_main_site(get_current_blog_id()); $admin_url = $is_network ? network_admin_url('/') : admin_url('/'); $bws_contact_form = gglcptch_plugin_status(array('contact-form-plugin/contact_form.php', 'contact-form-pro/contact_form_pro.php'), $all_plugins, $is_network); if (!isset($_GET['action'])) { $all_plugins = get_plugins(); $gglcptch_sizes_v2 = array('normal' => __('Normal', 'google-captcha'), 'compact' => __('Compact', 'google-captcha')); /* Private and public keys */ $gglcptch_keys = array('public' => array('display_name' => __('Site key', 'google-captcha'), 'form_name' => 'gglcptch_public_key', 'error_msg' => ''), 'private' => array('display_name' => __('Secret Key', 'google-captcha'), 'form_name' => 'gglcptch_private_key', 'error_msg' => '')); /* Checked forms */ $gglcptch_forms = array(array('login_form', __('Login form', 'google-captcha')), array('registration_form', __('Registration form', 'google-captcha')), array('reset_pwd_form', __('Reset password form', 'google-captcha')), array('comments_form', __('Comments form', 'google-captcha'))); /* Google captcha themes */ $gglcptch_themes = array(array('red', 'Red'), array('white', 'White'), array('blackglass', 'Blackglass'), array('clean', 'Clean')); /* Save data for settings page */ if (isset($_POST['gglcptch_form_submit']) && check_admin_referer($plugin_basename, 'gglcptch_nonce_name')) { if (isset($_POST['bws_hide_premium_options'])) { $hide_result = bws_hide_premium_options($gglcptch_options); $gglcptch_options = $hide_result['options']; } if (!$_POST['gglcptch_public_key'] || '' == $_POST['gglcptch_public_key']) { $gglcptch_keys['public']['error_msg'] = __('Enter site key', 'google-captcha'); $error = __("WARNING: The captcha will not display while you don't fill key fields.", 'google-captcha'); } else { $gglcptch_keys['public']['error_msg'] = ''; } if (!$_POST['gglcptch_private_key'] || '' == $_POST['gglcptch_private_key']) { $gglcptch_keys['private']['error_msg'] = __('Enter secret key', 'google-captcha'); $error = __("WARNING: The captcha will not display while you don't fill key fields.", 'google-captcha'); } else { $gglcptch_keys['private']['error_msg'] = ''; } $gglcptch_options['public_key'] = trim(stripslashes(esc_html($_POST['gglcptch_public_key']))); $gglcptch_options['private_key'] = trim(stripslashes(esc_html($_POST['gglcptch_private_key']))); $gglcptch_options['login_form'] = isset($_POST['gglcptch_login_form']) ? 1 : 0; $gglcptch_options['registration_form'] = isset($_POST['gglcptch_registration_form']) ? 1 : 0; $gglcptch_options['reset_pwd_form'] = isset($_POST['gglcptch_reset_pwd_form']) ? 1 : 0; $gglcptch_options['comments_form'] = isset($_POST['gglcptch_comments_form']) ? 1 : 0; $gglcptch_options['contact_form'] = isset($_POST['gglcptch_contact_form']) ? 1 : 0; $gglcptch_options['recaptcha_version'] = $_POST['gglcptch_recaptcha_version']; $gglcptch_options['theme'] = $_POST['gglcptch_theme']; $gglcptch_options['theme_v2'] = $_POST['gglcptch_theme_v2']; if (function_exists('get_editable_roles')) { foreach (get_editable_roles() as $role => $fields) { $gglcptch_options[$role] = isset($_POST['gglcptch_' . $role]) ? 1 : 0; } } update_option('gglcptch_options', $gglcptch_options); $message = __('Settings saved', 'google-captcha'); } if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $gglcptch_options = $gglcptch_default_options; update_option('gglcptch_options', $gglcptch_options); $message = __('All plugin settings were restored.', 'google-captcha'); } } $bws_hide_premium_options_check = bws_hide_premium_options_check($gglcptch_options); /* GO PRO */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { $go_pro_result = bws_go_pro_tab_check($plugin_basename, 'gglcptch_options'); if (!empty($go_pro_result['error'])) { $error = $go_pro_result['error']; } elseif (!empty($go_pro_result['message'])) { $message = $go_pro_result['message']; } } ?> <div class="wrap"> <h1 style="line-height: normal;"><?php _e('Google Captcha Settings', 'google-captcha'); ?> </h1> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=google-captcha.php"><?php _e('Settings', 'google-captcha'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> bws_go_pro_tab" href="admin.php?page=google-captcha.php&action=go_pro"><?php _e('Go PRO', 'google-captcha'); ?> </a> </h2> <?php if (!isset($_GET['action']) && !isset($_REQUEST['bws_restore_default'])) { if (!gglcptch_get_allow_url_fopen() && $gglcptch_options['recaptcha_version'] == 'v2') { printf('<div class="error inline"><p><strong>%s</strong></p></div>', __('Google Captcha version 2 will not work correctly, since the option "allow_url_fopen" is disabled. Please contact your hosting support service.', 'google-captcha')); } if ($gglcptch_options['recaptcha_version'] == 'v1') { printf('<div id="gglcptch_v1_notice" class="updated inline"><p><strong>%s</strong></p></div>', __("Only one reCAPTCHA can be displayed on the page, it's related to reCAPTCHA version 1 features.", 'google-captcha')); } } bws_show_settings_notice(); ?> <div class="updated fade inline" <?php if ("" == $message) { echo 'style="display:none"'; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <div class="error inline" <?php if ("" == $error) { echo 'style="display:none"'; } ?> ><p><strong><?php echo $error; ?> </strong></p></div> <?php if (!empty($hide_result['message'])) { ?> <div class="updated fade inline"><p><strong><?php echo $hide_result['message']; ?> </strong></p></div> <?php } if (!isset($_GET['action'])) { if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } else { ?> <div style="margin: 20px 0;"> <?php printf(__("If you would like to add a Google Captcha (reCAPTCHA) to your page or post, please use %s button", 'google-captcha'), '<span class="bws_code"><img style="vertical-align: sub;" src="' . plugins_url('bws_menu/images/shortcode-icon.png', __FILE__) . '" alt=""/></span>'); ?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help" style="vertical-align: middle;"> <div class="bws_hidden_help_text" style="min-width: 260px;"> <?php printf(__("You can add the Google Captcha (reCAPTCHA) to your page or post by clicking on %s button in the content edit block using the Visual mode. If the button isn't displayed or you would like to add the Google Captcha (reCAPTCHA) to your own form , please use the shortcode %s", 'google-captcha'), '<code><img style="vertical-align: sub;" src="' . plugins_url('bws_menu/images/shortcode-icon.png', __FILE__) . '" alt="" /></code>', sprintf('<span class="bws_code">[bws_google_captcha]</span><br/>')); ?> </div> </div> </div> <form class="bws_form" method="post" action="admin.php?page=google-captcha.php"> <h3><?php _e('Authentication', 'google-captcha'); ?> </h3> <p><?php printf(__('Before you are able to do something, you must to register %shere%s', 'google-captcha'), '<a target="_blank" href="https://www.google.com/recaptcha/admin#list">', '</a>.'); ?> </p> <p><?php _e('Enter site key and secret key, that you get after registration.', 'google-captcha'); ?> </p> <table id="gglcptch-keys" class="form-table"> <?php foreach ($gglcptch_keys as $key => $fields) { ?> <tr valign="top"> <th scope="row"><?php echo $fields['display_name']; ?> </th> <td> <input type="text" name="<?php echo $fields['form_name']; ?> " value="<?php echo $gglcptch_options[$key . '_key']; ?> " maxlength="200" /> <label class="gglcptch_error_msg"><?php echo $fields['error_msg']; ?> </label> </td> </tr> <?php } ?> </table> <h3><?php _e('Options', 'google-captcha'); ?> </h3> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Enable reCAPTCHA for', 'google-captcha'); ?> </th> <td> <fieldset> <p> <i><?php _e('WordPress default', 'google-captcha'); ?> </i> </p> <?php foreach ($gglcptch_forms as $form) { $gglcptch_form_type = $form[0]; $gglcptch_form_name = $form[1]; $gglcptch_form_attr = '1' == $gglcptch_options[$gglcptch_form_type] ? 'checked="checked"' : ''; $gglcptch_form_notice = ''; if (($gglcptch_form_type == 'registration_form' || $gglcptch_form_type == 'reset_pwd_form') && !$is_main_site) { $gglcptch_form_notice .= sprintf('<span class="bws_info">%s</span>', __('This option is available only for network or for main blog', 'google-captcha')); $gglcptch_form_attr = 'disabled="disabled" readonly="readonly"'; } ?> <label><input type="checkbox" name="<?php echo 'gglcptch_' . $gglcptch_form_type; ?> " value="<?php echo $gglcptch_form_type; ?> " <?php echo $gglcptch_form_attr; ?> /> <?php echo $gglcptch_form_name; ?> </label> <div class="bws_help_box dashicons dashicons-editor-help" style="vertical-align: middle;"><div class="bws_hidden_help_text"><img src="<?php echo plugins_url('google-captcha/images') . '/' . $gglcptch_form_type; ?> .jpg" title="<?php echo $gglcptch_form_name; ?> " alt="<?php echo $gglcptch_form_name; ?> "></div></div> <?php echo $gglcptch_form_notice; ?> <br /> <?php } ?> <br /> <p> <i><?php _e('Plugins', 'google-captcha'); ?> </i> </p> <?php /* Check Contact Form by BestWebSoft */ $gglcptch_plugin = $bws_contact_form; $gglcptch_plugin_name = 'Contact Form by BestWebSoft'; $gglcptch_attrs = $gglcptch_plugin_notice = ''; if ('deactivated' == $gglcptch_plugin['status']) { $gglcptch_attrs = 'disabled="disabled"'; $gglcptch_plugin_notice = sprintf(__('You should %s to use this functionality', 'google-captcha'), sprintf('<a href="%splugins.php">%s%s %s</a>', $admin_url, __('activate', 'google-captcha'), is_network_admin() ? ' ' . __('for network', 'google-captcha') : '', $gglcptch_plugin_name)); } elseif ('not_installed' == $gglcptch_plugin['status']) { $gglcptch_attrs = 'disabled="disabled"'; $gglcptch_plugin_notice = sprintf(__('You should %s to use this functionality', 'google-captcha'), sprintf('<a href="http://bestwebsoft.com/products/contact-form/?k=d70b58e1739ab4857d675fed2213cedc&pn=75&v=%s&wp_v=%s">%s %s</a>', $gglcptch_plugin_info["Version"], $wp_version, __('download', 'google-captcha'), $gglcptch_plugin_name)); } if ('1' == $gglcptch_options['contact_form'] && $gglcptch_attrs == '') { $gglcptch_attrs .= ' checked="checked"'; } ?> <label><input type="checkbox" <?php echo $gglcptch_attrs; ?> name="gglcptch_contact_form" value="contact_form" /> <?php echo $gglcptch_plugin_name; ?> </label> <div class="bws_help_box dashicons dashicons-editor-help" style="vertical-align: middle;"><div class="bws_hidden_help_text"><img src="<?php echo plugins_url('google-captcha/images'); ?> /contact_form.jpg" title="<?php echo $gglcptch_plugin_name; ?> " alt="<?php echo $gglcptch_plugin_name; ?> "></div></div> <span class="bws_info"><?php echo $gglcptch_plugin_notice; ?> </span><br /> <?php if (!$bws_hide_premium_options_check) { ?> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e('Close', 'google-captcha'); ?> "></button> <div class="bws_table_bg"></div> <div class="bws_pro_version"> <label><input disabled="disabled" type="checkbox" disabled="disabled" name="gglcptch_sbscrbr" value="1"> Subscriber by BestWebSoft</label><br> <label><input disabled="disabled" type="checkbox" disabled="disabled" name="gglcptch_cf7" value="1"> Contact Form 7</label><br> <label><input disabled="disabled" type="checkbox" disabled="disabled" name="gglcptch_buddypress_register" value="1"> BuddyPress Registration form</label><br> <label><input disabled="disabled" type="checkbox" disabled="disabled" name="gglcptch_buddypress_comments" value="1"> BuddyPress Comments form</label><br> <label><input disabled="disabled" type="checkbox" disabled="disabled" name="gglcptch_buddypress_group" value="1"> BuddyPress "Create a Group" form</label> </div> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'google-captcha'); ?> </div> <a class="bws_button" href="http://bestwebsoft.com/products/google-captcha/?k=b850d949ccc1239cab0da315c3c822ab&pn=109&v=<?php echo $gglcptch_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Google Captcha Pro (reCAPTCHA)"> <?php _e('Learn More', 'google-captcha'); ?> </a> <div class="clear"></div> </div> </div><br> <?php } ?> <span class="bws_info"><?php printf(__('If you would like to add Google Captcha (reCAPTCHA) to a custom form see %s', 'google-captcha'), sprintf('<a href="http://bestwebsoft.com/products/google-captcha/faq/" target="_blank">%s</a>', __('FAQ', 'google-captcha'))); ?> </span> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Hide reCAPTCHA in Comments form for', 'google-captcha'); ?> </th> <td> <fieldset> <?php if (function_exists('get_editable_roles')) { foreach (get_editable_roles() as $role => $fields) { ?> <label><input type="checkbox" name="<?php echo 'gglcptch_' . $role; ?> " value=<?php echo $role; if (isset($gglcptch_options[$role]) && '1' == $gglcptch_options[$role]) { echo ' checked'; } ?> > <?php echo $fields['name']; ?> </label><br/> <?php } } ?> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('reCAPTCHA version', 'google-captcha'); ?> </th> <td> <fieldset> <label><input type="radio" name="gglcptch_recaptcha_version" value="v1"<?php if ('v1' == $gglcptch_options['recaptcha_version']) { echo ' checked="checked"'; } ?> > <?php _e('version', 'google-captcha'); ?> 1</label> <div class="bws_help_box dashicons dashicons-editor-help" style="vertical-align: middle;"><div class="bws_hidden_help_text"><img src="<?php echo plugins_url('google-captcha/images'); ?> /recaptcha_v1.png" title="reCAPTCHA <?php _e('version', 'google-captcha'); ?> 1" alt="reCAPTCHA <?php _e('version', 'google-captcha'); ?> 1"></div></div><br/> <label><input type="radio" name="gglcptch_recaptcha_version" value="v2"<?php if ('v2' == $gglcptch_options['recaptcha_version']) { echo ' checked="checked"'; } ?> > <?php _e('version', 'google-captcha'); ?> 2</label> <div class="bws_help_box dashicons dashicons-editor-help" style="vertical-align: middle;"><div class="bws_hidden_help_text"><img src="<?php echo plugins_url('google-captcha/images'); ?> /recaptcha_v2.png" title="reCAPTCHA <?php _e('version', 'google-captcha'); ?> 2" alt="reCAPTCHA <?php _e('version', 'google-captcha'); ?> 2"></div></div> </fieldset> </td> </tr> <tr class="gglcptch_theme_v1" valign="top"> <th scope="row"> <?php _e('reCAPTCHA theme', 'google-captcha'); ?> <br/><span class="bws_info">(<?php _e('for version', 'google-captcha'); ?> 1)</span> </th> <td> <select name="gglcptch_theme"> <?php foreach ($gglcptch_themes as $theme) { ?> <option value=<?php echo $theme[0]; if ($theme[0] == $gglcptch_options['theme']) { echo ' selected'; } ?> > <?php echo $theme[1]; ?> </option> <?php } ?> </select> </td> </tr> <tr class="gglcptch_theme_v2" valign="top"> <th scope="row"> <?php _e('reCAPTCHA theme', 'google-captcha'); ?> <br/><span class="bws_info">(<?php _e('for version', 'google-captcha'); ?> 2)</span> </th> <td> <select name="gglcptch_theme_v2"> <option value="light" <?php if ('light' == $gglcptch_options['theme_v2']) { echo ' selected'; } ?> >light</option> <option value="dark" <?php if ('dark' == $gglcptch_options['theme_v2']) { echo ' selected'; } ?> >dark</option> </select> </td> </tr> </table> <?php if (!$bws_hide_premium_options_check) { ?> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e('Close', 'google-captcha'); ?> "></button> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <th scope="row"><?php _e('reCAPTCHA language', 'google-captcha'); ?> </th> <td> <select disabled="disabled" name="gglcptch_language"> <option value="en" selected="selected">English (US)</option> </select> <div style="margin: 5px 0 0;"> <input disabled="disabled" id="gglcptch_use_multilanguage_locale" type="checkbox" name="gglcptch_use_multilanguage_locale" value="1" /> <label for="gglcptch_use_multilanguage_locale"><?php _e('Use the current site language', 'google-captcha'); ?> </label> <span class="bws_info">(<?php _e('Using', 'google-captcha'); ?> Multilanguage by BestWebSoft)</span> </div> </td> </tr> <tr valign="top"> <th scope="row"> <?php _e('reCAPTCHA size', 'google-captcha'); ?> <br/><span class="bws_info">(<?php _e('for version', 'google-captcha'); ?> 2)</span> </th> <td><fieldset> <?php foreach ($gglcptch_sizes_v2 as $value => $name) { printf('<div class="gglcptch_size_v2"><label><input disabled="disabled" type="radio" name="gglcptch_size_v2" value="%s"%s> %s</label></div>', $value, $name == 'Normal' ? ' checked="checked"' : '', $name); } ?> </fieldset> </td> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'google-captcha'); ?> </div> <a class="bws_button" href="http://bestwebsoft.com/products/google-captcha/?k=b850d949ccc1239cab0da315c3c822ab&pn=109&v=<?php echo $gglcptch_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Google Captcha Pro (reCAPTCHA)"> <?php _e('Learn More', 'google-captcha'); ?> </a> <div class="clear"></div> </div> </div> <?php } ?> <p class="submit"> <input id="bws-submit-button" type="submit" class="button-primary" value="<?php _e('Save Changes', 'google-captcha'); ?> " name="gglcptch_save_changes" /> <input type="hidden" name="gglcptch_form_submit" value="submit" /> <?php wp_nonce_field($plugin_basename, 'gglcptch_nonce_name'); ?> </p> </form> <?php bws_form_restore_default_settings($plugin_basename); } } elseif ('go_pro' == $_GET['action']) { bws_go_pro_tab_show($bws_hide_premium_options_check, $gglcptch_plugin_info, $plugin_basename, 'google-captcha.php', 'google-captcha-pro.php', 'google-captcha-pro/google-captcha-pro.php', 'google-captcha', 'b850d949ccc1239cab0da315c3c822ab', '109', isset($go_pro_result['pro_plugin_is_activated'])); } bws_plugin_reviews_block($gglcptch_plugin_info['Name'], 'google-captcha'); ?> </div> <?php }
function cptch_settings_page() { global $cptch_options, $wp_version, $cptch_plugin_info, $cptch_option_defaults; $error = $message = ""; $plugin_basename = plugin_basename(__FILE__); /* These fields for the 'Enable CAPTCHA on the' block which is located at the admin setting captcha page */ $cptch_admin_fields_enable = array(array('cptch_login_form', __('Login form', 'captcha'), 'login_form.jpg'), array('cptch_register_form', __('Registration form', 'captcha'), 'register_form.jpg'), array('cptch_lost_password_form', __('Reset Password form', 'captcha'), 'lost_password_form.jpg'), array('cptch_comments_form', __('Comments form', 'captcha'), 'comment_form.jpg')); $cptch_admin_fields_hide = array(array('cptch_hide_register', __('in Comments form for registered users', 'captcha'))); /* These fields for the 'Arithmetic actions for CAPTCHA' block which is located at the admin setting captcha page */ $cptch_admin_fields_actions = array(array('cptch_math_action_plus', __('Plus (+)', 'captcha'), __('Plus', 'captcha')), array('cptch_math_action_minus', __('Minus (−)', 'captcha'), __('Minus', 'captcha')), array('cptch_math_action_increase', __('Multiplication (×)', 'captcha'), __('Multiply', 'captcha'))); /* This fields for the 'Difficulty for CAPTCHA' block which is located at the admin setting captcha page */ $cptch_admin_fields_difficulty = array(array('cptch_difficulty_number', __('Numbers', 'captcha'), __('Numbers', 'captcha')), array('cptch_difficulty_word', __('Words', 'captcha'), __('Words', 'captcha'))); if (!function_exists('get_plugins')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $all_plugins = get_plugins(); /* Save data for settings page */ if (isset($_REQUEST['cptch_form_submit']) && check_admin_referer($plugin_basename, 'cptch_nonce_name')) { $cptch_request_options = array(); $cptch_request_options['cptch_login_form'] = isset($_REQUEST['cptch_login_form']) ? 1 : 0; $cptch_request_options['cptch_register_form'] = isset($_REQUEST['cptch_register_form']) ? 1 : 0; $cptch_request_options['cptch_lost_password_form'] = isset($_REQUEST['cptch_lost_password_form']) ? 1 : 0; $cptch_request_options['cptch_comments_form'] = isset($_REQUEST['cptch_comments_form']) ? 1 : 0; $cptch_request_options['cptch_hide_register'] = isset($_REQUEST['cptch_hide_register']) ? 1 : 0; $cptch_request_options['cptch_contact_form'] = isset($_REQUEST['cptch_contact_form']) ? 1 : 0; $cptch_request_options['cptch_label_form'] = isset($_REQUEST['cptch_label_form']) ? stripslashes(esc_html($_REQUEST['cptch_label_form'])) : ''; $cptch_request_options['cptch_required_symbol'] = isset($_REQUEST['cptch_required_symbol']) ? stripslashes(esc_html($_REQUEST['cptch_required_symbol'])) : ''; $cptch_request_options['cptch_error_empty_value'] = isset($_REQUEST['cptch_error_empty_value']) ? stripslashes(esc_html($_REQUEST['cptch_error_empty_value'])) : ''; $cptch_request_options['cptch_error_incorrect_value'] = isset($_REQUEST['cptch_error_incorrect_value']) ? stripslashes(esc_html($_REQUEST['cptch_error_incorrect_value'])) : ''; if ($cptch_request_options['cptch_error_empty_value'] == '') { $cptch_request_options['cptch_error_empty_value'] = $cptch_option_defaults['cptch_error_empty_value']; } if ($cptch_request_options['cptch_error_incorrect_value'] == '') { $cptch_request_options['cptch_error_incorrect_value'] = $cptch_option_defaults['cptch_error_incorrect_value']; } $cptch_request_options['cptch_math_action_plus'] = isset($_REQUEST['cptch_math_action_plus']) ? 1 : 0; $cptch_request_options['cptch_math_action_minus'] = isset($_REQUEST['cptch_math_action_minus']) ? 1 : 0; $cptch_request_options['cptch_math_action_increase'] = isset($_REQUEST['cptch_math_action_increase']) ? 1 : 0; $cptch_request_options['cptch_difficulty_number'] = isset($_REQUEST['cptch_difficulty_number']) ? 1 : 0; $cptch_request_options['cptch_difficulty_word'] = isset($_REQUEST['cptch_difficulty_word']) ? 1 : 0; /* Array merge incase this version has added new options */ $cptch_options = array_merge($cptch_options, $cptch_request_options); /* Check select one point in the blocks Arithmetic actions and Difficulty on settings page */ if (!isset($_REQUEST['cptch_difficulty_number']) && !isset($_REQUEST['cptch_difficulty_word']) || !isset($_REQUEST['cptch_math_action_plus']) && !isset($_REQUEST['cptch_math_action_minus']) && !isset($_REQUEST['cptch_math_action_increase'])) { $error = __("Please select one item in the block Arithmetic and Complexity for CAPTCHA", 'captcha'); } else { /* Update options in the database */ update_option('cptch_options', $cptch_options); $message = __("Settings saved.", 'captcha'); } } if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $cptch_options = $cptch_option_defaults; update_option('cptch_options', $cptch_options); $message = __('All plugin settings were restored.', 'captcha'); } /* GO PRO */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { $go_pro_result = bws_go_pro_tab_check($plugin_basename); if (!empty($go_pro_result['error'])) { $error = $go_pro_result['error']; } } /* Display form on the setting page */ ?> <div class="wrap"> <div class="icon32 icon32-bws" id="icon-options-general"></div> <h2><?php _e('Captcha Settings', 'captcha'); ?> </h2> <ul class="subsubsub cptch_how_to_use""> <li><a href="https://docs.google.com/document/d/11_TUSAjMjG7hLa53lmyTZ1xox03hNlEA4tRmllFep3I/edit" target="_blank"><?php _e('How to Use Step-by-step Instruction', 'captcha'); ?> </a></li> </ul> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=captcha.php"><?php _e('Settings', 'captcha'); ?> </a> <a class="nav-tab <?php if (isset($_GET['action']) && 'whitelist' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=captcha.php&action=whitelist"><?php _e('Whitelist', 'captcha'); ?> </a> <a class="nav-tab" href="http://bestwebsoft.com/products/captcha/faq/" target="_blank"><?php _e('FAQ', 'captcha'); ?> </a> <a class="nav-tab bws_go_pro_tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=captcha.php&action=go_pro"><?php _e('Go PRO', 'captcha'); ?> </a> </h2> <div id="cptch_settings_notice" class="updated fade" style="display:none"><p><strong><?php _e("Notice:", 'captcha'); ?> </strong> <?php _e("The plugin's settings have been changed. In order to save them please don't forget to click the 'Save Changes' button.", 'captcha'); ?> </p></div> <div class="updated fade" <?php if ('' == $message || "" != $error) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <div class="error" <?php if ("" == $error) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $error; ?> </strong></p></div> <?php if (!isset($_GET['action'])) { if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } else { ?> <form id="cptch_settings_form" method="post" action="admin.php?page=captcha.php"> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Enable CAPTCHA for:', 'captcha'); ?> </th> <td><fieldset> <legend class="screen-reader-text"><span><?php _e('Arithmetic actions for CAPTCHA', 'captcha'); ?> </span></legend> <?php foreach ($cptch_admin_fields_enable as $fields) { ?> <label><input type="checkbox" name="<?php echo $fields[0]; ?> " value="<?php echo $fields[0]; ?> " <?php if (1 == $cptch_options[$fields[0]]) { echo "checked=\"checked\""; } ?> /> <?php echo __($fields[1], 'captcha'); ?> </label> <div class="cptch_help_box cptch_thumb_block"> <div class="cptch_hidden_help_text cptch_thumb"><img src="<?php echo plugins_url('captcha/images') . '/' . $fields[2]; ?> " title="<?php echo $fields[1]; ?> " alt="<?php echo $fields[1]; ?> "/></div> </div><br /> <?php } if (array_key_exists('contact-form-plugin/contact_form.php', $all_plugins) || array_key_exists('contact-form-pro/contact_form_pro.php', $all_plugins)) { if (is_plugin_active('contact-form-plugin/contact_form.php') || is_plugin_active('contact-form-pro/contact_form_pro.php')) { ?> <label><input type="checkbox" name="cptch_contact_form" value="1" <?php if (1 == $cptch_options['cptch_contact_form']) { echo "checked=\"checked\""; } ?> /> Contact form by BestWebSoft</label> <?php } else { ?> <label><input disabled='disabled' type="checkbox" name="cptch_contact_form" value="1" <?php if (1 == $cptch_options['cptch_contact_form']) { echo "checked=\"checked\""; } ?> /> Contact form by BestWebSoft</label> <span class="cptch_span"><a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php _e('Activate contact form', 'captcha'); ?> </a></span> <?php } ?> <div class="cptch_help_box cptch_thumb_block"> <div class="cptch_hidden_help_text cptch_thumb"><img src="<?php echo plugins_url('captcha/images/contact_form.jpg'); ?> " title="<?php _e('Contact Form', 'captcha'); ?> " alt="<?php _e('Contact Form', 'captcha'); ?> "/></div> </div><br /> <?php } else { ?> <label><input disabled='disabled' type="checkbox" name="cptch_contact_form" value="1" <?php if (1 == $cptch_options['cptch_contact_form']) { echo "checked=\"checked\""; } ?> /> Contact form by BestWebSoft</label> <span class="cptch_span"><a href="http://bestwebsoft.com/products/contact-form/?k=d70b58e1739ab4857d675fed2213cedc&pn=75&v=<?php echo $cptch_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> "><?php _e('Download contact form', 'captcha'); ?> </a></span> <div class="cptch_help_box cptch_thumb_block"> <div class="cptch_hidden_help_text cptch_thumb"><img src="<?php echo plugins_url('captcha/images/contact_form.jpg'); ?> " title="<?php _e('Contact Form', 'captcha'); ?> " alt="<?php _e('Contact Form', 'captcha'); ?> "/></div> </div><br /> <?php } echo apply_filters('cptch_forms_list', ''); ?> <span class="cptch_span"><?php _e('If you would like to add Captcha to a custom form, please see', 'captcha'); ?> <a href="http://bestwebsoft.com/products/captcha/faq" target="_blank">FAQ</a></span> </fieldset></td> </tr> </table> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <th scope="row"> <?php _e('Enable CAPTCHA for:', 'captcha'); ?> </th> <td> <label><input disabled='disabled' type="checkbox" name="cptchpr_subscriber" value="1" /> Subscriber by BestWebSoft</label> </td> </tr> <tr valign="top"> <th scope="row"> <strong>Buddypress</strong><br/> <?php _e('Enable CAPTCHA for:', 'captcha'); ?> </th> <td><fieldset> <legend class="screen-reader-text"><span>Buddypress <?php _e('Enable CAPTCHA for:', 'captcha'); ?> </span></legend> <label><input disabled='disabled' type="checkbox" name="cptchpr_buddypress_register_form" value="1" /> <?php _e('Registration form', 'captcha'); ?> </label><br /> <label><input disabled='disabled' type="checkbox" name="cptchpr_buddypress_comment_form" value="1" /> <?php _e('Comments form', 'captcha'); ?> </label><br /> <label><input disabled='disabled' type="checkbox" name="cptchpr_buddypress_group_form" value="1" /> <?php _e('"Create a Group" form', 'captcha'); ?> </label> </fieldset></td> </tr> <tr valign="top"> <th scope="row"> <strong>Contact Form 7</strong><br/> <?php _e('Enable CAPTCHA:', 'captcha'); ?> </th> <td><br/> <input disabled='disabled' type="checkbox" name="cptchpr_cf7" value="1" /><br /> </td> </tr> <tr valign="top"> <th scope="row" colspan="2"> * <?php _e('If you upgrade to Pro version all your settings will be saved.', 'captcha'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to PRO version.', 'captcha'); ?> <a href="http://bestwebsoft.com/products/captcha/?k=9701bbd97e61e52baa79c58c3caacf6d&pn=75&v=<?php echo $cptch_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Captcha Pro"><?php _e('Learn More', 'captcha'); ?> </a> </div> <a class="bws_button" href="http://bestwebsoft.com/products/captcha/buy/?k=9701bbd97e61e52baa79c58c3caacf6d&pn=75&v=<?php echo $cptch_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Captcha Pro"> <?php _e('Go', 'captcha'); ?> <strong>PRO</strong> </a> <div class="clear"></div> </div> </div> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Hide CAPTCHA', 'captcha'); ?> </th> <td><?php foreach ($cptch_admin_fields_hide as $fields) { ?> <label><input type="checkbox" name="<?php echo $fields[0]; ?> " value="<?php echo $fields[0]; ?> " <?php if (1 == $cptch_options[$fields[0]]) { echo "checked=\"checked\""; } ?> /> <?php echo $fields[1]; ?> </label><br /> <?php } ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Title for CAPTCHA in the form', 'captcha'); ?> </th> <td><input class="cptch_settings_input" type="text" name="cptch_label_form" value="<?php echo $cptch_options['cptch_label_form']; ?> " maxlength="100" /></td> </tr> <tr valign="top"> <th scope="row"><?php _e("Required symbol", 'captcha'); ?> </th> <td colspan="2"> <input class="cptch_settings_input" type="text" name="cptch_required_symbol" value="<?php echo $cptch_options['cptch_required_symbol']; ?> " maxlength="100" /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Error messages", 'captcha'); ?> </th> <td colspan="2"> <p><input class="cptch_settings_input" type="text" name="cptch_error_empty_value" value="<?php echo $cptch_options['cptch_error_empty_value']; ?> " maxlength="100" /> <?php _e('If CAPTCHA field is empty', 'captcha'); ?> </p> <p><input class="cptch_settings_input" type="text" name="cptch_error_incorrect_value" value="<?php echo $cptch_options['cptch_error_incorrect_value']; ?> " maxlength="100" /> <?php _e('If CAPTCHA is incorrect', 'captcha'); ?> </p> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Arithmetic actions for CAPTCHA', 'captcha'); ?> </th> <td colspan="2"><fieldset> <legend class="screen-reader-text"><span><?php _e('Arithmetic actions for CAPTCHA', 'captcha'); ?> </span></legend> <?php foreach ($cptch_admin_fields_actions as $actions) { ?> <label><input type="checkbox" name="<?php echo $actions[0]; ?> " value="<?php echo $cptch_options[$actions[0]]; ?> " <?php if (1 == $cptch_options[$actions[0]]) { echo "checked=\"checked\""; } ?> /> <?php echo __($actions[1], 'captcha'); ?> </label> <div class="cptch_help_box"> <div class="cptch_hidden_help_text"><?php cptch_display_example($actions[0]); ?> </div> </div> <br /> <?php } ?> </fieldset></td> </tr> <tr valign="top"> <th scope="row"><?php _e('CAPTCHA complexity level', 'captcha'); ?> </th> <td colspan="2"><fieldset> <legend class="screen-reader-text"><span><?php _e('CAPTCHA complexity level', 'captcha'); ?> </span></legend> <?php foreach ($cptch_admin_fields_difficulty as $diff) { ?> <label><input type="checkbox" name="<?php echo $diff[0]; ?> " value="<?php echo $cptch_options[$diff[0]]; ?> " <?php if (1 == $cptch_options[$diff[0]]) { echo "checked=\"checked\""; } ?> /> <?php echo __($diff[1], 'captcha'); ?> </label> <div class="cptch_help_box"> <div class="cptch_hidden_help_text"><?php cptch_display_example($diff[0]); ?> </div> </div> <br /> <?php } ?> </fieldset></td> </tr> </table> <input type="hidden" name="cptch_form_submit" value="submit" /> <p class="submit"> <input type="submit" class="button-primary" value="<?php _e('Save Changes', 'captcha'); ?> " /> </p> <?php wp_nonce_field($plugin_basename, 'cptch_nonce_name'); ?> </form> <?php bws_form_restore_default_settings($plugin_basename); } } elseif ('go_pro' == $_GET['action']) { bws_go_pro_tab($cptch_plugin_info, $plugin_basename, 'captcha.php', 'captcha_pro.php', 'captcha-pro/captcha_pro.php', 'captcha', '9701bbd97e61e52baa79c58c3caacf6d', '75', isset($go_pro_result['pro_plugin_is_activated'])); } elseif ('whitelist' == $_GET['action']) { require_once dirname(__FILE__) . '/whitelist.php'; $cptch_whitelist = new Cptch_Whitelist($plugin_basename, $cptch_plugin_info['Version'], 'captcha'); $cptch_whitelist->display_content(); } bws_plugin_reviews_block($cptch_plugin_info['Name'], 'captcha'); ?> </div> <?php }
function gglstmp_settings_page() { global $gglstmppr_url_home, $gglstmp_settings, $gglstmp_option_defaults, $gglstmppr_url, $wp_version, $gglstmp_plugin_info; $message = $error = ""; $gglstmp_robots = get_option('gglstmp_robots'); $gglstmppr_url_robot = ABSPATH . "robots.txt"; $plugin_basename = plugin_basename(__FILE__); if (is_multisite()) { $home_url = preg_replace("/[^a-zA-ZА-Яа-я0-9\\s]/", "_", str_replace('http://', '', str_replace('https://', '', home_url()))); $gglstmppr_url_sitemap = ABSPATH . "sitemap_" . $home_url . ".xml"; } else { $gglstmppr_url_sitemap = ABSPATH . "sitemap.xml"; } if (isset($_REQUEST['gglstmp_submit']) && check_admin_referer($plugin_basename, 'gglstmp_nonce_name')) { $gglstmp_settings['post_type'] = isset($_REQUEST['gglstmp_post_types']) ? $_REQUEST['gglstmp_post_types'] : array(); $gglstmp_settings['taxonomy'] = isset($_REQUEST['gglstmp_taxonomies']) ? $_REQUEST['gglstmp_taxonomies'] : array(); /*============================ Adding location of sitemap file to the robots.txt =============*/ $gglstmp_robots_flag = isset($_POST['gglstmp_checkbox']) ? 1 : 0; if (file_exists($gglstmppr_url_robot) && !is_multisite()) { if (!is_writable($gglstmppr_url_robot)) { @chmod($gglstmppr_url_robot, 0755); } if (is_writable($gglstmppr_url_robot)) { $file_content = file_get_contents($gglstmppr_url_robot); if (isset($_POST['gglstmp_checkbox']) && !preg_match('|Sitemap: ' . $gglstmppr_url_home . 'sitemap.xml|', $file_content)) { file_put_contents($gglstmppr_url_robot, $file_content . "\nSitemap: " . $gglstmppr_url_home . "sitemap.xml"); } elseif (preg_match("|Sitemap: " . $gglstmppr_url_home . "sitemap.xml|", $file_content) && !isset($_POST['gglstmp_checkbox'])) { $file_content = preg_replace("|\nSitemap: " . $gglstmppr_url_home . "sitemap.xml|", '', $file_content); file_put_contents($gglstmppr_url_robot, $file_content); } } else { $error = __('Cannot edit "robots.txt". Check your permissions.', 'sitemap'); $gglstmp_robots_flag = 0; } } if (false === get_option('gglstmp_robots')) { add_option('gglstmp_robots', $gglstmp_robots_flag); } else { update_option('gglstmp_robots', $gglstmp_robots_flag); } $gglstmp_robots = get_option('gglstmp_robots'); update_option('gglstmp_settings', $gglstmp_settings); if (!isset($_POST['gglstmp_authorize']) && !isset($_POST['gglstmp_logout']) && !isset($_POST['gglstmp_menu'])) { $message .= " " . __("Settings saved.", 'sitemap'); } } if (isset($_POST['gglstmp_new']) && check_admin_referer($plugin_basename, 'gglstmp_nonce_name')) { $message = __("Your Sitemap file is created in the site root directory.", 'sitemap'); gglstmp_sitemapcreate(); } $gglstmp_result = get_post_types('', 'names'); unset($gglstmp_result['revision']); unset($gglstmp_result['attachment']); unset($gglstmp_result['nav_menu_item']); $gglstmp_result_taxonomies = array('category' => 'Post category', 'post_tag' => 'Post tag'); /* GO PRO */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { $go_pro_result = bws_go_pro_tab_check($plugin_basename); if (!empty($go_pro_result['error'])) { $error = $go_pro_result['error']; } } if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $gglstmp_settings = $gglstmp_option_defaults; @unlink($gglstmppr_url_sitemap); /* remove sitemap.xml */ /* clear robots.txt */ if (file_exists($gglstmppr_url_robot) && !is_multisite()) { if (!is_writable($gglstmppr_url_robot)) { @chmod($gglstmppr_url_robot, 0755); } if (is_writable($gglstmppr_url_robot)) { $file_content = file_get_contents($gglstmppr_url_robot); if (preg_match("|Sitemap: " . $gglstmppr_url_home . "sitemap.xml|", $file_content)) { $file_content = preg_replace("|\nSitemap: " . $gglstmppr_url_home . "sitemap.xml|", '', $file_content); file_put_contents($gglstmppr_url_robot, $file_content); } } else { $error = __('Cannot edit "robot.txt". Check your permissions.', 'sitemap'); } } if (false === get_option('gglstmp_robots')) { add_option('gglstmp_robots', 0); } else { update_option('gglstmp_robots', 0); } $gglstmp_robots = get_option('gglstmp_robots'); update_option('gglstmp_settings', $gglstmp_settings); $message = __('All plugin settings were restored.', 'sitemap'); } ?> <div class="wrap"> <div class="icon32 icon32-bws" id="icon-options-general"></div> <h2><?php _e("Google Sitemap Settings", 'sitemap'); ?> </h2> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=google-sitemap-plugin.php"><?php _e('Settings', 'sitemap'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'extra' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=google-sitemap-plugin.php&action=extra"><?php _e('Extra settings', 'sitemap'); ?> </a> <a class="nav-tab" href="http://bestwebsoft.com/products/google-sitemap/faq/" target="_blank"><?php _e('FAQ', 'sitemap'); ?> </a> <a class="nav-tab bws_go_pro_tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=google-sitemap-plugin.php&action=go_pro"><?php _e('Go PRO', 'sitemap'); ?> </a> </h2> <?php if (!isset($_GET['action']) && is_multisite() && !is_subdomain_install()) { ?> <div id="gglstmp_check_sitemap_block" class="error"> <p> <?php printf('<strong>%s</strong> %s', __('Warning:', 'sitemap'), sprintf(__('To have an access to subsites XML files, please add the following rule %s to your %s file in %s after line %s.', 'sitemap'), '<code>RewriteRule ([^/]+\\.xml)$ $1 [L]</code>', '<strong>.htaccess</strong>', sprintf('<strong>"%s"</strong>', ABSPATH), '<strong>"RewriteBase"</strong>')); ?> </p> <div style="margin: .5em 0; padding: 2px;"> <form action="admin.php?page=google-sitemap-plugin.php" method='post' id="gglstmp_check_sitemap"> <input type="submit" class="button-secondary" name="gglstmp_check_sitemap" value="<?php _e('Сheck Access', 'sitemap'); ?> " /> <?php wp_nonce_field($plugin_basename, 'gglstmp_nonce_sitemap'); ?> </form> <?php if (isset($_POST['gglstmp_check_sitemap']) && check_admin_referer($plugin_basename, 'gglstmp_nonce_sitemap')) { $gglstmp_background = array('200' => '#f8fdf5', '404' => '#fdf6f6'); if ($gglstmp_settings['sitemap'] && file_exists($gglstmp_settings['sitemap']['path'])) { $gglstmp_status = gglstmp_check_sitemap($gglstmp_settings['sitemap']['loc']); printf('<div style="margin: 10px 0 0; padding: 2px 5px; background-color: %s;"><a href="%s">%s</a> - %s</div>', $gglstmp_background[$gglstmp_status['code']], $gglstmp_settings['sitemap']['loc'], $gglstmp_settings['sitemap']['file'], $gglstmp_status['message']); } } ?> </div> </div> <?php } ?> <div id="gglstmp_settings_notice" class="updated fade" style="display:none"><p><strong><?php _e("Notice:", 'sitemap'); ?> </strong> <?php _e("The plugin's settings have been changed. In order to save them please don't forget to click the 'Save Changes' button.", 'sitemap'); ?> </p></div> <div class="updated fade" <?php if ("" != $error || $message == "") { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <div class="error" <?php if ("" == $error) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $error; ?> </strong></p></div> <?php if (!isset($_GET['action'])) { if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } else { ?> <form action="admin.php?page=google-sitemap-plugin.php" method='post' id="gglstmp_auth" name="gglstmp_auth"> <?php /*=============================== Creating sitemap file ====================================*/ if (file_exists($gglstmppr_url_sitemap)) { if (is_multisite()) { echo '<p><a href="' . $gglstmppr_url_home . "sitemap_" . $home_url . '.xml" target="_new">' . __("The Sitemap file", 'sitemap') . "</a> " . __("already exists. If you would like to replace it with a new one, please choose the necessary box below.", 'sitemap') . "</p>"; } else { echo '<p><a href="' . $gglstmppr_url_home . 'sitemap.xml" target="_new">' . __("The Sitemap file", 'sitemap') . "</a> " . __("already exists. If you would like to replace it with a new one, please choose the necessary box below.", 'sitemap') . "</p>"; } } else { gglstmp_sitemapcreate(); if (is_multisite()) { echo '<p><a href="' . $gglstmppr_url_home . "sitemap_" . $home_url . '.xml" target="_new">' . __("Your Sitemap file", 'sitemap') . "</a> " . __("is created in the site root directory.", 'sitemap') . "</p>"; } else { echo '<p><a href="' . $gglstmppr_url_home . 'sitemap.xml" target="_new">' . __("Your Sitemap file", 'sitemap') . "</a> " . __("is created in the site root directory.", 'sitemap') . "</p>"; } } /*========================================== Recreating sitemap file ====================================*/ if (is_multisite()) { echo '<p>' . __("If you do not want a sitemap file to be added to Google Webmaster Tools automatically, you can do it using", 'sitemap') . " <a href=\"https://www.google.com/webmasters/tools/home?hl=en\">" . __("this", 'sitemap') . "</a> " . __("link - sign in, choose the necessary site, go to 'Sitemaps' and fill out the mandatory field", 'sitemap') . " - '" . $gglstmppr_url_home . "sitemap_" . $home_url . ".xml'.</p>"; } else { echo '<p>' . __("If you do not want a sitemap file to be added to Google Webmaster Tools automatically, you can do it using", 'sitemap') . " <a href=\"https://www.google.com/webmasters/tools/home?hl=en\">" . __("this", 'sitemap') . "</a> " . __("link - sign in, choose the necessary site, go to 'Sitemaps' and fill out the mandatory field", 'sitemap') . " - '" . $gglstmppr_url_home . "sitemap.xml'.</p>"; } ?> <table class="form-table"> <tr valign="top"> <td colspan="2"> <label><input type='checkbox' name='gglstmp_new' value="1" /> <?php _e("I want to create a new sitemap file or update the existing one", 'sitemap'); ?> </label> </td> </tr> <?php if (is_multisite()) { ?> <tr valign="top"> <td colspan="2"> <label><input type='checkbox' disabled="disabled" name='gglstmp_checkbox' value="1" <?php if (1 == $gglstmp_robots) { echo 'checked="checked"'; } ?> /> <?php _e("I want to add sitemap file path in robots.txt", 'sitemap'); ?> </label> <p style="color:red"><?php _e("Since you are using multisiting, the plugin does not allow to add a sitemap to robots.txt", 'sitemap'); ?> </div> </td> </tr> <?php } else { ?> <tr valign="top"> <td colspan="2"> <label><input type='checkbox' name='gglstmp_checkbox' value="1" <?php if (1 == $gglstmp_robots) { echo 'checked="checked"'; } ?> /> <?php _e("I want to add sitemap file path in", 'sitemap'); ?> <a href="<?php echo $gglstmppr_url_home; ?> robots.txt" target="_new">robots.txt</a></label> </td> </tr> <?php } ?> <tr valign="top"> <th scope="row" colspan="2"><?php _e('Please choose the necessary post types and taxonomies the links to which are to be added to the sitemap:', 'sitemap'); ?> </th> </tr> <tr valign="top"> <td colspan="2"> <fieldset> <?php foreach ($gglstmp_result as $key => $value) { ?> <label><input type="checkbox" <?php if (in_array($value, $gglstmp_settings['post_type'])) { echo 'checked="checked"'; } ?> name="gglstmp_post_types[]" value="<?php echo $value; ?> "/><span style="text-transform: capitalize; padding-left: 5px;"><?php echo $value; ?> </span></label><br /> <?php } ?> </fieldset> </td> </tr> <tr valign="top"> <td colspan="2"> <fieldset> <?php foreach ($gglstmp_result_taxonomies as $key => $value) { ?> <label><input type="checkbox" <?php if (in_array($key, $gglstmp_settings['taxonomy'])) { echo 'checked="checked"'; } ?> name="gglstmp_taxonomies[]" value="<?php echo $key; ?> "/><span style="padding-left: 5px;"><?php echo $value; ?> </span></label><br /> <?php } ?> </fieldset> </td> </tr> </table> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <th><?php _e('XML Sitemap "Change Frequency" parameter', 'sitemap'); ?> </th> <td> <select name="gglstmp_sitemap_change_frequency"> <option value="always"><?php _e('Always', 'sitemap'); ?> </option> <option value="hourly"><?php _e('Hourly', 'sitemap'); ?> </option> <option value="daily"><?php _e('Daily', 'sitemap'); ?> </option> <option value="weekly"><?php _e('Weekly', 'sitemap'); ?> </option> <option selected value="monthly"><?php _e('Monthly', 'sitemap'); ?> </option> <option value="yearly"><?php _e('Yearly', 'sitemap'); ?> </option> <option value="never"><?php _e('Never', 'sitemap'); ?> </option> </select><br /> <span style="color: #888888;font-size: 10px;"><?php _e('This value is used in the sitemap file and provides general information to search engines. The sitemap itself is generated once and will be re-generated when you create or update any post or page.', 'sitemap'); ?> </span> </td> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to PRO version.', 'sitemap'); ?> <a href="http://bestwebsoft.com/products/google-sitemap/?k=28d4cf0b4ab6f56e703f46f60d34d039&pn=83&v=<?php echo $gglstmp_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Google Sitemap Pro"><?php _e('Learn More', 'sitemap'); ?> </a> </div> <a class="bws_button" href="http://bestwebsoft.com/products/google-sitemap/buy/?k=28d4cf0b4ab6f56e703f46f60d34d039&pn=83&v=<?php echo $gglstmp_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Google Sitemap Pro"> <?php _e('Go', 'sitemap'); ?> <strong>PRO</strong> </a> <div class="clear"></div> </div> </div> <table class="form-table"> <?php if (!function_exists('curl_init')) { ?> <tr valign="top"> <td colspan="2" class="gglstmp_error"> <?php _e("This hosting does not support сURL, so you cannot add a sitemap file automatically.", 'sitemap'); ?> </td> </tr> <?php } else { ?> <tr id="gglstmp_google_webmaster" valign="top"> <th scope="row"><?php _e('Remote work with Google Webmaster Tools', 'sitemap'); ?> </th> <td> <?php $gglstmp_client = gglstmp_client(); $gglstmp_blog_prefix = '_' . get_current_blog_id(); if (isset($_POST['gglstmp_logout']) && check_admin_referer($plugin_basename, 'gglstmp_nonce_name')) { unset($_SESSION['gglstmp_authorization_code' . $gglstmp_blog_prefix]); unset($gglstmp_settings['authorization_code']); update_option('gglstmp_settings', $gglstmp_settings); } if (isset($_POST['gglstmp_authorization_code']) && !empty($_POST['gglstmp_authorization_code']) && check_admin_referer($plugin_basename, 'gglstmp_nonce_name')) { try { $gglstmp_client->authenticate($_POST['gglstmp_authorization_code']); $gglstmp_settings['authorization_code'] = $_SESSION['gglstmp_authorization_code' . $gglstmp_blog_prefix] = $gglstmp_client->getAccessToken(); update_option('gglstmp_settings', $gglstmp_settings); } catch (Exception $e) { } } if (!isset($_SESSION['gglstmp_authorization_code' . $gglstmp_blog_prefix]) && isset($gglstmp_settings['authorization_code'])) { $_SESSION['gglstmp_authorization_code' . $gglstmp_blog_prefix] = $gglstmp_settings['authorization_code']; } if (isset($_SESSION['gglstmp_authorization_code' . $gglstmp_blog_prefix])) { $gglstmp_client->setAccessToken($_SESSION['gglstmp_authorization_code' . $gglstmp_blog_prefix]); } if ($gglstmp_client->getAccessToken()) { ?> <div id="gglstmp_logout_button"> <input class="button-secondary" name="gglstmp_logout" type="submit" value="<?php _e('Log out from Google Webmaster Tools', 'sitemap'); ?> " /> </div> <?php $gglstmp_menu_ad = __("I want to add this site to Google Webmaster Tools", 'sitemap'); $gglstmp_menu_del = __("I want to delete this site from Google Webmaster Tools", 'sitemap'); $gglstmp_menu_inf = __("I want to get info about this site in Google Webmaster Tools", 'sitemap'); ?> <fieldset> <label><input type='radio' name='gglstmp_menu' value="ad" /> <?php echo $gglstmp_menu_ad; ?> </label><br /> <label><input type='radio' name='gglstmp_menu' value="del" /> <?php echo $gglstmp_menu_del; ?> </label><br /> <label><input type='radio' name='gglstmp_menu' value="inf" /> <?php echo $gglstmp_menu_inf; ?> </label><br /> <span class="gglstmp_span"> <?php _e('In case you failed to add a sitemap to Google automatically using this plugin, it is possible to do it manually', 'sitemap'); ?> : <a target="_blank" href="https://docs.google.com/document/d/1VOJx_OaasVskCqi9fsAbUmxfsckoagPU5Py97yjha9w/edit"><?php _e('View the Instruction', 'sitemap'); ?> </a> </span> </fieldset> <?php if (isset($_POST['gglstmp_menu']) && check_admin_referer($plugin_basename, 'gglstmp_nonce_name')) { $gglstmp_wmt = new Google_Service_Webmasters($gglstmp_client); $gglstmp_sv = new Google_Service_SiteVerification($gglstmp_client); switch ($_POST['gglstmp_menu']) { case 'inf': gglstmp_info_site($gglstmp_wmt, $gglstmp_sv); break; case 'ad': gglstmp_add_site($gglstmp_wmt, $gglstmp_sv); break; case 'del': gglstmp_del_site($gglstmp_wmt, $gglstmp_sv); break; default: break; } } } else { $gglstmp_state = mt_rand(); $gglstmp_client->setState($gglstmp_state); $_SESSION['gglstmp_state' . $gglstmp_blog_prefix] = $gglstmp_client; $gglstmp_auth_url = $gglstmp_client->createAuthUrl(); ?> <p><?php _e("Please authorize via your Google Account in order to add or delete a site and a sitemap file automatically or get information about this site in Google Webmaster Tools.", 'sitemap'); ?> </p> <a id="gglstmp_authorization_button" class="button-primary" href="<?php echo $gglstmp_auth_url; ?> " target="_blank" onclick="window.open(this.href,'','top='+(screen.height/2-560/2)+',left='+(screen.width/2-640/2)+',width=640,height=560,resizable=0,scrollbars=0,menubar=0,toolbar=0,status=1,location=0').focus(); return false;"><?php _e('Get Authorization Code', 'sitemap'); ?> </a> <div id="gglstmp_authorization_form"> <input id="gglstmp_authorization_code" name="gglstmp_authorization_code" type="text" autocomplete="off" maxlength="100" /> <input id="gglstmp_authorize" class="button-primary" name="gglstmp_authorize" type="submit" value="<?php _e('Authorize', 'sitemap'); ?> "> </div> <?php if (isset($_POST['gglstmp_authorization_code']) && isset($_POST['gglstmp_authorize']) && check_admin_referer($plugin_basename, 'gglstmp_nonce_name')) { ?> <div id="gglstmp_authorize_error"><?php _e('Invalid authorization code. Please, try again.', 'sitemap'); ?> </div> <?php } } ?> </td> </tr> <?php } ?> </table> <input type="hidden" name="gglstmp_submit" value="submit" /> <p class="submit"> <input type="submit" class="button-primary" value="<?php _e('Save Changes', 'sitemap'); ?> " /> </p> <?php wp_nonce_field($plugin_basename, 'gglstmp_nonce_name'); ?> </form> <?php bws_form_restore_default_settings($plugin_basename); ?> <div class="clear"></div> <?php } } elseif ('extra' == $_GET['action']) { ?> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <td colspan="2"> <?php _e('Please choose the necessary post types and taxonomies the links to which are to be added to the sitemap:', 'sitemap'); ?> </td> </tr> <tr valign="top"> <td colspan="2"> <label> <input disabled="disabled" checked="checked" id="gglstmp_jstree_url" type="checkbox" name="gglstmp_jstree_url" value="1" /> <?php _e("Show URL for pages", 'sitemap'); ?> </label> </td> </tr> <tr valign="top"> <td colspan="2"> <img src="<?php echo plugins_url('images/pro_screen_1.png', __FILE__); ?> " alt="<?php _e("Example of site pages' tree", 'sitemap'); ?> " title="<?php _e("Example of site pages' tree", 'sitemap'); ?> " /> </td> </tr> <tr valign="top"> <td colspan="2"> <input disabled="disabled" type="submit" class="button-primary" value="<?php _e('Save Changes', 'sitemap'); ?> " /> </td> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to PRO version.', 'sitemap'); ?> <a href="http://bestwebsoft.com/products/google-sitemap/?k=28d4cf0b4ab6f56e703f46f60d34d039&pn=83&v=<?php echo $gglstmp_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Google Sitemap Pro"><?php _e('Learn More', 'sitemap'); ?> </a> </div> <a class="bws_button" href="http://bestwebsoft.com/products/google-sitemap/buy/?k=28d4cf0b4ab6f56e703f46f60d34d039&pn=83&v=<?php echo $gglstmp_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Google Sitemap Pro"> <?php _e('Go', 'sitemap'); ?> <strong>PRO</strong> </a> <div class="clear"></div> </div> </div> <?php } elseif ('go_pro' == $_GET['action']) { bws_go_pro_tab($gglstmp_plugin_info, $plugin_basename, 'google-sitemap-plugin.php', 'google-sitemap-pro.php', 'google-sitemap-pro/google-sitemap-pro.php', 'google-sitemap', '28d4cf0b4ab6f56e703f46f60d34d039', '83', isset($go_pro_result['pro_plugin_is_activated'])); } bws_plugin_reviews_block($gglstmp_plugin_info['Name'], 'google-sitemap-plugin'); ?> </div> <?php }
function sbscrbr_settings_page() { global $wp_version, $wpdb, $sbscrbr_options, $cptchpr_options, $sbscrbr_plugin_info, $sbscrbr_options_default; $prefix = is_multisite() ? $wpdb->base_prefix : $wpdb->prefix; /* get list of administrators */ $admin_list = $wpdb->get_results("SELECT DISTINCT `user_login` , `display_name` FROM `" . $prefix . "users` \n\t\t\t\tLEFT JOIN `" . $prefix . "usermeta` ON `" . $prefix . "usermeta`.`user_id` = `" . $prefix . "users`.`ID` \n\t\t\tWHERE `meta_value` LIKE '%administrator%'", ARRAY_A); $error = $message = $notice = ''; $plugin_basename = plugin_basename(__FILE__); if (empty($cptchpr_options)) { $cptchpr_options = get_option('cptchpr_options'); } $all_plugins = get_plugins(); if (isset($_POST['sbscrbr_form_submit']) && check_admin_referer($plugin_basename, 'sbscrbr_nonce_name')) { /* form labels */ $sbscrbr_options_submit['form_label'] = isset($_POST['sbscrbr_form_label']) ? stripslashes(esc_html($_POST['sbscrbr_form_label'])) : $sbscrbr_options['form_label']; $sbscrbr_options_submit['form_placeholder'] = isset($_POST['sbscrbr_form_placeholder']) ? stripslashes(esc_html($_POST['sbscrbr_form_placeholder'])) : $sbscrbr_options['form_placeholder']; $sbscrbr_options_submit['form_checkbox_label'] = isset($_POST['sbscrbr_form_checkbox_label']) ? stripslashes(esc_html($_POST['sbscrbr_form_checkbox_label'])) : $sbscrbr_options['form_checkbox_label']; $sbscrbr_options_submit['form_button_label'] = isset($_POST['sbscrbr_form_button_label']) ? stripslashes(esc_html($_POST['sbscrbr_form_button_label'])) : $sbscrbr_options['form_button_label']; /* service messages */ $sbscrbr_options_submit['bad_request'] = isset($_POST['sbscrbr_bad_request']) ? stripslashes(esc_html($_POST['sbscrbr_bad_request'])) : $sbscrbr_options['bad_request']; $sbscrbr_options_submit['empty_email'] = isset($_POST['sbscrbr_empty_email']) ? stripslashes(esc_html($_POST['sbscrbr_empty_email'])) : $sbscrbr_options['empty_email']; $sbscrbr_options_submit['invalid_email'] = isset($_POST['sbscrbr_invalid_email']) ? stripslashes(esc_html($_POST['sbscrbr_invalid_email'])) : $sbscrbr_options['invalid_email']; $sbscrbr_options_submit['not_exists_email'] = isset($_POST['sbscrbr_not_exists_email']) ? stripslashes(esc_html($_POST['sbscrbr_not_exists_email'])) : $sbscrbr_options['not_exists_email']; $sbscrbr_options_submit['cannot_get_email'] = isset($_POST['sbscrbr_cannot_get_email']) ? stripslashes(esc_html($_POST['sbscrbr_cannot_get_email'])) : $sbscrbr_options['cannot_get_email']; $sbscrbr_options_submit['cannot_send_email'] = isset($_POST['sbscrbr_cannot_send_email']) ? stripslashes(esc_html($_POST['sbscrbr_cannot_send_email'])) : $sbscrbr_options['cannot_send_email']; $sbscrbr_options_submit['error_subscribe'] = isset($_POST['sbscrbr_error_subscribe']) ? stripslashes(esc_html($_POST['sbscrbr_error_subscribe'])) : $sbscrbr_options['error_subscribe']; $sbscrbr_options_submit['done_subscribe'] = isset($_POST['sbscrbr_done_subscribe']) ? stripslashes(esc_html($_POST['sbscrbr_done_subscribe'])) : $sbscrbr_options['done_subscribe']; $sbscrbr_options_submit['already_subscribe'] = isset($_POST['sbscrbr_already_subscribe']) ? stripslashes(esc_html($_POST['sbscrbr_already_subscribe'])) : $sbscrbr_options['already_subscribe']; $sbscrbr_options_submit['denied_subscribe'] = isset($_POST['sbscrbr_denied_subscribe']) ? stripslashes(esc_html($_POST['sbscrbr_denied_subscribe'])) : $sbscrbr_options['denied_subscribe']; $sbscrbr_options_submit['already_unsubscribe'] = isset($_POST['sbscrbr_already_unsubscribe']) ? stripslashes(esc_html($_POST['sbscrbr_already_unsubscribe'])) : $sbscrbr_options['already_unsubscribe']; $sbscrbr_options_submit['check_email_unsubscribe'] = isset($_POST['sbscrbr_check_email_unsubscribe']) ? stripslashes(esc_html($_POST['sbscrbr_check_email_unsubscribe'])) : $sbscrbr_options['check_email_unsubscribe']; $sbscrbr_options_submit['done_unsubscribe'] = isset($_POST['sbscrbr_done_unsubscribe']) ? stripslashes(esc_html($_POST['sbscrbr_done_unsubscribe'])) : $sbscrbr_options['done_unsubscribe']; $sbscrbr_options_submit['not_exists_unsubscribe'] = isset($_POST['sbscrbr_not_exists_unsubscribe']) ? stripslashes(esc_html($_POST['sbscrbr_not_exists_unsubscribe'])) : $sbscrbr_options['not_exists_unsubscribe']; /* "From" settings */ if (isset($_POST['sbscrbr_from_email']) && is_email(trim($_POST['sbscrbr_from_email']))) { if ($sbscrbr_options['from_email'] != trim($_POST['sbscrbr_from_email'])) { $notice = __("Email 'FROM' field option was changed, which may cause email messages being moved to the spam folder or email delivery failures.", 'subscriber'); } $sbscrbr_options_submit['from_email'] = trim($_POST['sbscrbr_from_email']); } else { $sbscrbr_options_submit['from_email'] = $sbscrbr_options_default['from_email']; } $sbscrbr_options_submit['from_custom_name'] = isset($_POST['sbscrbr_from_custom_name']) ? $_POST['sbscrbr_from_custom_name'] : $sbscrbr_options['from_custom_name']; if ('' == $sbscrbr_options_submit['from_custom_name']) { $sbscrbr_options_submit['from_custom_name'] = $sbscrbr_options_default['from_custom_name']; } /* subject settings */ $sbscrbr_options_submit['admin_message_subject'] = isset($_POST['sbscrbr_admin_message_subject']) ? stripslashes($_POST['sbscrbr_admin_message_subject']) : $sbscrbr_options['admin_message_subject']; $sbscrbr_options_submit['subscribe_message_subject'] = isset($_POST['sbscrbr_subscribe_message_subject']) ? stripslashes($_POST['sbscrbr_subscribe_message_subject']) : $sbscrbr_options['subscribe_message_subject']; $sbscrbr_options_submit['unsubscribe_message_subject'] = isset($_POST['sbscrbr_unsubscribe_message_subject']) ? stripslashes($_POST['sbscrbr_unsubscribe_message_subject']) : $sbscrbr_options['unsubscribe_message_subject']; /* message body settings */ $sbscrbr_options_submit['admin_message_text'] = isset($_POST['sbscrbr_admin_message_text']) ? stripslashes($_POST['sbscrbr_admin_message_text']) : $sbscrbr_options['admin_message_text']; $sbscrbr_options_submit['subscribe_message_text'] = isset($_POST['sbscrbr_subscribe_message_text']) ? stripslashes($_POST['sbscrbr_subscribe_message_text']) : $sbscrbr_options['subscribe_message_text']; $sbscrbr_options_submit['unsubscribe_message_text'] = isset($_POST['sbscrbr_unsubscribe_message_text']) ? stripslashes($_POST['sbscrbr_unsubscribe_message_text']) : $sbscrbr_options['unsubscribe_message_text']; /* another settings */ $sbscrbr_options_submit['unsubscribe_link_text'] = isset($_POST['sbscrbr_unsubscribe_link_text']) ? $_POST['sbscrbr_unsubscribe_link_text'] : $sbscrbr_options['unsubscribe_link_text']; $sbscrbr_options_submit['delete_users'] = isset($_POST['sbscrbr_delete_users']) && '1' == $_POST['sbscrbr_delete_users'] ? '1' : '0'; if (!empty($cptchpr_options)) { $cptchpr_options['cptchpr_subscriber'] = isset($_POST['sbscrbr_display_captcha']) ? 1 : 0; update_option('cptchpr_options', $cptchpr_options); } /* update options of plugin in database */ if (empty($error)) { $sbscrbr_options = array_merge($sbscrbr_options, $sbscrbr_options_submit); update_option('sbscrbr_options', $sbscrbr_options); $message = __('Settings Saved', 'subscriber'); } } /* add restore function */ if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $sbscrbr_options = $sbscrbr_options_default; update_option('sbscrbr_options', $sbscrbr_options); $message = __('All plugin settings were restored.', 'subscriber'); } /* end */ /* GO PRO */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { $go_pro_result = bws_go_pro_tab_check($plugin_basename); if (!empty($go_pro_result['error'])) { $error = $go_pro_result['error']; } } ?> <div class="wrap" id="sbscrbr-settings-page"> <div class="icon32 icon32-bws" id="icon-options-general"></div> <h2><?php _e("Subscriber Settings", 'subscriber'); ?> </h2> <h2 class="nav-tab-wrapper"> <a class="nav-tab <?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=sbscrbr_settings_page"><?php _e('Settings', 'subscriber'); ?> </a> <a class="nav-tab" href="http://bestwebsoft.com/products/subscriber/faq/" target="_blank"><?php _e('FAQ', 'subscriber'); ?> </a> <a class="nav-tab bws_go_pro_tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=sbscrbr_settings_page&action=go_pro"><?php _e('Go PRO', 'subscriber'); ?> </a> </h2> <?php if (!empty($notice)) { ?> <div class="error"><p><strong><?php _e('Notice:', 'subscriber'); ?> </strong> <?php echo $notice; ?> </p></div> <?php } ?> <div id="sbscrbr-settings-notice" class="updated fade" style="display:none"><p><strong><?php _e("Notice:", 'subscriber'); ?> </strong> <?php _e("The plugin's settings have been changed. In order to save them please don't forget to click the 'Save Changes' button.", 'subscriber'); ?> </p></div> <div class="updated fade" <?php if (empty($message)) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <div class="error" <?php if (empty($error)) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $error; ?> </strong></p></div><?php if (!isset($_GET['action'])) { /* Showing settings tab */ if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } else { ?> <div><p><?php _e("If you would like to add the Subscribe Form to your website, just copy and paste this shortcode to your post, page or widget:", 'subscriber'); ?> <span class="sbscrbr_code">[sbscrbr_form]</span> <?php _e("or you can use Subscriber Form Registation Widget.", 'subscriber'); ?> </p></div> <form id="sbscrbr_settings_form" method="post" action="admin.php?page=sbscrbr_settings_page"> <table id="sbscrbr-settings-table" class="form-table"> <tr valign="top"> <th><?php _e('Subscribe form labels', 'subscriber'); ?> </th> <td colspan="2"> <input type="text" class="sbscrbr-input-text" id="sbscrbr-form-label" name="sbscrbr_form_label" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['form_label']); ?> "/> <span class="sbscrbr_info"><?php _e('Text above the subscribe form', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-form-placeholder" name="sbscrbr_form_placeholder" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['form_placeholder']); ?> "/> <span class="sbscrbr_info"><?php _e('Placeholder for text field', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-form-checkbox-label" name="sbscrbr_form_checkbox_label" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['form_checkbox_label']); ?> "/> <span class="sbscrbr_info"><?php _e('Label for "unsubscribe" checkbox', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-form-button-label" name="sbscrbr_form_button_label" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['form_button_label']); ?> "/> <span class="sbscrbr_info"><?php _e('Label for "submit" button', 'subscriber'); ?> </span> </td> </tr> <tr valign="top"> <th><?php _e('Service messages', 'subscriber'); ?> </th> <td colspan="2"> <input id="sbscrbr-show-service-messages" type="button" class="button-small button" value="<?php _e("Show", 'subscriber'); ?> "/> <input id="sbscrbr-hide-service-messages" type="button" class="button-small button" value="<?php _e("Hide", 'subscriber'); ?> "/> <div class="sbscrbr-help-box"> <div class="sbscrbr-hidden-help-text"> <p><?php _e('These messages will be displayed in the frontend of your site.', 'subscriber'); ?> </p> </div><!-- .sbscrbr-hidden-help-text --> </div> </td> </tr> <tr valign="top" class="sbscrbr-service-messages"> <th></th> <td colspan="2"> <input type="text" class="sbscrbr-input-text" id="sbscrbr-bad-request" name="sbscrbr_bad_request" maxlength="250" value="<?php echo $sbscrbr_options['bad_request']; ?> "/> <span class="sbscrbr_info"><?php _e('Unknown error', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-empty-email" name="sbscrbr_empty_email" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['empty_email']); ?> "/> <span class="sbscrbr_info"><?php _e('If user has not entered e-mail', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-invalid-email" name="sbscrbr_invalid_email" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['invalid_email']); ?> "/> <span class="sbscrbr_info"><?php _e('If user has entered invalid e-mail', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-not-exists-email" name="sbscrbr_not_exists_email" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['not_exists_email']); ?> "/> <span class="sbscrbr_info"><?php _e('If the user has entered a non-existent e-mail', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-not-exists-email" name="sbscrbr_cannot_get_email" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['cannot_get_email']); ?> "/> <span class="sbscrbr_info"><?php _e('If it is impossible to get the data about the entered e-mail', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-cannot-send-email" name="sbscrbr_cannot_send_email" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['cannot_send_email']); ?> "/> <span class="sbscrbr_info"><?php _e('If it is impossible to send a letter', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-error-subscribe" name="sbscrbr_error_subscribe" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['error_subscribe']); ?> "/> <span class="sbscrbr_info"><?php _e('If some errors occurred while user registration', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-done-subscribe" name="sbscrbr_done_subscribe" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['done_subscribe']); ?> "/> <span class="sbscrbr_info"><?php _e('If user registration was succesfully finished', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-already-subscribe" name="sbscrbr_already_subscribe" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['already_subscribe']); ?> "/> <span class="sbscrbr_info"><?php _e('If the user has already subscribed', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-denied-subscribe" name="sbscrbr_denied_subscribe" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['denied_subscribe']); ?> "/> <span class="sbscrbr_info"><?php _e('If subscription has been denied', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-already-unsubscribe" name="sbscrbr_already_unsubscribe" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['already_unsubscribe']); ?> "/> <span class="sbscrbr_info"><?php _e('If the user has already unsubscribed', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-check-email-unsubscribe" name="sbscrbr_check_email_unsubscribe" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['check_email_unsubscribe']); ?> "/> <span class="sbscrbr_info"><?php _e('If the user has been sent a letter with a link to unsubscribe', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-done-unsubscribe" name="sbscrbr_done_unsubscribe" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['done_unsubscribe']); ?> "/> <span class="sbscrbr_info"><?php _e('If user was unsubscribed', 'subscriber'); ?> </span> <br/> <input type="text" class="sbscrbr-input-text" id="sbscrbr-not-exists-unsubscribe" name="sbscrbr_not_exists_unsubscribe" maxlength="250" value="<?php echo esc_attr($sbscrbr_options['not_exists_unsubscribe']); ?> "/> <span class="sbscrbr_info"><?php _e('If the user clicked on a non-existent "unsubscribe"-link', 'subscriber'); ?> </span> </td><!-- .sbscrbr-service-messages --> </tr> <tr valign="top"> <th scope="row" style="width:200px;"><?php _e("'FROM' field", 'subscriber'); ?> </th> <td style="width: 200px; vertical-align: top;"> <div><?php _e("Name", 'subscriber'); ?> </div> <div> <input type="text" name="sbscrbr_from_custom_name" maxlength="250" value="<?php echo $sbscrbr_options['from_custom_name']; ?> "/> </div> </td> <td> <div><?php _e("Email", 'subscriber'); ?> </div> <div> <input type="text" name="sbscrbr_from_email" maxlength="250" value="<?php echo $sbscrbr_options['from_email']; ?> "/> </div> <span class="sbscrbr_info">(<?php _e("If this option is changed, email messages may be moved to the spam folder or email delivery failures may occur.", 'subscriber'); ?> )</span> </td> </tr> <tr valign="top"> <th><?php _e('Letters content', 'subscriber'); ?> </th> <td colspan="2"> <input id="sbscrbr-show-messages-settings" type="button" class="button-small button" value="<?php _e("Show", 'subscriber'); ?> "/> <input id="sbscrbr-hide-messages-settings" type="button" class="button-small button" value="<?php _e("Hide", 'subscriber'); ?> "/> <div class="sbscrbr-help-box"> <div class="sbscrbr-hidden-help-text"> <p><?php _e('You can edit the content of service letters, which will be sent to users. In the text of the message you can use the following shortcodes:', 'subscriber'); ?> </p> <ul> <li>{user_email} - <?php _e('this shortcode will be replaced with the e-mail of a current user;', 'subscriber'); ?> </li> <li>{profile_page} - <?php _e('this shortcode will be replaced with the link to profile page of current user;', 'subscriber'); ?> </li> <li>{unsubscribe_link} - <?php _e('this shortcode will be replaced with the link to unsubscribe.', 'subscriber'); ?> </li> <ul> </div><!-- .sbscrbr-hidden-help-text --> </div> </td> </tr> <tr valign="top" class="sbscrbr-messages-settings"> <th><?php _e('Message to admin about new subscribed users', 'subscriber'); ?> </th> <td colspan="2"> <input type="text" class="sbscrbr-input-text" id="sbscrbr-admin-message-subject" name="sbscrbr_admin_message_subject" maxlength="250" value="<?php echo stripslashes(esc_attr($sbscrbr_options['admin_message_subject'])); ?> "/> <span class="sbscrbr_info"><?php _e("Subject:", 'subscriber'); ?> </span> <br/> <textarea class="sbscrbr-input-text" id="sbscrbr-admin-message-text" name="sbscrbr_admin_message_text"><?php echo stripslashes(esc_textarea($sbscrbr_options['admin_message_text'])); ?> </textarea> <span class="sbscrbr_info sbscrbr_info_textarea"><?php _e("Text:", 'subscriber'); ?> </span> </td> </tr> <tr valign="top" class="sbscrbr-messages-settings"> <th><?php _e('Message to subscribed users', 'subscriber'); ?> </th> <td colspan="2"> <input type="text" class="sbscrbr-input-text" id="sbscrbr-subscribe-message-subject" name="sbscrbr_subscribe_message_subject" maxlength="250" value="<?php echo stripslashes(esc_attr($sbscrbr_options['subscribe_message_subject'])); ?> "/> <span class="sbscrbr_info"><?php _e("Subject:", 'subscriber'); ?> </span> <br/> <textarea class="sbscrbr-input-text" id="sbscrbr-subscribe-message-text" name="sbscrbr_subscribe_message_text"><?php echo stripslashes(esc_textarea($sbscrbr_options['subscribe_message_text'])); ?> </textarea> <span class="sbscrbr_info sbscrbr_info_textarea"><?php _e("Text:", 'subscriber'); ?> </span> </td> </tr> <tr valign="top" class="sbscrbr-messages-settings"> <th><?php _e('Message with unsubscribe link', 'subscriber'); ?> </th> <td colspan="2"> <input type="text" class="sbscrbr-input-text" id="sbscrbr-unsubscribe-message-subject" name="sbscrbr_unsubscribe_message_subject" maxlength="250" value="<?php echo stripslashes(esc_attr($sbscrbr_options['unsubscribe_message_subject'])); ?> "/> <span class="sbscrbr_info"><?php _e("Subject:", 'subscriber'); ?> </span> <br/> <textarea class="sbscrbr-input-text" id="sbscrbr-unsubscribe-message-text" name="sbscrbr_unsubscribe_message_text"><?php echo stripslashes(esc_textarea($sbscrbr_options['unsubscribe_message_text'])); ?> </textarea> <span class="sbscrbr_info sbscrbr_info_textarea"><?php _e("Text:", 'subscriber'); ?> </span> </td> </tr> <tr valign="top" class="sbscrbr-messages-settings"> <th><?php _e('Text to be attached to letters', 'subscriber'); ?> </th> <td colspan="2"> <textarea class="sbscrbr-input-text" id="sbscrbr-unsubscribe-link-text" name="sbscrbr_unsubscribe_link_text"><?php echo stripslashes(esc_textarea($sbscrbr_options['unsubscribe_link_text'])); ?> </textarea> <br/> <span class="sbscrbr_info"><?php _e('This text will be attached to each letter of the mailing, which was created with Sender plugin by BestWebsoft.', 'subscriber'); ?> </span> </td> </tr> <tr valign="top"> <th><?php _e('Delete users while plugin removing', 'subscriber'); ?> </th> <td colspan="2"> <input type="checkbox" id="sbscrbr-delete-user" name="sbscrbr_delete_users" value="1" <?php if ('1' == $sbscrbr_options['delete_users']) { echo 'checked="checked"'; } ?> /> <span class="sbscrbr_info"><?php _e('If this option enabled, when you remove plugin, all users with role "Mail Subscribed" will be removed from users list.', 'subscriber'); ?> </span> </td> </tr> <tr valign="top"> <th><?php _e('Add captcha to the form', 'subscriber'); ?> </th> <td colspan="2"> <?php if (array_key_exists('captcha-pro/captcha_pro.php', $all_plugins)) { if (is_plugin_active('captcha-pro/captcha_pro.php')) { ?> <input type="checkbox" name="sbscrbr_display_captcha" value="1" <?php if (isset($cptchpr_options) && 1 == $cptchpr_options["cptchpr_subscriber"]) { echo 'checked="checked"'; } ?> /> <span class="sbscrbr_info">(<?php _e('powered by', 'subscriber'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>)</span> <?php } else { ?> <input disabled="disabled" type="checkbox" name="sbscrbr_display_captcha" value="1" <?php if (isset($cptchpr_options) && 1 == $cptchpr_options["cptchpr_subscriber"]) { echo 'checked="checked"'; } ?> /> <span class="sbscrbr_info">(<?php _e('powered by', 'subscriber'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php _e('Activate captcha', 'subscriber'); ?> </a></span> <?php } } else { ?> <input disabled="disabled" type="checkbox" name="sbscrbr_display_captcha" value="1" /> <span class="sbscrbr_info">(<?php _e('powered by', 'subscriber'); ?> <a href="http://bestwebsoft.com/products/">bestwebsoft.com</a>) <a href="http://bestwebsoft.com/products/captcha/?k=d045de4664b2e847f2612a815d838e60&pn=122&v=<?php echo $sbscrbr_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> "><?php _e('Download captcha', 'subscriber'); ?> </a></span> <?php } ?> </td> </tr> </table> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <th><?php _e('Add to the subscribe form', 'subscriber'); ?> </th> <td> <label><input type="checkbox" name="sbscrbrpr_form_name_field" disabled value="1" /> <?php _e('"Name" field', 'subscriber'); ?> </label><br/> <label><input type="checkbox" name="sbscrbrpr_form_unsubscribe_checkbox" checked disabled value="1" /> <?php _e('"Unsubscribe" checkbox', 'subscriber'); ?> </label><br/> </td> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to a PRO version.', 'subscriber'); ?> <a href="http://bestwebsoft.com/products/subscriber/?k=d356381b0c3554404e34cdc4fe936455&pn=122&v=<?php echo $sbscrbr_plugin_info["Version"] . '&wp_v=' . $wp_version; ?> " target="_blank" title="Subscriber Pro"><?php _e("Learn More", 'subscriber'); ?> </a> </div> <a class="bws_button" href="http://bestwebsoft.com/products/subscriber/buy/?k=d356381b0c3554404e34cdc4fe936455&pn=122&v=<?php echo $sbscrbr_plugin_info["Version"] . '&wp_v=' . $wp_version; ?> " target="_blank" title="Subscriber Pro"> <?php _e('Go', 'subscriber'); ?> <strong>PRO</strong> </a> <div class="clear"></div> </div> </div> <?php if (false == sbscrbr_check_sender_install()) { echo '<p>' . __('If you want to send mailout to the users who have subscribed for newsletters use', 'subscriber') . ' <a href="http://bestwebsoft.com/products/sender/" target="_blank">Sender plugin</a> ' . __('that sends mail to registered users. There is also a premium version of the plugin', 'subscriber') . ' - <a href="http://bestwebsoft.com/products/sender/?k=01665f668edd3310e8c5cf13e9cb5181&pn=122&v=' . $sbscrbr_plugin_info["Version"] . '&wp_v=' . $wp_version . '" target="_blank">Sender Pro</a>, ' . __('allowing to create and save templates for letters, edit the content of messages with a visual editor TinyMce, set priority оf mailing, create and manage mailing lists.', 'subscriber') . '</p>'; } ?> <input type="hidden" name="sbscrbr_form_submit" value="submit" /> <p class="submit"> <input type="submit" id="sbscrbr-submit-button" class="button-primary" value="<?php _e('Save Changes', 'subscriber'); ?> " /> </p> <?php wp_nonce_field($plugin_basename, 'sbscrbr_nonce_name'); ?> </form> <?php bws_form_restore_default_settings($plugin_basename); } } elseif ('go_pro' == $_GET['action']) { bws_go_pro_tab($sbscrbr_plugin_info, $plugin_basename, 'sbscrbr_settings_page', 'sbscrbrpr_settings_page', 'subscriber-pro/subscriber-pro.php', 'subscriber', 'd356381b0c3554404e34cdc4fe936455', '122', isset($go_pro_result['pro_plugin_is_activated'])); } bws_plugin_reviews_block($sbscrbr_plugin_info['Name'], 'subscriber'); ?> </div><!-- .wrap --> <?php }
function cntctfrm_settings_page() { global $cntctfrm_options, $wpdb, $cntctfrm_option_defaults, $wp_version, $cntctfrm_plugin_info; $error = $message = $notice = ''; $plugin_basename = plugin_basename(__FILE__); if (!function_exists('get_plugins') || !function_exists('is_plugin_active_for_network')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } if (!isset($_GET['action']) || 'appearance' != $_GET['action']) { $all_plugins = get_plugins(); } /* Check contact-form-multi plugin */ if (is_plugin_active('contact-form-multi/contact-form-multi.php')) { $contact_form_multi_active = true; } if (is_plugin_active('contact-form-multi-pro/contact-form-multi-pro.php')) { $contact_form_multi_pro_active = true; } /* Get Captcha options */ if (get_option('cptch_options')) { $cptch_options = get_option('cptch_options'); } if (get_option('cptchpls_options')) { $cptchpls_options = get_option('cptchpls_options'); } if (get_option('cptchpr_options')) { $cptchpr_options = get_option('cptchpr_options'); } /* Get Contact Form to DB options */ if (get_option('cntctfrmtdb_options')) { $cntctfrmtdb_options = get_option('cntctfrmtdb_options'); } if (get_option('cntctfrmtdbpr_options')) { $cntctfrmtdbpr_options = get_option('cntctfrmtdbpr_options'); } $userslogin = get_users('blog_id=' . $GLOBALS['blog_id'] . '&role=administrator'); /* Save data for settings page */ if (isset($_POST['cntctfrm_form_submit']) && check_admin_referer($plugin_basename, 'cntctfrm_nonce_name')) { $cntctfrm_options_submit['cntctfrm_user_email'] = $_POST['cntctfrm_user_email']; $cntctfrm_options_submit['cntctfrm_custom_email'] = trim(stripslashes(esc_html($_POST['cntctfrm_custom_email'])), " ,"); $cntctfrm_options_submit['cntctfrm_select_email'] = $_POST['cntctfrm_select_email']; $cntctfrm_options_submit['cntctfrm_from_email'] = $_POST['cntctfrm_from_email']; $cntctfrm_options_submit['cntctfrm_custom_from_email'] = stripslashes(esc_html($_POST['cntctfrm_custom_from_email'])); $cntctfrm_options_submit['cntctfrm_mail_method'] = $_POST['cntctfrm_mail_method']; $cntctfrm_options_submit['cntctfrm_from_field'] = stripslashes(esc_html($_POST['cntctfrm_from_field'])); $cntctfrm_options_submit['cntctfrm_select_from_field'] = $_POST['cntctfrm_select_from_field']; $cntctfrm_options_submit['cntctfrm_display_name_field'] = isset($_POST['cntctfrm_display_name_field']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_display_address_field'] = isset($_POST['cntctfrm_display_address_field']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_display_phone_field'] = isset($_POST['cntctfrm_display_phone_field']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_attachment'] = isset($_POST['cntctfrm_attachment']) ? $_POST['cntctfrm_attachment'] : 0; $cntctfrm_options_submit['cntctfrm_attachment_explanations'] = isset($_POST['cntctfrm_attachment_explanations']) ? $_POST['cntctfrm_attachment_explanations'] : 0; $cntctfrm_options_submit['cntctfrm_send_copy'] = isset($_POST['cntctfrm_send_copy']) ? $_POST['cntctfrm_send_copy'] : 0; $cntctfrm_options_submit['cntctfrm_delete_attached_file'] = isset($_POST['cntctfrm_delete_attached_file']) ? $_POST['cntctfrm_delete_attached_file'] : 0; if (isset($_POST['cntctfrm_display_captcha'])) { if (get_option('cptch_options')) { $cptch_options['cptch_contact_form'] = 1; update_option('cptch_options', $cptch_options); } if (get_option('cptchpls_options')) { $cptchpls_options['cptchpls_contact_form'] = 1; update_option('cptchpls_options', $cptchpls_options); } if (get_option('cptchpr_options')) { $cptchpr_options['cptchpr_contact_form'] = 1; update_option('cptchpr_options', $cptchpr_options); } } else { if (get_option('cptch_options')) { $cptch_options['cptch_contact_form'] = 0; update_option('cptch_options', $cptch_options); } if (get_option('cptchpls_options')) { $cptchpls_options['cptchpls_contact_form'] = 0; update_option('cptchpls_options', $cptchpls_options); } if (get_option('cptchpr_options')) { $cptchpr_options['cptchpr_contact_form'] = 0; update_option('cptchpr_options', $cptchpr_options); } } if (isset($_POST['cntctfrm_save_email_to_db'])) { if (get_option('cntctfrmtdb_options')) { $cntctfrmtdb_options['cntctfrmtdb_save_messages_to_db'] = 1; update_option('cntctfrmtdb_options', $cntctfrmtdb_options); } if (get_option('cntctfrmtdbpr_options')) { $cntctfrmtdbpr_options['save_messages_to_db'] = 1; update_option('cntctfrmtdbpr_options', $cntctfrmtdbpr_options); } } else { if (get_option('cntctfrmtdb_options')) { $cntctfrmtdb_options['cntctfrmtdb_save_messages_to_db'] = 0; update_option('cntctfrmtdb_options', $cntctfrmtdb_options); } if (get_option('cntctfrmtdbpr_options')) { $cntctfrmtdbpr_options['save_messages_to_db'] = 0; update_option('cntctfrmtdbpr_options', $cntctfrmtdbpr_options); } } if (0 == $cntctfrm_options_submit['cntctfrm_display_name_field']) { $cntctfrm_options_submit['cntctfrm_required_name_field'] = 0; } else { $cntctfrm_options_submit['cntctfrm_required_name_field'] = isset($_POST['cntctfrm_required_name_field']) ? 1 : 0; } if (0 == $cntctfrm_options_submit['cntctfrm_display_address_field']) { $cntctfrm_options_submit['cntctfrm_required_address_field'] = 0; } else { $cntctfrm_options_submit['cntctfrm_required_address_field'] = isset($_POST['cntctfrm_required_address_field']) ? 1 : 0; } $cntctfrm_options_submit['cntctfrm_required_email_field'] = isset($_POST['cntctfrm_required_email_field']) ? 1 : 0; if (0 == $cntctfrm_options_submit['cntctfrm_display_phone_field']) { $cntctfrm_options_submit['cntctfrm_required_phone_field'] = 0; } else { $cntctfrm_options_submit['cntctfrm_required_phone_field'] = isset($_POST['cntctfrm_required_phone_field']) ? 1 : 0; } $cntctfrm_options_submit['cntctfrm_required_subject_field'] = isset($_POST['cntctfrm_required_subject_field']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_required_message_field'] = isset($_POST['cntctfrm_required_message_field']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_required_symbol'] = isset($_POST['cntctfrm_required_symbol']) ? stripslashes(esc_html($_POST['cntctfrm_required_symbol'])) : '*'; $cntctfrm_options_submit['cntctfrm_html_email'] = isset($_POST['cntctfrm_html_email']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_site_name_parameter'] = $_POST['cntctfrm_site_name_parameter']; $cntctfrm_options_submit['cntctfrm_display_add_info'] = isset($_POST['cntctfrm_display_add_info']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_display_sent_from'] = isset($_POST['cntctfrm_display_sent_from']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_display_date_time'] = isset($_POST['cntctfrm_display_date_time']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_display_coming_from'] = isset($_POST['cntctfrm_display_coming_from']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_display_user_agent'] = isset($_POST['cntctfrm_display_user_agent']) ? 1 : 0; if (0 == $cntctfrm_options_submit['cntctfrm_display_sent_from'] && 0 == $cntctfrm_options_submit['cntctfrm_display_date_time'] && 0 == $cntctfrm_options_submit['cntctfrm_display_coming_from'] && 0 == $cntctfrm_options_submit['cntctfrm_display_user_agent']) { $cntctfrm_options_submit['cntctfrm_display_add_info'] = 0; } if (0 == $cntctfrm_options_submit['cntctfrm_display_add_info']) { $cntctfrm_options_submit['cntctfrm_display_sent_from'] = 1; $cntctfrm_options_submit['cntctfrm_display_date_time'] = 1; $cntctfrm_options_submit['cntctfrm_display_coming_from'] = 1; $cntctfrm_options_submit['cntctfrm_display_user_agent'] = 1; } $cntctfrm_options_submit['cntctfrm_change_label'] = isset($_POST['cntctfrm_change_label']) ? 1 : 0; $cntctfrm_options_submit['cntctfrm_change_label_in_email'] = isset($_POST['cntctfrm_change_label_in_email']) ? 1 : 0; if (1 == $cntctfrm_options_submit['cntctfrm_change_label']) { foreach ($_POST['cntctfrm_name_label'] as $key => $val) { $cntctfrm_options_submit['cntctfrm_name_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_name_label'][$key])); $cntctfrm_options_submit['cntctfrm_address_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_address_label'][$key])); $cntctfrm_options_submit['cntctfrm_email_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_email_label'][$key])); $cntctfrm_options_submit['cntctfrm_phone_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_phone_label'][$key])); $cntctfrm_options_submit['cntctfrm_subject_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_subject_label'][$key])); $cntctfrm_options_submit['cntctfrm_message_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_message_label'][$key])); $cntctfrm_options_submit['cntctfrm_attachment_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_attachment_label'][$key])); $cntctfrm_options_submit['cntctfrm_attachment_tooltip'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_attachment_tooltip'][$key])); $cntctfrm_options_submit['cntctfrm_send_copy_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_send_copy_label'][$key])); $cntctfrm_options_submit['cntctfrm_thank_text'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_thank_text'][$key])); $cntctfrm_options_submit['cntctfrm_submit_label'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_submit_label'][$key])); $cntctfrm_options_submit['cntctfrm_name_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_name_error'][$key])); $cntctfrm_options_submit['cntctfrm_address_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_address_error'][$key])); $cntctfrm_options_submit['cntctfrm_email_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_email_error'][$key])); $cntctfrm_options_submit['cntctfrm_phone_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_phone_error'][$key])); $cntctfrm_options_submit['cntctfrm_subject_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_subject_error'][$key])); $cntctfrm_options_submit['cntctfrm_message_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_message_error'][$key])); $cntctfrm_options_submit['cntctfrm_attachment_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_attachment_error'][$key])); $cntctfrm_options_submit['cntctfrm_attachment_upload_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_attachment_upload_error'][$key])); $cntctfrm_options_submit['cntctfrm_attachment_move_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_attachment_move_error'][$key])); $cntctfrm_options_submit['cntctfrm_attachment_size_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_attachment_size_error'][$key])); $cntctfrm_options_submit['cntctfrm_captcha_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_captcha_error'][$key])); $cntctfrm_options_submit['cntctfrm_form_error'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_form_error'][$key])); } } else { if (empty($cntctfrm_options['cntctfrm_language'])) { $cntctfrm_options_submit['cntctfrm_name_label'] = $cntctfrm_option_defaults['cntctfrm_name_label']; $cntctfrm_options_submit['cntctfrm_address_label'] = $cntctfrm_option_defaults['cntctfrm_address_label']; $cntctfrm_options_submit['cntctfrm_email_label'] = $cntctfrm_option_defaults['cntctfrm_email_label']; $cntctfrm_options_submit['cntctfrm_phone_label'] = $cntctfrm_option_defaults['cntctfrm_phone_label']; $cntctfrm_options_submit['cntctfrm_subject_label'] = $cntctfrm_option_defaults['cntctfrm_subject_label']; $cntctfrm_options_submit['cntctfrm_message_label'] = $cntctfrm_option_defaults['cntctfrm_message_label']; $cntctfrm_options_submit['cntctfrm_attachment_label'] = $cntctfrm_option_defaults['cntctfrm_attachment_label']; $cntctfrm_options_submit['cntctfrm_attachment_tooltip'] = $cntctfrm_option_defaults['cntctfrm_attachment_tooltip']; $cntctfrm_options_submit['cntctfrm_send_copy_label'] = $cntctfrm_option_defaults['cntctfrm_send_copy_label']; $cntctfrm_options_submit['cntctfrm_thank_text'] = $_POST['cntctfrm_thank_text']; $cntctfrm_options_submit['cntctfrm_submit_label'] = $cntctfrm_option_defaults['cntctfrm_submit_label']; $cntctfrm_options_submit['cntctfrm_name_error'] = $cntctfrm_option_defaults['cntctfrm_name_error']; $cntctfrm_options_submit['cntctfrm_address_error'] = $cntctfrm_option_defaults['cntctfrm_address_error']; $cntctfrm_options_submit['cntctfrm_email_error'] = $cntctfrm_option_defaults['cntctfrm_email_error']; $cntctfrm_options_submit['cntctfrm_phone_error'] = $cntctfrm_option_defaults['cntctfrm_phone_error']; $cntctfrm_options_submit['cntctfrm_subject_error'] = $cntctfrm_option_defaults['cntctfrm_subject_error']; $cntctfrm_options_submit['cntctfrm_message_error'] = $cntctfrm_option_defaults['cntctfrm_message_error']; $cntctfrm_options_submit['cntctfrm_attachment_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_error']; $cntctfrm_options_submit['cntctfrm_attachment_upload_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_upload_error']; $cntctfrm_options_submit['cntctfrm_attachment_move_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_move_error']; $cntctfrm_options_submit['cntctfrm_attachment_size_error'] = $cntctfrm_option_defaults['cntctfrm_attachment_size_error']; $cntctfrm_options_submit['cntctfrm_captcha_error'] = $cntctfrm_option_defaults['cntctfrm_captcha_error']; $cntctfrm_options_submit['cntctfrm_form_error'] = $cntctfrm_option_defaults['cntctfrm_form_error']; foreach ($cntctfrm_options_submit['cntctfrm_thank_text'] as $key => $val) { $cntctfrm_options_submit['cntctfrm_thank_text'][$key] = stripcslashes(htmlspecialchars($val)); } } else { $cntctfrm_options_submit['cntctfrm_name_label']['en'] = $cntctfrm_option_defaults['cntctfrm_name_label']['en']; $cntctfrm_options_submit['cntctfrm_address_label']['en'] = $cntctfrm_option_defaults['cntctfrm_address_label']['en']; $cntctfrm_options_submit['cntctfrm_email_label']['en'] = $cntctfrm_option_defaults['cntctfrm_email_label']['en']; $cntctfrm_options_submit['cntctfrm_phone_label']['en'] = $cntctfrm_option_defaults['cntctfrm_phone_label']['en']; $cntctfrm_options_submit['cntctfrm_subject_label']['en'] = $cntctfrm_option_defaults['cntctfrm_subject_label']['en']; $cntctfrm_options_submit['cntctfrm_message_label']['en'] = $cntctfrm_option_defaults['cntctfrm_message_label']['en']; $cntctfrm_options_submit['cntctfrm_attachment_label']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_label']['en']; $cntctfrm_options_submit['cntctfrm_attachment_tooltip']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_tooltip']['en']; $cntctfrm_options_submit['cntctfrm_send_copy_label']['en'] = $cntctfrm_option_defaults['cntctfrm_send_copy_label']['en']; $cntctfrm_options_submit['cntctfrm_submit_label']['en'] = $cntctfrm_option_defaults['cntctfrm_submit_label']['en']; $cntctfrm_options_submit['cntctfrm_name_error']['en'] = $cntctfrm_option_defaults['cntctfrm_name_error']['en']; $cntctfrm_options_submit['cntctfrm_address_error']['en'] = $cntctfrm_option_defaults['cntctfrm_address_error']['en']; $cntctfrm_options_submit['cntctfrm_email_error']['en'] = $cntctfrm_option_defaults['cntctfrm_email_error']['en']; $cntctfrm_options_submit['cntctfrm_phone_error']['en'] = $cntctfrm_option_defaults['cntctfrm_phone_error']['en']; $cntctfrm_options_submit['cntctfrm_subject_error']['en'] = $cntctfrm_option_defaults['cntctfrm_subject_error']['en']; $cntctfrm_options_submit['cntctfrm_message_error']['en'] = $cntctfrm_option_defaults['cntctfrm_message_error']['en']; $cntctfrm_options_submit['cntctfrm_attachment_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_error']['en']; $cntctfrm_options_submit['cntctfrm_attachment_upload_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_upload_error']['en']; $cntctfrm_options_submit['cntctfrm_attachment_move_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_move_error']['en']; $cntctfrm_options_submit['cntctfrm_attachment_size_error']['en'] = $cntctfrm_option_defaults['cntctfrm_attachment_size_error']['en']; $cntctfrm_options_submit['cntctfrm_captcha_error']['en'] = $cntctfrm_option_defaults['cntctfrm_captcha_error']['en']; $cntctfrm_options_submit['cntctfrm_form_error']['en'] = $cntctfrm_option_defaults['cntctfrm_form_error']['en']; foreach ($_POST['cntctfrm_thank_text'] as $key => $val) { $cntctfrm_options_submit['cntctfrm_thank_text'][$key] = stripcslashes(htmlspecialchars($_POST['cntctfrm_thank_text'][$key])); } } } /* if 'FROM' field was changed */ if ('custom' == $cntctfrm_options['cntctfrm_from_email'] && 'custom' != $cntctfrm_options_submit['cntctfrm_from_email'] || 'custom' == $cntctfrm_options_submit['cntctfrm_from_email'] && $cntctfrm_options['cntctfrm_custom_from_email'] != $cntctfrm_options_submit['cntctfrm_custom_from_email']) { $notice = __("Email 'FROM' field option was changed, which may cause email messages being moved to the spam folder or email delivery failures.", 'contact_form'); } $cntctfrm_options_submit['cntctfrm_action_after_send'] = $_POST['cntctfrm_action_after_send']; $cntctfrm_options_submit['cntctfrm_redirect_url'] = esc_url($_POST['cntctfrm_redirect_url']); $cntctfrm_options = array_merge($cntctfrm_options, $cntctfrm_options_submit); if (0 == $cntctfrm_options_submit['cntctfrm_action_after_send'] && ("" == trim($cntctfrm_options_submit['cntctfrm_redirect_url']) || !filter_var($cntctfrm_options_submit['cntctfrm_redirect_url'], FILTER_VALIDATE_URL))) { $error .= __("If the 'Redirect to page' option is selected then the URL field should be in the following format", 'contact_form') . " <code>http://your_site/your_page</code>"; $cntctfrm_options['cntctfrm_action_after_send'] = 1; } if ('user' == $cntctfrm_options_submit['cntctfrm_select_email']) { if ('3.3' > $wp_version && function_exists('get_userdatabylogin') && false !== get_userdatabylogin($cntctfrm_options_submit['cntctfrm_user_email'])) { // } else { if (false !== get_user_by('login', $cntctfrm_options_submit['cntctfrm_user_email'])) { // } else { $error .= __("Such user does not exist.", 'contact_form'); } } } else { if (preg_match('|,|', $cntctfrm_options_submit['cntctfrm_custom_email'])) { $cntctfrm_custom_emails = explode(',', $cntctfrm_options_submit['cntctfrm_custom_email']); } else { $cntctfrm_custom_emails[0] = $cntctfrm_options_submit['cntctfrm_custom_email']; } foreach ($cntctfrm_custom_emails as $cntctfrm_custom_email) { if ($cntctfrm_custom_email == "" || !is_email(trim($cntctfrm_custom_email))) { $error .= __("Please enter a valid email address in the 'Use this email address' field.", 'contact_form'); break; } } } if ('custom' == $cntctfrm_options_submit['cntctfrm_from_email']) { if ("" == $cntctfrm_options_submit['cntctfrm_custom_from_email'] || !is_email(trim($cntctfrm_options_submit['cntctfrm_custom_from_email']))) { $error .= __("Please enter a valid email address in the 'FROM' field.", 'contact_form'); } } if ('' == $error) { if (isset($contact_form_multi_active)) { $cntctfrmmlt_options_main = get_option('cntctfrmmlt_options_main'); if ($cntctfrmmlt_options_main['id_form'] !== $_SESSION['cntctfrmmlt_id_form']) { add_option('cntctfrmmlt_options_' . $cntctfrmmlt_options_main['id_form'], $cntctfrm_options); } else { if ($cntctfrmmlt_options_main['id_form'] == $_SESSION['cntctfrmmlt_id_form']) { update_option('cntctfrmmlt_options_' . $cntctfrmmlt_options_main['id_form'], $cntctfrm_options); } } } elseif (isset($contact_form_multi_pro_active)) { $cntctfrmmltpr_options_main = get_option('cntctfrmmltpr_options_main'); if ($cntctfrmmltpr_options_main['id_form'] !== $_SESSION['cntctfrmmlt_id_form']) { add_option('cntctfrmmlt_options_' . $cntctfrmmltpr_options_main['id_form'], $cntctfrm_options); } else { if ($cntctfrmmltpr_options_main['id_form'] == $_SESSION['cntctfrmmlt_id_form']) { update_option('cntctfrmmlt_options_' . $cntctfrmmltpr_options_main['id_form'], $cntctfrm_options); } } } else { update_option('cntctfrm_options', $cntctfrm_options); } $message = __("Settings saved.", 'contact_form'); } else { $error .= ' ' . __("Settings are not saved.", 'contact_form'); } } /* Display form on the setting page */ $lang_codes = array('ab' => 'Abkhazian', 'aa' => 'Afar', 'af' => 'Afrikaans', 'ak' => 'Akan', 'sq' => 'Albanian', 'am' => 'Amharic', 'ar' => 'Arabic', 'an' => 'Aragonese', 'hy' => 'Armenian', 'as' => 'Assamese', 'av' => 'Avaric', 'ae' => 'Avestan', 'ay' => 'Aymara', 'az' => 'Azerbaijani', 'bm' => 'Bambara', 'ba' => 'Bashkir', 'eu' => 'Basque', 'be' => 'Belarusian', 'bn' => 'Bengali', 'bh' => 'Bihari', 'bi' => 'Bislama', 'bs' => 'Bosnian', 'br' => 'Breton', 'bg' => 'Bulgarian', 'my' => 'Burmese', 'ca' => 'Catalan; Valencian', 'ch' => 'Chamorro', 'ce' => 'Chechen', 'ny' => 'Chichewa; Chewa; Nyanja', 'zh' => 'Chinese', 'cu' => 'Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic', 'cv' => 'Chuvash', 'km' => 'Central Khmer', 'kw' => 'Cornish', 'co' => 'Corsican', 'cr' => 'Cree', 'hr' => 'Croatian', 'cs' => 'Czech', 'da' => 'Danish', 'dv' => 'Divehi; Dhivehi; Maldivian', 'nl' => 'Dutch; Flemish', 'dz' => 'Dzongkha', 'eo' => 'Esperanto', 'et' => 'Estonian', 'ee' => 'Ewe', 'fo' => 'Faroese', 'fj' => 'Fijjian', 'fi' => 'Finnish', 'fr' => 'French', 'ff' => 'Fulah', 'gd' => 'Gaelic; Scottish Gaelic', 'gl' => 'Galician', 'lg' => 'Ganda', 'ka' => 'Georgian', 'de' => 'German', 'el' => 'Greek, Modern', 'gn' => 'Guarani', 'gu' => 'Gujarati', 'ht' => 'Haitian; Haitian Creole', 'ha' => 'Hausa', 'he' => 'Hebrew', 'hz' => 'Herero', 'hi' => 'Hindi', 'ho' => 'Hiri Motu', 'hu' => 'Hungarian', 'is' => 'Icelandic', 'io' => 'Ido', 'ig' => 'Igbo', 'id' => 'Indonesian', 'ie' => 'Interlingue', 'ia' => 'Interlingua (International Auxiliary Language Association)', 'iu' => 'Inuktitut', 'ik' => 'Inupiaq', 'ga' => 'Irish', 'it' => 'Italian', 'ja' => 'Japanese', 'jv' => 'Javanese', 'kl' => 'Kalaallisut; Greenlandic', 'kn' => 'Kannada', 'kr' => 'Kanuri', 'ks' => 'Kashmiri', 'kk' => 'Kazakh', 'ki' => 'Kikuyu; Gikuyu', 'rw' => 'Kinyarwanda', 'ky' => 'Kirghiz; Kyrgyz', 'kv' => 'Komi', 'kg' => 'Kongo', 'ko' => 'Korean', 'kj' => 'Kuanyama; Kwanyama', 'ku' => 'Kurdish', 'lo' => 'Lao', 'la' => 'Latin', 'lv' => 'Latvian', 'li' => 'Limburgan; Limburger; Limburgish', 'ln' => 'Lingala', 'lt' => 'Lithuanian', 'lu' => 'Luba-Katanga', 'lb' => 'Luxembourgish; Letzeburgesch', 'mk' => 'Macedonian', 'mg' => 'Malagasy', 'ms' => 'Malay', 'ml' => 'Malayalam', 'mt' => 'Maltese', 'gv' => 'Manx', 'mi' => 'Maori', 'mr' => 'Marathi', 'mh' => 'Marshallese', 'mo' => 'Moldavian', 'mn' => 'Mongolian', 'na' => 'Nauru', 'nv' => 'Navajo; Navaho', 'nr' => 'Ndebele, South; South Ndebele', 'nd' => 'Ndebele, North; North Ndebele', 'ng' => 'Ndonga', 'ne' => 'Nepali', 'se' => 'Northern Sami', 'no' => 'Norwegian', 'nn' => 'Norwegian Nynorsk; Nynorsk, Norwegian', 'nb' => 'Norwegian Bokmål; Bokmål, Norwegian', 'oc' => 'Occitan, Provençal', 'oj' => 'Ojibwa', 'or' => 'Oriya', 'om' => 'Oromo', 'os' => 'Ossetian; Ossetic', 'pi' => 'Pali', 'pa' => 'Panjabi; Punjabi', 'fa' => 'Persian', 'pl' => 'Polish', 'pt' => 'Portuguese', 'ps' => 'Pushto', 'qu' => 'Quechua', 'ro' => 'Romanian', 'rm' => 'Romansh', 'rn' => 'Rundi', 'ru' => 'Russian', 'sm' => 'Samoan', 'sg' => 'Sango', 'sa' => 'Sanskrit', 'sc' => 'Sardinian', 'sr' => 'Serbian', 'sn' => 'Shona', 'ii' => 'Sichuan Yi', 'sd' => 'Sindhi', 'si' => 'Sinhala; Sinhalese', 'sk' => 'Slovak', 'sl' => 'Slovenian', 'so' => 'Somali', 'st' => 'Sotho, Southern', 'es' => 'Spanish; Castilian', 'su' => 'Sundanese', 'sw' => 'Swahili', 'ss' => 'Swati', 'sv' => 'Swedish', 'tl' => 'Tagalog', 'ty' => 'Tahitian', 'tg' => 'Tajik', 'ta' => 'Tamil', 'tt' => 'Tatar', 'te' => 'Telugu', 'th' => 'Thai', 'bo' => 'Tibetan', 'ti' => 'Tigrinya', 'to' => 'Tonga (Tonga Islands)', 'ts' => 'Tsonga', 'tn' => 'Tswana', 'tr' => 'Turkish', 'tk' => 'Turkmen', 'tw' => 'Twi', 'ug' => 'Uighur; Uyghur', 'uk' => 'Ukrainian', 'ur' => 'Urdu', 'uz' => 'Uzbek', 've' => 'Venda', 'vi' => 'Vietnamese', 'vo' => 'Volapük', 'wa' => 'Walloon', 'cy' => 'Welsh', 'fy' => 'Western Frisian', 'wo' => 'Wolof', 'xh' => 'Xhosa', 'yi' => 'Yiddish', 'yo' => 'Yoruba', 'za' => 'Zhuang; Chuang', 'zu' => 'Zulu'); /* Add restore function */ if (isset($_REQUEST['bws_restore_confirm']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { $cntctfrm_options = $cntctfrm_option_defaults; update_option('cntctfrm_options', $cntctfrm_options); $message = __('All plugin settings were restored.', 'contact_form'); } /* end */ /* GO PRO */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { $go_pro_result = bws_go_pro_tab_check($plugin_basename); if (!empty($go_pro_result['error'])) { $error = $go_pro_result['error']; } } ?> <div class="wrap"> <div class="icon32 icon32-bws" id="icon-options-general"></div> <h2><?php _e("Contact Form Settings", 'contact_form'); ?> </h2> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=contact_form.php"><?php _e('Settings', 'contact_form'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'additional' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=contact_form.php&action=additional"><?php _e('Additional settings', 'contact_form'); ?> </a> <a class="nav-tab<?php if (isset($_GET['action']) && 'appearance' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=contact_form.php&action=appearance"><?php _e('Appearance', 'contact_form'); ?> </a> <a class="nav-tab" href="http://bestwebsoft.com/products/contact-form/faq" target="_blank"><?php _e('FAQ', 'contact_form'); ?> </a> <a class="nav-tab bws_go_pro_tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=contact_form.php&action=go_pro"><?php _e('Go PRO', 'contact_form'); ?> </a> </h2> <div class="updated fade" <?php if ($message == "" || "" != $error) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <div id="cntctfrm_settings_notice" class="updated fade" style="display:none"><p><strong><?php _e("Notice:", 'contact_form'); ?> </strong> <?php _e("The plugin's settings have been changed. In order to save them please don't forget to click the 'Save Changes' button.", 'contact_form'); ?> </p></div> <?php if (!empty($notice)) { ?> <div class="error"><p><strong><?php _e('Notice:', 'contact_form'); ?> </strong> <?php echo $notice; ?> </p></div> <?php } ?> <div class="error" <?php if ("" == $error) { echo 'style="display:none"'; } ?> ><p><strong><?php echo $error; ?> </strong></p></div> <?php if (!isset($_GET['action']) || 'additional' == $_GET['action']) { if (isset($_REQUEST['bws_restore_default']) && check_admin_referer($plugin_basename, 'bws_settings_nonce_name')) { bws_form_restore_default_confirm($plugin_basename); } else { /* main 'settings' or 'additional' settings page */ if (!isset($contact_form_multi_active) && !isset($contact_form_multi_pro_active)) { ?> <h2 class="nav-tab-wrapper"> <li class="nav-tab nav-tab-active">NEW_FORM</li> <a id="cntctfrm_show_multi_notice" class="nav-tab" target="_new" href="http://bestwebsoft.com/products/contact-form-multi/?k=747ca825fb44711e2d24e40697747bc6&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " title="<?php _e("If you want to create multiple contact forms, please install the Contact Form Multi plugin.", 'contact_form'); ?> ">+</a> </h2> <?php } $form_action = !isset($_GET['action']) ? 'admin.php?page=contact_form.php' : 'admin.php?page=contact_form.php&action=' . $_GET['action']; ?> <form id="cntctfrm_settings_form" method="post" action="<?php echo $form_action; ?> "> <span style="margin-bottom:15px;"> <?php if (!isset($contact_form_multi_active) && !isset($contact_form_multi_pro_active)) { ?> <p><?php _e("If you would like to add Contact Form to your website, just copy and paste this shortcode to your post or page or widget:", 'contact_form'); ?> <span class="cntctfrm_shortcode">[contact_form]</span> <?php _e("or", 'contact_form'); ?> <span class="cntctfrm_shortcode">[contact_form lang=en]</span><br /> <?php _e("If you have any problems with the standard shortcode [contact_form], you should use the shortcode", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bws_contact_form]</span> (<?php _e("or", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bws_contact_form lang=en]</span>) <?php _e("or", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form]</span> (<?php _e("or", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=en]</span>). <?php _e("They work the same way.", 'contact_form'); ?> </p> <?php } else { ?> <p><?php _e("If you would like to add the Contact Form to your website, just copy and paste this shortcode to your post or page or widget:", 'contact_form'); ?> <span class="cntctfrm_shortcode">[contact_form id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> <?php _e("or", 'contact_form'); ?> <span class="cntctfrm_shortcode">[contact_form lang=en id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?> ]</span><br /> <?php _e("If have any problems with the standard shortcode [contact_form], you should use the shortcode", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bws_contact_form id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> (<?php _e("or", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bws_contact_form lang=en id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?> ]</span>) <?php _e("or", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> (<?php _e("or", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=en id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?> ]</span>). <?php _e("They work the same way.", 'contact_form'); ?> </p> <?php } ?> </span> <div <?php if (isset($_GET['action'])) { echo 'style="display: none;"'; } ?> > <p><?php _e("If you leave the fields empty, the messages will be sent to the email address specified during registration.", 'contact_form'); ?> </p> <table class="form-table" style="width:auto;"> <tr valign="top"> <th scope="row"><?php _e("The user's email address:", 'contact_form'); ?> </th> <td colspan="2"> <input type="radio" id="cntctfrm_select_email_user" name="cntctfrm_select_email" value="user" <?php if ($cntctfrm_options['cntctfrm_select_email'] == 'user') { echo 'checked="checked" '; } ?> /> <select name="cntctfrm_user_email"> <option disabled><?php _e("Select a username", 'contact_form'); ?> </option> <?php foreach ($userslogin as $key => $value) { if (isset($value->data)) { if ($value->data->user_email != '') { ?> <option value="<?php echo $value->data->user_login; ?> " <?php if ($cntctfrm_options['cntctfrm_user_email'] == $value->data->user_login) { echo 'selected="selected" '; } ?> ><?php echo $value->data->user_login; ?> </option> <?php } } else { if ($value->user_email != '') { ?> <option value="<?php echo $value->user_login; ?> " <?php if ($cntctfrm_options['cntctfrm_user_email'] == $value->user_login) { echo 'selected="selected" '; } ?> ><?php echo $value->user_login; ?> </option> <?php } } } ?> </select> <span class="cntctfrm_info"><?php _e("Enter a username of the person who should get the messages from the contact form.", 'contact_form'); ?> </span> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Use this email address:", 'contact_form'); ?> </th> <td colspan="2"> <input type="radio" id="cntctfrm_select_email_custom" name="cntctfrm_select_email" value="custom" <?php if ('custom' == $cntctfrm_options['cntctfrm_select_email']) { echo 'checked="checked" '; } ?> /> <input type="text" name="cntctfrm_custom_email" value="<?php echo $cntctfrm_options['cntctfrm_custom_email']; ?> " onfocus="document.getElementById('cntctfrm_select_email_custom').checked = true;" maxlength="500" /> <span class="cntctfrm_info"><?php _e("Enter the email address you want the messages forwarded to.", 'contact_form'); ?> </span> </td> </tr> </table> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <th scope="row"><?php _e("Add department selectbox to the contact form:", 'contact_form'); ?> </th> <td colspan="2"> <input type="radio" id="cntctfrmpr_select_email_department" name="cntctfrmpr_select_email" value="departments" disabled="disabled" /> <div class="cntctfrmpr_department_table"><img style="width:100%;" src="<?php echo plugins_url('images/pro_screen_1.png', __FILE__); ?> " alt="" /></div> </td> </tr> <tr valign="top"> <th scope="row" colspan="2"> * <?php _e('If you upgrade to Pro version all your settings will be saved.', 'contact_form'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to PRO version.', 'contact_form'); ?> <a href="http://bestwebsoft.com/products/contact-form/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"><?php _e('Learn More', 'contact_form'); ?> </a> </div> <a class="bws_button" href="http://bestwebsoft.com/products/contact-form/buy/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"> <?php _e('Go', 'contact_form'); ?> <strong>PRO</strong> </a> <div class="clear"></div> </div> </div> <table class="form-table" style="width:auto;"> <tr valign="top"> <th scope="row"><?php _e("Save emails to the database", 'contact_form'); ?> </th> <td colspan="2"> <?php if (array_key_exists('contact-form-to-db/contact_form_to_db.php', $all_plugins) || array_key_exists('contact-form-to-db-pro/contact_form_to_db_pro.php', $all_plugins)) { if (is_plugin_active('contact-form-to-db/contact_form_to_db.php') || is_plugin_active('contact-form-to-db-pro/contact_form_to_db_pro.php')) { ?> <input type="checkbox" name="cntctfrm_save_email_to_db" value="1" <?php if (isset($cntctfrmtdb_options) && 1 == $cntctfrmtdb_options["cntctfrmtdb_save_messages_to_db"] || isset($cntctfrmtdbpr_options) && 1 == $cntctfrmtdbpr_options["save_messages_to_db"]) { echo 'checked="checked"'; } ?> /> <span class="bws_info"> (<?php _e('Using', 'contact_form'); ?> <a href="admin.php?page=cntctfrmtdb_manager">Contact Form to DB by BestWebSoft</a>)</span> <?php } else { ?> <input disabled="disabled" type="checkbox" name="cntctfrm_save_email_to_db" value="1" <?php if (isset($cntctfrmtdb_options) && 1 == $cntctfrmtdb_options["cntctfrmtdb_save_messages_to_db"] || isset($cntctfrmtdbpr_options) && 1 == $cntctfrmtdbpr_options["save_messages_to_db"]) { echo 'checked="checked"'; } ?> /> <span class="bws_info">(<?php _e('Using Contact Form to DB by BestWebSoft', 'contact_form'); ?> ) <a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php _e('Activate', 'contact_form'); ?> Contact Form to DB</a></span> <?php } } else { ?> <input disabled="disabled" type="checkbox" name="cntctfrm_save_email_to_db" value="1" /> <span class="bws_info">(<?php _e('Using Contact Form to DB by BestWebSoft', 'contact_form'); ?> ) <a href="http://bestwebsoft.com/products/contact-form-to-db/?k=19d806f45d866e70545de83169b274f2&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> "><?php _e('Download', 'contact_form'); ?> Contact Form to DB</a></span> <?php } ?> </td> </tr> </table> </div> <!-- end of main 'settings' div --> <div <?php if (!isset($_GET['action'])) { echo 'style="display: none;"'; } ?> > <table class="form-table" style="width:auto;"> <tr> <th scope="row"><?php _e('What to use?', 'contact_form'); ?> </th> <td colspan="2"> <fieldset> <label> <input type='radio' name='cntctfrm_mail_method' value='wp-mail' <?php if ('wp-mail' == $cntctfrm_options['cntctfrm_mail_method']) { echo 'checked="checked" '; } ?> /> <?php _e('Wp-mail', 'contact_form'); ?> </label> <label><span class="cntctfrm_info">(<?php _e('You can use the wp_mail function for mailing', 'contact_form'); ?> )</span></label><br /> <label> <input type='radio' name='cntctfrm_mail_method' value='mail' <?php if ('mail' == $cntctfrm_options['cntctfrm_mail_method']) { echo 'checked="checked" '; } ?> /> <?php _e('Mail', 'contact_form'); ?> </label> <label><span class="cntctfrm_info">(<?php _e('To send mail you can use the php mail function', 'contact_form'); ?> )</span></label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("'FROM' field", 'contact_form'); ?> </th> <td style="vertical-align: top;width: 210px;"> <div><?php _e("Name", 'contact_form'); ?> </div> <div> <label> <input type="radio" id="cntctfrm_select_from_custom_field" name="cntctfrm_select_from_field" value="custom" <?php if ('custom' == $cntctfrm_options['cntctfrm_select_from_field']) { echo 'checked="checked" '; } ?> /> <input type="text" name="cntctfrm_from_field" value="<?php echo stripslashes($cntctfrm_options['cntctfrm_from_field']); ?> " onfocus="document.getElementById('cntctfrm_select_from_custom_field').checked = true;" size="18" maxlength="100" /> </label><br/> <div> <label><input type="radio" id="cntctfrm_select_from_field" name="cntctfrm_select_from_field" value="user_name" <?php if ('user_name' == $cntctfrm_options['cntctfrm_select_from_field']) { echo 'checked="checked" '; } ?> /> <?php _e("User name", 'contact_form'); ?> </label> <div class="cntctfrm_help_box"> <div class="cntctfrm_hidden_help_text"><?php echo __("The name of the user who fills the form will be used in the field 'From'.", 'contact_form'); ?> </div> </div> </div> </div> </td> <td> <div><?php _e("Email", 'contact_form'); ?> </div> <div> <div> <input type="radio" id="cntctfrm_from_custom_email" name="cntctfrm_from_email" value="custom" <?php if ('custom' == $cntctfrm_options['cntctfrm_from_email']) { echo 'checked="checked" '; } ?> /> <input type="text" name="cntctfrm_custom_from_email" value="<?php echo $cntctfrm_options['cntctfrm_custom_from_email']; ?> " onfocus="document.getElementById('cntctfrm_from_custom_email').checked = true;" maxlength="100" /> </div> <div> <label><input type="radio" id="cntctfrm_from_email" name="cntctfrm_from_email" value="user" <?php if ('user' == $cntctfrm_options['cntctfrm_from_email']) { echo 'checked="checked" '; } ?> /> <?php _e("User email", 'contact_form'); ?> </label> <div class="cntctfrm_help_box"> <div class="cntctfrm_hidden_help_text"><?php echo __("The email address of the user who fills the form will be used in the field 'From'.", 'contact_form'); ?> </div> </div> </div> <div> <span class="cntctfrm_info">(<?php _e("If this option is changed, email messages may be moved to the spam folder or email delivery failures may occur.", 'contact_form'); ?> )</span> </div> </div> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Required symbol", 'contact_form'); ?> </th> <td colspan="2"> <input type="text" id="cntctfrm_required_symbol" name="cntctfrm_required_symbol" value="<?php echo $cntctfrm_options['cntctfrm_required_symbol']; ?> " maxlength="100" /> </td> </tr> </table> <br /> <table class="cntctfrm_settings_table" style="width:auto;"> <thead> <tr valign="top"> <th scope="row" style="width: 210px;"><?php _e("Fields", 'contact_form'); ?> </th> <th><?php _e("Used", 'contact_form'); ?> </th> <th><?php _e("Required", 'contact_form'); ?> </th> <th><?php _e("Visible", 'contact_form'); ?> </th> <th><?php _e("Disabled for editing", 'contact_form'); ?> </th> <th scope="row" ><?php _e("Field's default value", 'contact_form'); ?> </th> </tr> </thead> <tbody> <tr valign="top" > <td><?php _e("Department selectbox", 'contact_form'); ?> </td> <td class="bws_pro_version"></td> <td class="bws_pro_version"><input disabled="disabled" type="checkbox" name="cntctfrm_required_department_field" value="1"/></td> <td class="bws_pro_version"></td> <td class="bws_pro_version"></td> <td class="bws_pro_version"></td> </tr> <tr valign="top"> <td><?php _e("Name", 'contact_form'); ?> </td> <td><input type="checkbox" name="cntctfrm_display_name_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_name_field']) { echo 'checked="checked" '; } ?> /></td> <td><input type="checkbox" id="cntctfrm_required_name_field" name="cntctfrm_required_name_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_required_name_field']) { echo 'checked="checked" '; } ?> /></td> <td class="bws_pro_version"><input disabled="disabled" type="checkbox" name="cntctfrmpr_visible_name" value="1" checked="checked" /></td> <td class="bws_pro_version"><input disabled="disabled" type="checkbox" name="cntctfrmpr_disabled_name" value="1" /></td> <td class="bws_pro_version"> <input disabled="disabled" type="checkbox" name="cntctfrmpr_default_name" value="1" /> <?php _e("Use User's name as a default value if the user is logged in.", 'contact_form'); ?> <br /> <span class="cntctfrm_info">(<?php _e("'Visible' and 'Disabled for editing' options will be applied only to logged-in users.", 'contact_form'); ?> )</span> </td> </tr> <tr valign="top"> <td><?php _e("Location selectbox", 'contact_form'); ?> </td> <td class="bws_pro_version"><input disabled="disabled" type="checkbox" name="cntctfrmpr_display_selectbox" value="1" /></td> <td class="bws_pro_version"><input disabled="disabled" type="checkbox" name="cntctfrmpr_required_selectbox" value="1" /></td> <td class="bws_pro_version"></td> <td class="bws_pro_version"></td> <td class="bws_pro_version"><input disabled="disabled" type="file" name="cntctfrmpr_default_location"></td> </tr> <tr valign="top"> <td><?php _e("Address", 'contact_form'); ?> </td> <td><input type="checkbox" id="cntctfrm_display_address_field" name="cntctfrm_display_address_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_address_field']) { echo 'checked="checked" '; } ?> /></td> <td><input type="checkbox" id="cntctfrm_required_address_field" name="cntctfrm_required_address_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_required_address_field']) { echo 'checked="checked" '; } ?> /></td> <td></td> <td></td> <td></td> </tr> <tr valign="top"> <td><?php _e("Email Address", 'contact_form'); ?> </td> <td></td> <td><input type="checkbox" id="cntctfrm_required_email_field" name="cntctfrm_required_email_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_required_email_field']) { echo 'checked="checked" '; } ?> /></td> <td class="bws_pro_version"><input disabled="disabled" type="checkbox" name="cntctfrmpr_visible_email" value="1" checked="checked" /></td> <td class="bws_pro_version"><input disabled="disabled" type="checkbox" name="cntctfrmpr_disabled_email" value="1" /></td> <td class="bws_pro_version"> <input disabled="disabled" type="checkbox" name="cntctfrmpr_default_email" value="1" /> <?php _e("Use User's email as a default value if the user is logged in.", 'contact_form'); ?> <br /> <span class="cntctfrm_info">(<?php _e("'Visible' and 'Disabled for editing' options will be applied only to logged-in users.", 'contact_form'); ?> )</span> </td> </tr> <tr valign="top"> <td><?php _e("Phone number", 'contact_form'); ?> </td> <td><input type="checkbox" id="cntctfrm_display_phone_field" name="cntctfrm_display_phone_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_phone_field']) { echo 'checked="checked" '; } ?> /></td> <td><input type="checkbox" id="cntctfrm_required_phone_field" name="cntctfrm_required_phone_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_required_phone_field']) { echo 'checked="checked" '; } ?> /></td> <td></td> <td></td> <td></td> </tr> <tr valign="top"> <td><?php _e("Subject", 'contact_form'); ?> </td> <td></td> <td><input type="checkbox" id="cntctfrm_required_subject_field" name="cntctfrm_required_subject_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_required_subject_field']) { echo 'checked="checked" '; } ?> /></td> <td class="bws_pro_version"><input class="subject" disabled="disabled" type="checkbox" name="cntctfrmpr_visible_subject" value="1" checked="checked" /></td> <td class="bws_pro_version"><input class="subject" disabled="disabled" type="checkbox" name="cntctfrmpr_disabled_subject" value="1" /></td> <td class="bws_pro_version"><input class="subject" disabled="disabled" type="text" name="cntctfrmpr_default_subject" value="" /></td> </tr> <tr valign="top"> <td><?php _e("Message", 'contact_form'); ?> </td> <td></td> <td><input type="checkbox" id="cntctfrm_required_message_field" name="cntctfrm_required_message_field" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_required_message_field']) { echo 'checked="checked" '; } ?> /></td> <td class="bws_pro_version"><input class="message" disabled="disabled" type="checkbox" name="cntctfrmpr_visible_message" value="1" checked="checked" /></td> <td class="bws_pro_version"><input class="message" disabled="disabled" disabled="disabled" type="checkbox" name="cntctfrmpr_disabled_message" value="1" /></td> <td class="bws_pro_version"><input class="message" disabled="disabled" type="text" name="cntctfrmpr_default_message" value="" /></td> </tr> <tr valign="top"> <td></td> <td></td> <td></td> <td colspan="3" class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to PRO version.', 'contact_form'); ?> <a href="http://bestwebsoft.com/products/contact-form/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"><?php _e('Learn More', 'contact_form'); ?> </a> </div> <a class="bws_button" href="http://bestwebsoft.com/products/contact-form/buy/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"> <?php _e('Go', 'contact_form'); ?> <strong>PRO</strong> </a> <div class="clear"></div> </td> </tr> <tr valign="top"> <td> <?php _e("Attachment block", 'contact_form'); ?> <div class="cntctfrm_help_box"> <div class="cntctfrm_hidden_help_text"><?php echo __("Users can attach the following file formats", 'contact_form') . ": html, txt, css, gif, png, jpeg, jpg, tiff, bmp, ai, eps, ps, rtf, pdf, doc, docx, xls, xlsx, zip, rar, wav, mp3, ppt, aar, sce"; ?> </div> </div> </td> <td><input type="checkbox" id="cntctfrm_attachment" name="cntctfrm_attachment" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_attachment']) { echo 'checked="checked" '; } ?> /></td> <td></td> <td></td> <td></td> <td></td> </tr> </tbody> </table> <table class="form-table" style="width:auto;"> <tr valign="top"> <th scope="row"><?php _e("Add to the form", 'contact_form'); ?> </th> <td style="width:750px;" colspan="3"> <div> <label> <input type="checkbox" id="cntctfrm_attachment_explanations" name="cntctfrm_attachment_explanations" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_attachment_explanations'] && '1' == $cntctfrm_options['cntctfrm_attachment']) { echo 'checked="checked" '; } ?> /> <?php _e("Tips below the Attachment", 'contact_form'); ?> </label> <div class="cntctfrm_help_box"> <div class="cntctfrm_hidden_help_text"><img title="" src="<?php echo plugins_url('images/tooltip_attachment_tips.png', __FILE__); ?> " alt=""/></div> </div> </div> <div> <label> <input type="checkbox" id="cntctfrm_send_copy" name="cntctfrm_send_copy" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_send_copy']) { echo 'checked="checked" '; } ?> /> <?php _e("'Send me a copy' block", 'contact_form'); ?> </label> <div class="cntctfrm_help_box"> <div class="cntctfrm_hidden_help_text"><img title="" src="<?php echo plugins_url('images/tooltip_sendme_block.png', __FILE__); ?> " alt=""/></div> </div> </div> <div style="clear: both;"> <?php if (array_key_exists('captcha/captcha.php', $all_plugins) || array_key_exists('captcha-plus/captcha-plus.php', $all_plugins) || array_key_exists('captcha-pro/captcha_pro.php', $all_plugins)) { if (is_plugin_active('captcha/captcha.php') || is_plugin_active('captcha-plus/captcha-plus.php') || is_plugin_active('captcha-pro/captcha_pro.php')) { ?> <label><input type="checkbox" name="cntctfrm_display_captcha" value="1" <?php if (isset($cptch_options) && 1 == $cptch_options["cptch_contact_form"] || isset($cptchpls_options) && 1 == $cptchpls_options["cptchpls_contact_form"] || isset($cptchpr_options) && 1 == $cptchpr_options["cptchpr_contact_form"]) { echo 'checked="checked"'; } ?> /> Captcha by BestWebSoft</label> <?php } else { ?> <label><input disabled="disabled" type="checkbox" name="cntctfrm_display_captcha" value="1" <?php if (isset($cptch_options) && 1 == $cptch_options["cptch_contact_form"] || isset($cptchpls_options) && 1 == $cptchpls_options["cptchpls_contact_form"] || isset($cptchpr_options) && 1 == $cptchpr_options["cptchpr_contact_form"]) { echo 'checked="checked"'; } ?> /> Captcha by BestWebSoft</label> <span class="bws_info"><a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php _e('Activate captcha', 'contact_form'); ?> </a></span> <?php } } else { ?> <label><input disabled="disabled" type="checkbox" name="cntctfrm_display_captcha" value="1" /> Captcha by BestWebSoft</label> <span class="bws_info"><a href="http://bestwebsoft.com/products/captcha/?k=19ac1e9b23bea947cfc4a9b8e3326c03&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> "><?php _e('Download captcha', 'contact_form'); ?> </a></span> <?php } ?> </div> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <div class="bws_pro_version"> <fieldset> <label><input disabled="disabled" type="checkbox" value="1" name="cntctfrmpr_display_privacy_check"> <?php _e('Agreement checkbox', 'contact_form'); ?> <span class="bws_info">(<?php _e('Required checkbox for submitting the form', 'contact_form'); ?> )</span></label><br /> <label><input disabled="disabled" type="checkbox" value="1" name="cntctfrmpr_display_optional_check"> <?php _e('Optional checkbox', 'contact_form'); ?> <span class="bws_info">(<?php _e('Optional checkbox, the results of which will be displayed in email', 'contact_form'); ?> )</span></label> </fieldset> </div> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to PRO version.', 'contact_form'); ?> <a href="http://bestwebsoft.com/products/contact-form/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"><?php _e('Learn More', 'contact_form'); ?> </a> </div> <a class="bws_button" href="http://bestwebsoft.com/products/contact-form/buy/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"> <?php _e('Go', 'contact_form'); ?> <strong>PRO</strong> </a> <div class="clear"></div> </div> </div> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Delete an attachment file from the server after the email is sent", 'contact_form'); ?> </th> <td colspan="3"> <input type="checkbox" id="cntctfrm_delete_attached_file" name="cntctfrm_delete_attached_file" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_delete_attached_file']) { echo 'checked="checked" '; } ?> /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Email in HTML format sending", 'contact_form'); ?> </th> <td colspan="2"><input type="checkbox" name="cntctfrm_html_email" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_html_email']) { echo 'checked="checked" '; } ?> /></td> </tr> <tr valign="top"> <th scope="row"><?php _e("Display additional info in the email", 'contact_form'); ?> </th> <td style="width:15px;" class="cntctfrm_td_top_align"> <input type="checkbox" id="cntctfrm_display_add_info" name="cntctfrm_display_add_info" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_add_info']) { echo 'checked="checked" '; } ?> /> </td> <td class="cntctfrm_display_add_info_block" <?php if ('0' == $cntctfrm_options['cntctfrm_display_add_info']) { echo 'style="display:none"'; } ?> > <fieldset> <label><input type="checkbox" id="cntctfrm_display_sent_from" name="cntctfrm_display_sent_from" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_sent_from']) { echo 'checked="checked" '; } ?> /> <?php _e("Sent from (ip address)", 'contact_form'); ?> </label> <label class="bws_info"><?php _e("Example: Sent from (IP address):\t127.0.0.1", 'contact_form'); ?> </label><br /> <label><input type="checkbox" id="cntctfrm_display_date_time" name="cntctfrm_display_date_time" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_date_time']) { echo 'checked="checked" '; } ?> /> <?php _e("Date/Time", 'contact_form'); ?> </label> <label class="bws_info"><?php _e("Example: Date/Time:\tAugust 19, 2013 8:50 pm", 'contact_form'); ?> </label><br /> <label><input type="checkbox" id="cntctfrm_display_coming_from" name="cntctfrm_display_coming_from" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_coming_from']) { echo 'checked="checked" '; } ?> /> <?php _e("Sent from (referer)", 'contact_form'); ?> </label> <label class="bws_info"><?php _e("Example: Sent from (referer):\thttp://bestwebsoft.com/contacts/contact-us/", 'contact_form'); ?> </label><br /> <label><input type="checkbox" id="cntctfrm_display_user_agent" name="cntctfrm_display_user_agent" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_display_user_agent']) { echo 'checked="checked" '; } ?> /> <?php _e("Using (user agent)", 'contact_form'); ?> </label> <label class="bws_info"><?php _e("Example: Using (user agent):\tMozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36", 'contact_form'); ?> </label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Language settings for the field names in the form", 'contact_form'); ?> </th> <td colspan="2"> <select name="cntctfrm_languages" id="cntctfrm_languages" style="width:300px;"> <?php foreach ($lang_codes as $key => $val) { if (in_array($key, $cntctfrm_options['cntctfrm_language'])) { continue; } echo '<option value="' . esc_attr($key) . '"> ' . esc_html($val) . '</option>'; } ?> </select> <input type="button" class="button-primary" id="cntctfrm_add_language_button" value="<?php _e('Add a language', 'contact_form'); ?> " /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Change the names of the contact form fields and error messages", 'contact_form'); ?> </th> <td style="width:15px;" class="cntctfrm_td_top_align"> <input type="checkbox" id="cntctfrm_change_label" name="cntctfrm_change_label" value="1" <?php if ($cntctfrm_options['cntctfrm_change_label'] == '1') { echo 'checked="checked" '; } ?> /> </td> <td class="cntctfrm_change_label_block" <?php if ('0' == $cntctfrm_options['cntctfrm_change_label']) { echo 'style="display:none"'; } ?> > <div class="cntctfrm_label_language_tab cntctfrm_active" id="cntctfrm_label_en"><?php _e('English', 'contact_form'); ?> </div> <?php if (!empty($cntctfrm_options['cntctfrm_language'])) { foreach ($cntctfrm_options['cntctfrm_language'] as $val) { echo '<div class="cntctfrm_label_language_tab" id="cntctfrm_label_' . $val . '">' . $lang_codes[$val] . ' <span class="cntctfrm_delete" rel="' . $val . '">X</span></div>'; } } ?> <div class="clear"></div> <div class="cntctfrm_language_tab cntctfrm_tab_en"> <div class="cntctfrm_language_tab_block_mini" style="display:none;"><?php _e("click to expand/hide the list", 'contact_form'); ?> </div> <div class="cntctfrm_language_tab_block"> <input type="text" maxlength="250" name="cntctfrm_name_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_name_label']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Name:", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_address_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_address_label']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Address:", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_email_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_email_label']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Email Address:", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_phone_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_phone_label']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Phone number:", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_subject_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_subject_label']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Subject:", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_message_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_message_label']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Message:", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_label']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Attachment:", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_tooltip[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_tooltip']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Tips below the Attachment block", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_send_copy_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_send_copy_label']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Send me a copy", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_submit_label[en]" value="<?php echo $cntctfrm_options['cntctfrm_submit_label']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Submit", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_name_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_name_error']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the Name field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_address_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_address_error']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the Address field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_email_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_email_error']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the Email field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_phone_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_phone_error']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the Phone field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_subject_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_subject_error']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the Subject field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_message_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_message_error']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the Message field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_error']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Error message about the file type for the Attachment field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_upload_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_upload_error']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Error message while uploading a file for the Attachment field to the server", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_move_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_move_error']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Error message while moving the file for the Attachment field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_size_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_attachment_size_error']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Error message when file size limit for the Attachment field is exceeded", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_captcha_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_captcha_error']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the Captcha field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_form_error[en]" value="<?php echo $cntctfrm_options['cntctfrm_form_error']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the whole form", 'contact_form'); ?> </span><br /> </div> <?php if (!isset($contact_form_multi_active) && !isset($contact_form_multi_pro_active)) { ?> <span class="cntctfrm_info" style="margin-left: 5px;"><?php _e("Use shortcode", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=en]</span> <?php _e("or", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form]</span> <?php _e("for this language", 'contact_form'); ?> </span> <?php } else { ?> <span class="cntctfrm_info" style="margin-left: 5px;"><?php _e("Use shortcode", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=en id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> <?php _e("or", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> <?php _e("for this language", 'contact_form'); ?> </span> <?php } ?> </div> <?php if (!empty($cntctfrm_options['cntctfrm_language'])) { foreach ($cntctfrm_options['cntctfrm_language'] as $val) { ?> <div class="cntctfrm_language_tab hidden cntctfrm_tab_<?php echo $val; ?> "> <div class="cntctfrm_language_tab_block_mini" style="display:none;"><?php _e("click to expand/hide the list", 'contact_form'); ?> </div> <div class="cntctfrm_language_tab_block"> <input type="text" maxlength="250" name="cntctfrm_name_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_name_label'][$val])) { echo $cntctfrm_options['cntctfrm_name_label'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Name:", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_address_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_address_label'][$val])) { echo $cntctfrm_options['cntctfrm_address_label'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Address:", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_email_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_email_label'][$val])) { echo $cntctfrm_options['cntctfrm_email_label'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Email Address:", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_phone_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_phone_label'][$val])) { echo $cntctfrm_options['cntctfrm_phone_label'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Phone number:", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_subject_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_subject_label'][$val])) { echo $cntctfrm_options['cntctfrm_subject_label'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Subject:", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_message_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_message_label'][$val])) { echo $cntctfrm_options['cntctfrm_message_label'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Message:", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_attachment_label'][$val])) { echo $cntctfrm_options['cntctfrm_attachment_label'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Attachment:", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_tooltip[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_attachment_tooltip'][$val])) { echo $cntctfrm_options['cntctfrm_attachment_tooltip'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Tips below the Attachment block", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_send_copy_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_send_copy_label'][$val])) { echo $cntctfrm_options['cntctfrm_send_copy_label'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Send me a copy", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_submit_label[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_submit_label'][$val])) { echo $cntctfrm_options['cntctfrm_submit_label'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Submit", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_name_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_name_error'][$val])) { echo $cntctfrm_options['cntctfrm_name_error'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the Name field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_address_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_address_error'][$val])) { echo $cntctfrm_options['cntctfrm_address_error'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the Address field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_email_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_email_error'][$val])) { echo $cntctfrm_options['cntctfrm_email_error'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the Email field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_phone_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_phone_error'][$val])) { echo $cntctfrm_options['cntctfrm_phone_error'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the Phone field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_subject_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_subject_error'][$val])) { echo $cntctfrm_options['cntctfrm_subject_error'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the Subject field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_message_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_message_error'][$val])) { echo $cntctfrm_options['cntctfrm_message_error'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the Message field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_attachment_error'][$val])) { echo $cntctfrm_options['cntctfrm_attachment_error'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Error message about the file type for the Attachment field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_upload_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_attachment_upload_error'][$val])) { echo $cntctfrm_options['cntctfrm_attachment_upload_error'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Error message while uploading a file for the Attachment field to the server", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_move_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_attachment_move_error'][$val])) { echo $cntctfrm_options['cntctfrm_attachment_move_error'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Error message while moving the file for the Attachment field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_attachment_size_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_attachment_size_error'][$val])) { echo $cntctfrm_options['cntctfrm_attachment_size_error'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Error message when file size limit for the Attachment field is exceeded", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_captcha_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_captcha_error'][$val])) { echo $cntctfrm_options['cntctfrm_captcha_error'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the Captcha field", 'contact_form'); ?> </span><br /> <input type="text" maxlength="250" name="cntctfrm_form_error[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_form_error'][$val])) { echo $cntctfrm_options['cntctfrm_form_error'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Error message for the whole form", 'contact_form'); ?> </span><br /> </div> <?php if (!isset($contact_form_multi_active) && !isset($contact_form_multi_pro_active)) { ?> <span class="cntctfrm_info" style="margin-left: 5px;"><?php _e("Use shortcode", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=<?php echo $val; ?> ]</span> <?php _e("for this language", 'contact_form'); ?> </span> <?php } else { ?> <span class="cntctfrm_info" style="margin-left: 5px;"><?php _e("Use shortcode", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=<?php $val . ' id=' . $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> <?php _e("for this language", 'contact_form'); ?> </span> <?php } ?> </div> <?php } } ?> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Use the changed names of the contact form fields in the email', 'contact_form'); ?> </th> <td colspan="2"> <input type="checkbox" name="cntctfrm_change_label_in_email" value="1" <?php if ($cntctfrm_options['cntctfrm_change_label_in_email'] == '1') { echo 'checked="checked" '; } ?> /> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Action after email is sent", 'contact_form'); ?> </th> <td colspan="2" class="cntctfrm_action_after_send_block"> <label><input type="radio" id="cntctfrm_action_after_send" name="cntctfrm_action_after_send" value="1" <?php if ('1' == $cntctfrm_options['cntctfrm_action_after_send']) { echo 'checked="checked" '; } ?> /> <?php _e("Display text", 'contact_form'); ?> </label><br /> <div class="cntctfrm_label_language_tab cntctfrm_active" id="cntctfrm_text_en"><?php _e('English', 'contact_form'); ?> </div> <?php if (!empty($cntctfrm_options['cntctfrm_language'])) { foreach ($cntctfrm_options['cntctfrm_language'] as $val) { echo '<div class="cntctfrm_label_language_tab" id="cntctfrm_text_' . $val . '">' . $lang_codes[$val] . ' <span class="cntctfrm_delete" rel="' . $val . '">X</span></div>'; } } ?> <div class="clear"></div> <div class="cntctfrm_language_tab cntctfrm_tab_en" style=" padding: 5px 10px 5px 5px;"> <input type="text" maxlength="250" name="cntctfrm_thank_text[en]" value="<?php echo $cntctfrm_options['cntctfrm_thank_text']['en']; ?> " /> <span class="cntctfrm_info"><?php _e("Text", 'contact_form'); ?> </span><br /> <?php if (!isset($contact_form_multi_active) && !isset($contact_form_multi_pro_active)) { ?> <span class="cntctfrm_info"><?php _e("Use shortcode", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=en]</span> <?php _e("or", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form]</span> <?php _e("for this language", 'contact_form'); ?> </span> <?php } else { ?> <span class="cntctfrm_info"><?php _e("Use shortcode", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=en id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> <?php _e("or", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form id=<?php echo $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> <?php _e("for this language", 'contact_form'); ?> </span> <?php } ?> </div> <?php if (!empty($cntctfrm_options['cntctfrm_language'])) { foreach ($cntctfrm_options['cntctfrm_language'] as $val) { ?> <div class="cntctfrm_language_tab hidden cntctfrm_tab_<?php echo $val; ?> " style=" padding: 5px 10px 5px 5px;"> <label><input type="text" maxlength="250" name="cntctfrm_thank_text[<?php echo $val; ?> ]" value="<?php if (isset($cntctfrm_options['cntctfrm_thank_text'][$val])) { echo $cntctfrm_options['cntctfrm_thank_text'][$val]; } ?> " /> <span class="cntctfrm_info"><?php _e("Text", 'contact_form'); ?> </span></label><br /> <?php if (!isset($contact_form_multi_active) && !isset($contact_form_multi_pro_active)) { ?> <span class="cntctfrm_info"><?php _e("Use shortcode", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=<?php echo $val; ?> ]</span> <?php _e("for this language", 'contact_form'); ?> </span> <?php } else { ?> <span class="cntctfrm_info"><?php _e("Use shortcode", 'contact_form'); ?> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form lang=<?php echo $val . ' id=' . $_SESSION['cntctfrmmlt_id_form']; ?> ]</span> <?php _e("for this language", 'contact_form'); ?> </span> <?php } ?> </div> <?php } } ?> <div id="cntctfrm_before"></div> <br /> <input type="radio" id="cntctfrm_action_after_send_url" name="cntctfrm_action_after_send" value="0" <?php if ('0' == $cntctfrm_options['cntctfrm_action_after_send']) { echo 'checked="checked" '; } ?> /> <?php _e("Redirect to the page", 'contact_form'); ?> <br /> <label><input type="text" maxlength="250" name="cntctfrm_redirect_url" value="<?php echo $cntctfrm_options['cntctfrm_redirect_url']; ?> " onfocus="document.getElementById('cntctfrm_action_after_send_url').checked = true;" /> <span class="cntctfrm_info"><?php _e("Url", 'contact_form'); ?> </span></label> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('The $_SERVER variable that is used to build a URL of the form', 'contact_form'); ?> </th> <td colspan="2"> <fieldset> <label><input type="radio" name="cntctfrm_site_name_parameter" value="SERVER_NAME" <?php if ('SERVER_NAME' == $cntctfrm_options['cntctfrm_site_name_parameter']) { echo 'checked="checked" '; } ?> /> SERVER_NAME</label><br /> <label><input type="radio" name="cntctfrm_site_name_parameter" value="HTTP_HOST" <?php if ('HTTP_HOST' == $cntctfrm_options['cntctfrm_site_name_parameter']) { echo 'checked="checked" '; } ?> /> HTTP_HOST</label><br /> <span class="cntctfrm_info"><?php _e("If you are not sure whether to change this setting or not, please do not do that.", 'contact_form'); ?> </span> </fieldset> </td> </tr> </table> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <th scope="row"><?php _e('Auto Response', 'contact_form'); ?> </th> <td colspan="2"> <input disabled="disabled" type="checkbox" value="1" name="cntctfrm_auto_response" checked="checked"/> <textarea name="cntctfrm_auto_response_message" style="position: relative; margin-left: 20px; z-index: -1;">Dear %%NAME%%, Thank you for contacting us. We have received your message and will reply to it shortly. Regards, %%SITENAME%% Team.</textarea><br/> <span class="cntctfrm_info" style="margin-left: 45px"><?php _e("You can use %%NAME%% to display data from the email field and %%MESSAGE%% to display data from the Message field, as well as %%SITENAME%% to display blog name.", 'contact_form'); ?> </span> </td> </tr> <tr valign="top"> <th scope="row" colspan="2"> * <?php _e('If you upgrade to Pro version all your settings will be saved.', 'contact_form'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to PRO version.', 'contact_form'); ?> <a href="http://bestwebsoft.com/products/contact-form/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"><?php _e('Learn More', 'contact_form'); ?> </a> </div> <a class="bws_button" href="http://bestwebsoft.com/products/contact-form/buy/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"> <?php _e('Go', 'contact_form'); ?> <strong>PRO</strong> </a> <div class="clear"></div> </div> </div> </div> <!-- end of 'Additional' settings --> <input type="hidden" name="cntctfrm_form_submit" value="submit" /> <p class="submit"> <input type="submit" class="button-primary" value="<?php _e('Save Changes', 'contact_form'); ?> " /> </p> <?php wp_nonce_field($plugin_basename, 'cntctfrm_nonce_name'); ?> </form> <?php bws_form_restore_default_settings($plugin_basename); } } elseif ('appearance' == $_GET['action']) { ?> <div id="<?php echo is_rtl() ? 'cntctfrmpr_right_table' : 'cntctfrmpr_left_table'; ?> "> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <th scope="row"><?php _e("Errors output", 'contact_form'); ?> </th> <td colspan="2"> <select name="cntctfrmpr_error_displaying"> <option value="labels"><?php _e("Display error messages", 'contact_form'); ?> </option> <option value="input_colors"><?php _e("Color of the input field errors.", 'contact_form'); ?> </option> <option value="both" selected="selected"><?php _e("Display error messages & color of the input field errors", 'contact_form'); ?> </option> </select> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Add placeholder to the input blocks", 'contact_form'); ?> </th> <td colspan="2"> <input disabled='disabled' type="checkbox" name="cntctfrmpr_placeholder" value="1" checked="checked"/> </td> </tr> <tr valign="top"> <th scope="row"><?php _e("Add tooltips", 'contact_form'); ?> </th> <td colspan="2"> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_name" value="1" checked="checked"/> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_name"><?php _e("Name", 'contact_form'); ?> </label> </div> <?php if ('1' == $cntctfrm_options['cntctfrm_display_address_field']) { ?> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_address" value="1" checked="checked"/> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_address"><?php _e("Address", 'contact_form'); ?> </label> </div> <?php } ?> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_email" value="1" checked="checked"/> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_email"><?php _e("Email address", 'contact_form'); ?> </label> </div> <?php if ('1' == $cntctfrm_options['cntctfrm_display_phone_field']) { ?> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_phone" value="1" checked="checked"/> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_phone"><?php _e("Phone Number", 'contact_form'); ?> </label> </div> <?php } ?> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_subject" value="1" checked="checked"/> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_subject"><?php _e("Subject", 'contact_form'); ?> </label> </div> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_message" value="1" checked="checked"/> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_message"><?php _e("Message", 'contact_form'); ?> </label> </div> <?php if ('1' == $cntctfrm_options['cntctfrm_attachment_explanations']) { ?> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_attachment" value="1" checked="checked"/> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_attachment"><?php _e("Attachment", 'contact_form'); ?> </label> </div> <?php } ?> <div> <input disabled='disabled' type="checkbox" name="cntctfrmpr_tooltip_display_captcha" value="1" /> <label class="cntctfrmpr_tooltip_label" for="cntctfrmpr_tooltip_display_captcha">Captcha by BestWebSoft</label> </div> </td> </tr> <tr valign="top"> <th colspan="3" scope="row"><input disabled='disabled' type="checkbox" id="cntctfrmpr_style_options" name="cntctfrmpr_style_options" value="1" checked="checked" /> <?php _e("Style options", 'contact_form'); ?> </th> </tr> <tr valign="top" class="cntctfrm_style_block"> <th scope="row"><?php _e("Text color", 'contact_form'); ?> </th> <td colspan="2"> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_label_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e('Label text color', 'contact_form'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_input_placeholder_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e("Placeholder color", 'contact_form'); ?> </div> </div> </td> </tr> <tr valign="top" class="cntctfrm_style_block"> <th scope="row"><?php _e("Errors color", 'contact_form'); ?> </th> <td colspan="2"> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_error_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e('Error text color', 'contact_form'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_error_input_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e('Background color of the input field errors', 'contact_form'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_error_input_border_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e('Border color of the input field errors', 'contact_form'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" id="" value="<?php _e('Default', 'contact_form'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_input_placeholder_error_color" value="" class="cntctfrmpr_colorPicker " /> <div class="cntctfrm_label_block"><?php _e("Placeholder color of the input field errors", 'contact_form'); ?> </div> </div> </td> </tr> <tr valign="top" class="cntctfrm_style_block"> <th scope="row"><?php _e("Input fields", 'contact_form'); ?> </th> <td colspan="2"> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" id="" value="<?php _e('Default', 'contact_form'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_input_background" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e("Input fields background color", 'contact_form'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_input_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e("Text fields color", 'contact_form'); ?> </div> </div> <div> <input disabled='disabled' size="8" type="text" value="" name="cntctfrmpr_border_input_width" /> <div class="cntctfrm_label_block"><?php _e('Border width in px, numbers only', 'contact_form'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_border_input_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e('Border color', 'contact_form'); ?> </div> </div> </td> </tr> <tr valign="top" class="cntctfrm_style_block"> <th scope="row"><?php _e("Submit button", 'contact_form'); ?> </th> <td colspan="2"> <div> <input disabled='disabled' size="8" type="text" value="" name="cntctfrmpr_button_width" /> <div class="cntctfrm_label_block"><?php _e('Width in px, numbers only', 'contact_form'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_button_backgroud" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e('Button color', 'contact_form'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_button_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e("Button text color", 'contact_form'); ?> </div> </div> <div> <input disabled='disabled' type="button" class="cntctfrmpr_default button-small button" value="<?php _e('Default', 'contact_form'); ?> " /> <input disabled='disabled' type="text" size="8" name="cntctfrmpr_border_button_color" value="" class="cntctfrmpr_colorPicker" /> <div class="cntctfrm_label_block"><?php _e('Border color', 'contact_form'); ?> </div> </div> </td> </tr> <tr valign="top"> <th scope="row" colspan="2"> * <?php _e('If you upgrade to Pro version all your settings will be saved.', 'contact_form'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to PRO version.', 'contact_form'); ?> <a href="http://bestwebsoft.com/products/contact-form/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"><?php _e('Learn More', 'contact_form'); ?> </a> </div> <a class="bws_button" href="http://bestwebsoft.com/products/contact-form/buy/?k=697c5e74f39779ce77850e11dbe21962&pn=77&v=<?php echo $cntctfrm_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Contact Form Pro"> <?php _e('Go', 'contact_form'); ?> <strong>PRO</strong> </a> <div class="clear"></div> </div> </div> <input type="hidden" name="cntctfrmpr_form_submit" value="submit" /> <p class="submit"> <input disabled='disabled' type="button" class="button-primary" value="<?php _e('Save Changes', 'contact_form'); ?> " /> </p> </div> <div id="<?php echo is_rtl() ? 'cntctfrmpr_left_table' : 'cntctfrmpr_right_table'; ?> "> <h3><?php _e("Contact Form Pro | Preview", 'contact_form'); ?> </h3> <div id="cntctfrmpr_show_errors_block"> <input disabled="" type="checkbox" id="cntctfrmpr_show_errors" name="cntctfrmpr_show_errors" /> <?php _e("Show with errors", 'contact_form'); ?> </div> <div id="cntctfrmpr_contact_form" class="cntctfrm_contact_form"> <div class="cntctfrmpr_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_form_error']['en']; ?> </div> <div class="cntctfrm_label cntctfrm_label_name"> <label for="cntctfrmpr_contact_name"><?php echo $cntctfrm_options['cntctfrm_name_label']['en']; if (1 == $cntctfrm_options['cntctfrm_required_name_field']) { echo '<span class="required"> *</span>'; } ?> </label> </div> <div class="cntctfrmpr_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_name_error']['en']; ?> </div> <div class="cntctfrm_input cntctfrm_input_name"> <input placeholder="<?php _e("Please enter your full name...", 'contact_form'); ?> " class="text" type="text" size="40" value="" name="cntctfrmpr_contact_name" id="cntctfrmpr_contact_name"/> <div class="cntctfrmpr_help_box"> <div class="cntctfrmpr_hidden_help_text"><?php _e("Please enter your full name...", 'contact_form'); ?> </div> </div> </div> <?php if (1 == $cntctfrm_options['cntctfrm_display_address_field']) { ?> <div class="cntctfrm_label cntctfrm_label_address"> <label for="cntctfrmpr_contact_address"><?php echo $cntctfrm_options['cntctfrm_address_label']['en']; if (1 == $cntctfrm_options['cntctfrm_required_address_field']) { echo '<span class="required"> *</span>'; } ?> </label> </div> <?php if (1 == $cntctfrm_options['cntctfrm_required_address_field']) { ?> <div class="cntctfrmpr_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_address_error']['en']; ?> </div> <?php } ?> <div class="cntctfrm_input cntctfrm_input_address"> <input placeholder="<?php _e("Please enter your address...", 'contact_form'); ?> " class="text" type="text" size="40" value="" name="cntctfrmpr_contact_address" id="cntctfrmpr_contact_address" /> <div class="cntctfrmpr_help_box"> <div class="cntctfrmpr_hidden_help_text"><?php _e("Please enter your address...", 'contact_form'); ?> </div> </div> </div> <?php } ?> <div class="cntctfrm_label cntctfrm_label_email"> <label for="cntctfrmpr_contact_email"><?php echo $cntctfrm_options['cntctfrm_email_label']['en']; if (1 == $cntctfrm_options['cntctfrm_required_email_field']) { echo '<span class="required"> *</span>'; } ?> </label> </div> <div class="cntctfrmpr_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_email_error']['en']; ?> </div> <div class="cntctfrm_input cntctfrm_input_email"> <input placeholder="<?php _e("Please enter your email address...", 'contact_form'); ?> " class="text" type="text" size="40" value="" name="cntctfrmpr_contact_email" id="cntctfrmpr_contact_email" /> <div class="cntctfrmpr_help_box"> <div class="cntctfrmpr_hidden_help_text"><?php _e("Please enter your email address...", 'contact_form'); ?> </div> </div> </div> <?php if (1 == $cntctfrm_options['cntctfrm_display_phone_field']) { ?> <div class="cntctfrm_label cntctfrm_label_phone"> <label for="cntctfrmpr_contact_phone"><?php echo $cntctfrm_options['cntctfrm_phone_label']['en']; if (1 == $cntctfrm_options['cntctfrm_required_phone_field']) { echo '<span class="required"> *</span>'; } ?> </label> </div> <div class="cntctfrmpr_error_text hidden"><?php echo $cntctfrm_options['phone_error']['en']; ?> </div> <div class="cntctfrm_input cntctfrm_input_phone"> <input placeholder="<?php _e("Please enter your phone number...", 'contact_form'); ?> " class="text" type="text" size="40" value="" name="cntctfrmpr_contact_phone" id="cntctfrmpr_contact_phone" /> <div class="cntctfrmpr_help_box"> <div class="cntctfrmpr_hidden_help_text"><?php _e("Please enter your phone number...", 'contact_form'); ?> </div> </div> </div> <?php } ?> <div class="cntctfrm_label cntctfrm_label_subject"> <label for="cntctfrmpr_contact_subject"><?php echo $cntctfrm_options['cntctfrm_subject_label']['en']; if (1 == $cntctfrm_options['cntctfrm_required_subject_field']) { echo '<span class="required"> *</span>'; } ?> </label> </div> <div class="cntctfrmpr_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_subject_error']['en']; ?> </div> <div class="cntctfrm_input cntctfrm_input_subject"> <input placeholder="<?php _e("Please enter subject...", 'contact_form'); ?> " class="text" type="text" size="40" value="" name="cntctfrmpr_contact_subject" id="cntctfrmpr_contact_subject" /> <div class="cntctfrmpr_help_box"> <div class="cntctfrmpr_hidden_help_text"><?php _e("Please enter subject...", 'contact_form'); ?> </div> </div> </div> <div class="cntctfrm_label cntctfrm_label_message"> <label for="cntctfrmpr_contact_message"><?php echo $cntctfrm_options['cntctfrm_message_label']['en']; if (1 == $cntctfrm_options['cntctfrm_required_message_field']) { echo '<span class="required"> *</span>'; } ?> </label> </div> <div class="cntctfrmpr_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_message_error']['en']; ?> </div> <div class="cntctfrm_input cntctfrm_input_message"> <textarea placeholder="<?php _e("Please enter your message...", 'contact_form'); ?> " rows="5" cols="30" name="cntctfrmpr_contact_message" id="cntctfrmpr_contact_message"></textarea> <div class="cntctfrmpr_help_box"> <div class="cntctfrmpr_hidden_help_text"><?php _e("Please enter your message...", 'contact_form'); ?> </div> </div> </div> <?php if (1 == $cntctfrm_options['cntctfrm_attachment']) { ?> <div class="cntctfrm_label cntctfrm_label_attachment"> <label for="cntctfrmpr_contact_attachment"><?php echo $cntctfrm_options['cntctfrm_attachment_label']['en']; ?> </label> </div> <div class="cntctfrmpr_error_text hidden"><?php echo $cntctfrm_options['cntctfrm_attachment_error']['en']; ?> </div> <div class="cntctfrm_input cntctfrm_input_attachment"> <input type="file" name="cntctfrmpr_contact_attachment" id="cntctfrmpr_contact_attachment" style="float:left;" /> <?php if (1 == $cntctfrm_options['cntctfrm_attachment_explanations']) { ?> <div class="cntctfrmpr_help_box cntctfrmpr_hidden_help_text_attach"><div class="cntctfrmpr_hidden_help_text"><?php echo $cntctfrm_options['cntctfrm_attachment_tooltip']['en']; ?> </div></div> <?php } ?> </div> <?php } ?> <?php if (1 == $cntctfrm_options['cntctfrm_send_copy']) { ?> <div class="cntctfrm_checkbox cntctfrm_checkbox_send_copy"> <input type="checkbox" value="1" name="cntctfrmpr_contact_send_copy" id="cntctfrmpr_contact_send_copy" style="margin: 0;" /> <label for="cntctfrmpr_contact_send_copy"><?php echo $cntctfrm_options['cntctfrm_send_copy_label']['en']; ?> </label> </div> <?php } ?> <div class="cntctfrm_input cntctfrm_input_submit"> <input type="submit" value="<?php echo $cntctfrm_options['cntctfrm_submit_label']['en']; ?> " style="cursor: pointer; margin: 0pt; text-align: center;margin-bottom:10px;" /> </div> </div> <div id="cntctfrmpr_shortcode"> <?php _e("If you would like to add the Contact Form to your website, just copy and paste this shortcode to your post or page or widget:", 'contact_form'); ?> <br/> <div> <div id="cntctfrmpr_shortcode_code"> <span class="cntctfrm_shortcode">[bestwebsoft_contact_form]</span> </div> </div> </div> </div> <div class="clear"></div> <?php } elseif ('go_pro' == $_GET['action']) { bws_go_pro_tab($cntctfrm_plugin_info, $plugin_basename, 'contact_form.php', 'contact_form_pro.php', 'contact-form-pro/contact_form_pro.php', 'contact-form', '697c5e74f39779ce77850e11dbe21962', '77', isset($go_pro_result['pro_plugin_is_activated'])); } bws_plugin_reviews_block($cntctfrm_plugin_info['Name'], 'contact-form-plugin'); ?> </div> <?php }
function mltlngg_settings_tab() { global $mltlngg_message_value, $mltlngg_options, $mltlngg_plugin_info, $wp_version; ?> <div class="wrap"> <div class="icon32 icon32-bws" id="icon-options-general"></div> <h2> <?php _e('Multilanguage Settings', 'multilanguage'); ?> <a class="add-new-h2" href="#" id="mltlngg-add-lang-link"><?php _e('Add language', 'multilanguage'); ?> </a> </h2> <!-- Display settings tab on setting page --> <h2 class="nav-tab-wrapper"> <a class="nav-tab" href="<?php echo admin_url('admin.php?page=mltlngg_settings', ''); ?> "><?php _e('Languages', 'multilanguage'); ?> </a> <a class="nav-tab<?php if (!isset($_GET['action']) || isset($_GET['action']) && 'go_pro' != $_GET['action']) { echo ' nav-tab-active'; } ?> " href="<?php echo admin_url('admin.php?page=mltlngg_settings&tab=settings', ''); ?> "><?php _e('Settings', 'multilanguage'); ?> </a> <a class="nav-tab" href="http://bestwebsoft.com/products/multilanguage/faq/" target="_blank"><?php _e('FAQ', 'multilanguage'); ?> </a> <a class="nav-tab bws_go_pro_tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=mltlngg_settings&action=go_pro"><?php _e('Go PRO', 'multilanguage'); ?> </a> </h2><!-- .nav-tab-wrapper --> <!-- /end settings tab on setting page --> <?php if (isset($_REQUEST['bws_restore_default']) && check_admin_referer(plugin_basename(__FILE__), 'bws_settings_nonce_name')) { bws_form_restore_default_confirm(plugin_basename(__FILE__)); } else { if (!empty($mltlngg_message_value['error'])) { ?> <div class="error below-h2"><p><?php echo $mltlngg_message_value['error']; ?> </p></div> <?php } elseif (!empty($mltlngg_message_value['success'])) { ?> <div class="updated fade below-h2"><p><?php echo $mltlngg_message_value['success']; ?> </p></div> <?php } bws_show_settings_notice(); ?> <p><?php _e('If you would like to display Language switcher with a widget, you need to add the widget "Multilanguage" in the Widgets tab.', 'multilanguage'); ?> </p> <p><?php _e('If you would like to add Language switcher to your website, just copy and paste this shortcode into your post or page', 'multilanguage'); ?> : <code>[multilanguage_switcher]</code></p> <p><?php _e('Also, you can paste the following strings into the template source code', 'multilanguage'); ?> <code><?php if ( function_exists( 'mltlngg_display_switcher' ) ) mltlngg_display_switcher(); ?></code> <!-- form for adding new language --> <?php mltlngg_add_language_form(); ?> <!-- /form for adding new language --> <!-- Table with options form --> <form class="bws_form" name="mltlngg_settings_form" method="post" action="" id="mltlngg-current-languages-form"> <table class="form-table" style="max-width: 700px;"> <tr valign="middle"> <th scope="row"><?php _e('Enable new language', 'multilanguage'); ?> </th> <td> <input id="mltlngg_new_language_enable" name="mltlngg_new_language_enable" type="checkbox" value="true" <?php echo true == $mltlngg_options['enabled_new_language'] ? ' checked' : ''; ?> > <span style="color: #888888;font-size: 10px;"><?php _e("The newly added language will be enabled automatically", 'multilanguage'); ?> </span> </td> </tr> <tr valign="middle"> <th scope="row"><?php _e('Autosave translation in the editor', 'multilanguage'); ?> </th> <td> <input name="mltlngg_autosave_editor_content" type="checkbox" value="true" <?php echo true == $mltlngg_options['autosave_editor_content'] ? ' checked' : ''; ?> > <span style="color: #888888;font-size: 10px;"><?php _e("When switching edit posts/pages translation tab, the changes made in the previous tab will be saved automatically (only when the Javascript is enabled)", 'multilanguage'); ?> </span> </td> </tr> <tr valign="middle"> <th scope="row"><?php _e('Switch Wordpress localization', 'multilanguage'); ?> </th> <td><input name="mltlngg_wp_localization" type="checkbox" value="true" <?php echo true == $mltlngg_options['wp_localization'] ? ' checked' : ''; ?> > <span style="color: #888888;font-size: 10px;"><?php _e("When changing the language in the frontend, WordPress localization will also be changed (only in case additional WordPress language packs are installed)", 'multilanguage'); ?> </span></td> </tr> <tr valign="middle"> <th scope="row"><?php _e('Language switcher', 'multilanguage'); ?> </th> <td> <fieldset> <div style="clear: both;"> <label> <input name="mltlngg_language_switcher" type="radio" value="drop-down-list" <?php if ($mltlngg_options['language_switcher'] == 'drop-down-list') { echo 'checked'; } ?> /> <?php _e('Drop-down languages list', 'multilanguage'); ?> </label> <div class="bws_help_box<?php if ($wp_version >= '3.9') { echo ' dashicons dashicons-editor-help'; } ?> mltlngg_thumb_block"> <div class="bws_hidden_help_text"><img title="" src="<?php echo plugins_url('images/tooltip_drop_down_list.png', __FILE__); ?> " alt="" /></div> </div> </div> <div> <label> <input name="mltlngg_language_switcher" type="radio" value="drop-down-icons" <?php if ($mltlngg_options['language_switcher'] == 'drop-down-icons') { echo 'checked'; } ?> /> <?php _e('Drop-down flag icons', 'multilanguage'); ?> </label> <div class="bws_help_box<?php if ($wp_version >= '3.9') { echo ' dashicons dashicons-editor-help'; } ?> mltlngg_thumb_block"> <div class="bws_hidden_help_text"><img title="" src="<?php echo plugins_url('images/tooltip_drop_down_icons.png', __FILE__); ?> " alt="" /></div> </div> </div> <div> <label> <input name="mltlngg_language_switcher" type="radio" value="flags-icons" <?php if ($mltlngg_options['language_switcher'] == 'flags-icons') { echo 'checked'; } ?> /> <?php _e('Flag icons', 'multilanguage'); ?> </label> <div class="bws_help_box<?php if ($wp_version >= '3.9') { echo ' dashicons dashicons-editor-help'; } ?> mltlngg_thumb_block"> <div class="bws_hidden_help_text"><img title="" src="<?php echo plugins_url('images/tooltip_flags_icons.png', __FILE__); ?> " alt="" /></div> </div> </div> </fieldset> </td> </tr> <tr valign="middle"> <th scope="row"><?php _e('Default searching by', 'multilanguage'); ?> </th> <td> <fieldset> <label> <input type="radio" name="mltlngg_search" value="single" <?php if ('single' == $mltlngg_options['search']) { echo ' checked'; } ?> /> <?php _e('selected language', 'multilanguage'); ?> </label><br> <label> <input type="radio" name="mltlngg_search" value="all" <?php if ('all' == $mltlngg_options['search']) { echo ' checked'; } ?> /> <?php _e('all available languages', 'multilanguage'); ?> </label> </fieldset> </td> </tr> </table><!-- .form-table --> <div class="bws_pro_version_bloc"> <div class="bws_pro_version_table_bloc"> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="middle"> <th scope="row"><?php _e("Determining the locale using the user's IP", 'multilanguage'); ?> </th> <td> <input type="checkbox" disabled id="mltlngg_determining_locale" name="mltlngg_determining_locale" value="true" /> </td> </tr> <tr valign="middle" class="mltlngg_display_add_block" > <th scope="row"><?php _e('Automatic country table update every', 'multilanguage'); ?> </th> <td> <input type="number" disabled min="1" max="370" name="mltlngg_loading_country" value="<?php echo '30'; ?> " /> <?php _e('day', 'multilanguage'); ?> <div class="clear"></div> <div><span class="bws_info"><?php _e('on the developers site the data is updated on the first Tuesday of every month', 'multilanguage'); ?> </span></div> </td> </tr> <tr valign="top"> <th scope="row" colspan="2"> * <?php _e('If you upgrade to Pro version all your settings will be saved.', 'multilanguage'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'multilanguage'); ?> </div> <a class="bws_button" href="http://bestwebsoft.com/products/multilanguage/?k=fa164f00821ed3a87e6f78cb3f5c277b&pn=143&v=<?php echo $mltlngg_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Multilanguage Pro"><?php _e('Learn More', 'multilanguage'); ?> </a> <div class="clear"></div> </div> </div> <p> <input id="bws-submit-button" type="submit" name="mltlngg_settings_form_submit" class="button-primary" value="<?php _e('Save changes', 'multilanguage'); ?> "> <input type="hidden" name="mltlngg_settings_form_was_send" value="1"> <?php wp_nonce_field('mltlngg_settings_form', 'mltlngg_settings_form_field'); ?> </p> </form><!-- name="mltlngg_settings_form" --> <!-- /table with options form --> <?php bws_form_restore_default_settings(plugin_basename(__FILE__)); } bws_plugin_reviews_block($mltlngg_plugin_info['Name'], 'multilanguage'); ?> </div><!-- .wrap --> <?php }