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, $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 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__); /* 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://', '', 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')) { 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($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.', '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 is 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($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.', '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']) && '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"> <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" <?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 class="bws_form" action="admin.php?page=google-sitemap-plugin.php" method='post' 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", '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="' . $gglstmppr_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="' . $gglstmppr_url_home . "sitemap_" . $home_url . '.xml" target="_new">' . __("Your Sitemap file", 'google-sitemap-plugin') . "</a> " . __("is created in the site root directory.", 'google-sitemap-plugin') . "</p>"; } else { echo '<p><a href="' . $gglstmppr_url_home . 'sitemap.xml" target="_new">' . __("Your Sitemap file", 'google-sitemap-plugin') . "</a> " . __("is created in the site root directory.", 'google-sitemap-plugin') . "</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", 'google-sitemap-plugin') . " <a href=\"https://www.google.com/webmasters/tools/home?hl=en\">" . __("this", 'google-sitemap-plugin') . "</a> " . __("link - sign in, choose the necessary site, go to 'Sitemaps' and fill out the mandatory field", 'google-sitemap-plugin') . " - '" . $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", 'google-sitemap-plugin') . " <a href=\"https://www.google.com/webmasters/tools/home?hl=en\">" . __("this", 'google-sitemap-plugin') . "</a> " . __("link - sign in, choose the necessary site, go to 'Sitemaps' and fill out the mandatory field", 'google-sitemap-plugin') . " - '" . $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", '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("I want to 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"> <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", 'google-sitemap-plugin'); ?> <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:', '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=106&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 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-sitemap-plugin'); ?> "></button> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <th><?php _e('XML Sitemap "Change Frequency" parameter', 'google-sitemap-plugin'); ?> </th> <td> <select name="gglstmp_sitemap_change_frequency"> <option value="always"><?php _e('Always', 'google-sitemap-plugin'); ?> </option> <option value="hourly"><?php _e('Hourly', 'google-sitemap-plugin'); ?> </option> <option value="daily"><?php _e('Daily', 'google-sitemap-plugin'); ?> </option> <option value="weekly"><?php _e('Weekly', 'google-sitemap-plugin'); ?> </option> <option selected value="monthly"><?php _e('Monthly', 'google-sitemap-plugin'); ?> </option> <option value="yearly"><?php _e('Yearly', 'google-sitemap-plugin'); ?> </option> <option value="never"><?php _e('Never', 'google-sitemap-plugin'); ?> </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.', 'google-sitemap-plugin'); ?> </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', 'google-sitemap-plugin'); ?> </div> <a class="bws_button" 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', 'google-sitemap-plugin'); ?> </a> <div class="clear"></div> </div> </div> <?php } ?> <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.", 'google-sitemap-plugin'); ?> </td> </tr> <?php } else { ?> <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 = __("I want to add this site to Google Webmaster Tools", 'google-sitemap-plugin'); $gglstmp_menu_del = __("I want to delete this site from Google Webmaster Tools", 'google-sitemap-plugin'); $gglstmp_menu_inf = __("I want to 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><br /> <span class="bws_info"> <?php _e('In case you failed to add a sitemap to Google automatically using this plugin, it is possible to do it manually', 'google-sitemap-plugin'); ?> : <a target="_blank" href="https://docs.google.com/document/d/1VOJx_OaasVskCqi9fsAbUmxfsckoagPU5Py97yjha9w/edit"><?php _e('View the Instruction', 'google-sitemap-plugin'); ?> </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.", '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 } } ?> </td> </tr> <?php } ?> </table> <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 ('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:', 'google-sitemap-plugin'); ?> </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", 'google-sitemap-plugin'); ?> </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", 'google-sitemap-plugin'); ?> " title="<?php _e("Example of site pages' tree", 'google-sitemap-plugin'); ?> " /> </td> </tr> <tr valign="top"> <td colspan="2"> <input disabled="disabled" type="submit" class="button-primary" value="<?php _e('Save Changes', 'google-sitemap-plugin'); ?> " /> </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-sitemap-plugin'); ?> </div> <a class="bws_button" 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', 'google-sitemap-plugin'); ?> </a> <div class="clear"></div> </div> </div> <?php } 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 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 gglnltcs_settings_page() { global $gglnltcs_options, $gglnltcs_plugin_info; $message = $error = ''; static $this_plugin; if (!$this_plugin) { $this_plugin = plugin_basename(__FILE__); } if (isset($_POST['gglnltcs_form_submit']) && check_admin_referer($this_plugin, 'gglnltcs_nonce_name')) { $gglnltcs_options_submit['add_tracking_code'] = isset($_POST['gglnltcs_add_tracking_code']) ? 1 : 0; $gglnltcs_options_submit['tracking_id'] = isset($_POST['gglnltcs_tracking_id']) ? stripslashes(esc_html($_POST['gglnltcs_tracking_id'])) : ''; if ($gglnltcs_options_submit['add_tracking_code'] == 1 && $gglnltcs_options_submit['tracking_id'] == '') { $error .= __("Tracking code is empty. You must enter a tracking code to add it to your blog.", 'bws-google-analytics'); } if (empty($error)) { $gglnltcs_options = array_merge($gglnltcs_options, $gglnltcs_options_submit); update_option('gglnltcs_options', $gglnltcs_options); $message .= __("Settings saved.", 'bws-google-analytics'); } else { $error .= ' ' . __("Settings are not saved.", 'bws-google-analytics'); } } /* If user pressed log out button delete his Access Token from database. */ if (isset($_POST['gglnltcs_log_out']) && check_admin_referer($this_plugin, 'gglnltcs_nonce_name')) { unset($gglnltcs_options['token']); unset($gglnltcs_options['settings']); update_option('gglnltcs_options', $gglnltcs_options); } $analytics = gglnltcs_get_analytics(); /* Print Tab Navigation */ ?> <div class="wrap"> <h1 id="gglnltcs-main-header"><?php _e('Google Analytics Settings', 'bws-google-analytics'); ?> </h1> <h2 class="nav-tab-wrapper"> <a id="gglnltcs-line-nav-tab" class="nav-tab<?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=bws-google-analytics.php"><?php _e('Line Chart', 'bws-google-analytics'); ?> </a> <a id="gglnltcs-table-nav-tab" class="nav-tab<?php if (isset($_GET['action']) && 'table-tab' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=bws-google-analytics.php&action=table-tab"><?php _e('Table Chart', 'bws-google-analytics'); ?> </a> <a id="gglnltcs-tracking-code-nav-tab" class="nav-tab<?php if (isset($_GET['action']) && 'tracking-code-tab' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=bws-google-analytics.php&action=tracking-code-tab"><?php _e('Tracking Code & Reset', 'bws-google-analytics'); ?> </a> <a id="gglnltcs-pro-nav-tab" class="nav-tab bws_go_pro_tab<?php if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { echo ' nav-tab-active'; } ?> " href="admin.php?page=bws-google-analytics.php&action=go_pro"><?php _e('Go PRO', 'bws-google-analytics'); ?> </a> </h2> <div id="gglnltcs-settings-message" class="updated fade" <?php if (empty($message)) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <div id="gglnltcs-settings-error" class="error" <?php if (empty($error)) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $error; ?> </strong></p></div> <?php bws_show_settings_notice(); ?> <div id="gglnltcs-main-content"><?php /* Line Chart Tab */ if (!isset($_GET['action'])) { if (!isset($gglnltcs_options['token'])) { gglnltcs_authenticate(); } else { gglnltcs_line_chart_tab($analytics); } } /* Table Chart Tab */ if (isset($_GET['action']) && 'table-tab' == $_GET['action']) { if (!isset($gglnltcs_options['token'])) { gglnltcs_authenticate(); } else { gglnltcs_table_chart_tab($analytics); } } /* Tracking Code & Reset Tab */ if (isset($_GET['action']) && 'tracking-code-tab' == $_GET['action']) { gglnltcs_tracking_code_tab(true); } /* GO PRO Tab */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { gglnltcs_go_pro_tab(); } ?> </div> </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 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 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['whitelist_message'] = isset($_REQUEST['cptch_whitelist_message']) ? stripslashes(esc_html($_REQUEST['cptch_whitelist_message'])) : ''; $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 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 { bws_show_settings_notice(); ?> <form class="bws_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]; ?> </label> <div class="bws_help_box<?php if ($wp_version >= '3.9') { echo ' 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> <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> <div class="bws_help_box<?php if ($wp_version >= '3.9') { echo ' 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 } 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> <div class="bws_help_box<?php if ($wp_version >= '3.9') { echo ' 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> <span class="bws_info"><a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php _e('Activate', 'captcha'); ?> Contact Form</a></span> <?php } ?> <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> <div class="bws_help_box<?php if ($wp_version >= '3.9') { echo ' 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> <span class="bws_info"><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', 'captcha'); ?> Contact Form</a></span> <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> <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'); ?> </div> <a class="bws_button" 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 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('Display for whitelisted IP', 'captcha'); ?> </th> <td colspan="2"> <input class="cptch_settings_input" type="text" name="cptch_whitelist_message" value="<?php echo $cptch_options['whitelist_message']; ?> " /> <br/><span class="bws_info"><?php _e('If the IP is in the whitelist, then the indicated message will be displayed instead of the captcha.', 'captcha'); ?> </span> </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]; ?> </label> <div class="bws_help_box<?php if ($wp_version >= '3.9') { echo ' 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('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]; ?> </label> <div class="bws_help_box<?php if ($wp_version >= '3.9') { echo ' dashicons dashicons-editor-help'; } ?> "> <div class="bws_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 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']) { 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 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 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 adsns_settings_page() { global $wp_version; $plugin_basename = plugin_basename(__FILE__); if (!isset($_GET['action'])) { if (isset($_POST['adsns_upgrade']) && check_admin_referer(plugin_basename(__FILE__), 'adsns_nonce_name')) { $adsns_new_options['plugin_option_version'] = $this->adsns_options['plugin_option_version']; $adsns_new_options['widget_title'] = $this->adsns_options['widget_title']; $adsns_new_options['use_new_api'] = true; $this->adsns_adsense_api = true; $this->adsns_options = $adsns_new_options; update_option('adsns_settings', $this->adsns_options); } $adsns_current_tab = isset($_GET['tab']) ? urlencode($_GET['tab']) : 'home'; $adsns_form_action = $adsns_tab_url = ''; if (isset($_GET)) { unset($_GET['page']); foreach ($_GET as $action => $value) { $adsns_form_action .= sprintf('&%s=%s', $action, urlencode($value)); } $adsns_tab_url = preg_replace('/&tab=[\\w\\d+]+/', '', $adsns_form_action); } $adsns_tabs = array('home' => array('tab' => array('title' => __('Home page', 'adsense-plugin'), 'url' => sprintf('admin.php?page=adsense-plugin.php%s', $adsns_tab_url)), 'adunit_positions' => array('after' => __('After the content', 'adsense-plugin'), 'before' => __('Before the content', 'adsense-plugin')), 'adunit_positions_pro' => array('1st_paragraph' => __('After the first paragraph (Available in PRO)', 'adsense-plugin'), 'random_paragraph' => __('After a random paragraph (Available in PRO)', 'adsense-plugin')), 'max_ads' => 3), 'pages' => array('tab' => array('title' => __('Pages', 'adsense-plugin'), 'url' => sprintf('admin.php?page=adsense-plugin.php&tab=pages%s', $adsns_tab_url)), 'adunit_positions' => array('after' => __('After the content', 'adsense-plugin'), 'before' => __('Before the content', 'adsense-plugin'), 'commentform' => __('Below the comment form', 'adsense-plugin')), 'adunit_positions_pro' => array('1st_paragraph' => __('After the first paragraph (Available in PRO)', 'adsense-plugin'), 'random_paragraph' => __('After a random paragraph (Available in PRO)', 'adsense-plugin')), 'max_ads' => 3), 'posts+custom_posts' => array('tab' => array('title' => __('Posts / Custom posts', 'adsense-plugin'), 'url' => sprintf('admin.php?page=adsense-plugin.php&tab=posts+custom_posts%s', $adsns_tab_url)), 'adunit_positions' => array('after' => __('After the content', 'adsense-plugin'), 'before' => __('Before the content', 'adsense-plugin'), 'commentform' => __('Below the comment form', 'adsense-plugin')), 'adunit_positions_pro' => array('1st_paragraph' => __('After the first paragraph (Available in PRO)', 'adsense-plugin'), 'random_paragraph' => __('After a random paragraph (Available in PRO)', 'adsense-plugin')), 'max_ads' => 3), 'categories+tags' => array('tab' => array('title' => __('Categories / Tags', 'adsense-plugin'), 'url' => sprintf('admin.php?page=adsense-plugin.php&tab=categories+tags%s', $adsns_tab_url)), 'adunit_positions' => array('after' => __('After the content', 'adsense-plugin'), 'before' => __('Before the content', 'adsense-plugin')), 'adunit_positions_pro' => array('1st_paragraph' => __('After the first paragraph (Available in PRO)', 'adsense-plugin'), 'random_paragraph' => __('After a random paragraph (Available in PRO)', 'adsense-plugin')), 'max_ads' => 3), 'search' => array('tab' => array('title' => __('Search results', 'adsense-plugin'), 'url' => sprintf('admin.php?page=adsense-plugin.php&tab=search%s', $adsns_tab_url)), 'adunit_positions' => array('after' => __('After the content', 'adsense-plugin'), 'before' => __('Before the content', 'adsense-plugin')), 'adunit_positions_pro' => array('1st_paragraph' => __('After the first paragraph (Available in PRO)', 'adsense-plugin'), 'random_paragraph' => __('After a random paragraph (Available in PRO)', 'adsense-plugin')), 'max_ads' => 3), 'widget' => array('tab' => array('title' => __('Widget', 'adsense-plugin'), 'url' => sprintf('admin.php?page=adsense-plugin.php&tab=widget%s', $adsns_tab_url)), 'adunit_positions' => array('static' => __('Static', 'adsense-plugin')), 'adunit_positions_pro' => array('fixed' => __('Fixed (Available in PRO)', 'adsense-plugin')), 'max_ads' => 1)); $adsns_tbl_data = array(); $adsns_adunit_types = array('TEXT' => __('Text', 'adsense-plugin'), 'IMAGE' => __('Image', 'adsense-plugin'), 'TEXT_IMAGE' => __('Text/Image', 'adsense-plugin'), 'LINK' => __('Link', 'adsense-plugin')); $adsns_adunit_statuses = array('NEW' => __('New', 'adsense-plugin'), 'ACTIVE' => __('Active', 'adsense-plugin'), 'INACTIVE' => __('Inactive', 'adsense-plugin')); $adsns_adunit_sizes = array('RESPONSIVE' => __('Responsive', 'adsense-plugin')); $adsns_client = $this->adsns_client(); $adsns_blog_prefix = '_' . get_current_blog_id(); if (isset($_POST['adsns_logout']) && check_admin_referer(plugin_basename(__FILE__), 'adsns_nonce_name')) { unset($_SESSION['adsns_authorization_code' . $adsns_blog_prefix]); unset($this->adsns_options['authorization_code']); update_option('adsns_settings', $this->adsns_options); } if (isset($_POST['adsns_authorization_code']) && !empty($_POST['adsns_authorization_code']) && check_admin_referer(plugin_basename(__FILE__), 'adsns_nonce_name')) { try { $adsns_client->authenticate($_POST['adsns_authorization_code']); $this->adsns_options['authorization_code'] = $_SESSION['adsns_authorization_code' . $adsns_blog_prefix] = $adsns_client->getAccessToken(); update_option('adsns_settings', $this->adsns_options); } catch (Exception $e) { } } if (!isset($_SESSION['adsns_authorization_code' . $adsns_blog_prefix]) && isset($this->adsns_options['authorization_code'])) { $_SESSION['adsns_authorization_code' . $adsns_blog_prefix] = $this->adsns_options['authorization_code']; } if (isset($_SESSION['adsns_authorization_code' . $adsns_blog_prefix])) { $adsns_client->setAccessToken($_SESSION['adsns_authorization_code' . $adsns_blog_prefix]); } if ($adsns_client->getAccessToken()) { $adsns_adsense = new Google_Service_AdSense($adsns_client); $adsns_adsense_accounts = $adsns_adsense->accounts; $adsns_adsense_adclients = $adsns_adsense->adclients; $adsns_adsense_adunits = $adsns_adsense->adunits; try { $adsns_list_accounts = $adsns_adsense_accounts->listAccounts()->getItems(); $adsns_publisher_id = $adsns_list_accounts[0]['id']; $this->adsns_options['publisher_id'] = $adsns_publisher_id; /* Start fix old options */ if (isset($this->adsns_options['adunits']) && !isset($this->adsns_options['adunits'][$this->adsns_options['publisher_id']])) { $adsns_temp_adunits = $this->adsns_options['adunits']; unset($this->adsns_options['adunits']); $this->adsns_options['adunits'][$this->adsns_options['publisher_id']] = $adsns_temp_adunits; } /* End fix old options */ update_option('adsns_settings', $this->adsns_options); try { $adsns_list_adclients = $adsns_adsense_adclients->listAdclients()->getItems(); $adsns_ad_client = null; foreach ($adsns_list_adclients as $adsns_list_adclient) { if ($adsns_list_adclient['productCode'] == 'AFC') { $adsns_ad_client = $adsns_list_adclient['id']; } } if ($adsns_ad_client) { try { $adsns_adunits = $adsns_adsense_adunits->listAdunits($adsns_ad_client)->getItems(); foreach ($adsns_adunits as $adsns_adunit) { $adsns_adunit_type = $adsns_adunit_types[$adsns_adunit->getContentAdsSettings()->getType()]; $adsns_adunit_size = preg_replace('/SIZE_([\\d]+)_([\\d]+)/', '$1x$2', $adsns_adunit->getContentAdsSettings()->getSize()); if (array_key_exists($adsns_adunit_size, $adsns_adunit_sizes)) { $adsns_adunit_size = $adsns_adunit_sizes[$adsns_adunit_size]; } $adsns_adunit_status = $adsns_adunit->getStatus(); if (array_key_exists($adsns_adunit_status, $adsns_adunit_statuses)) { $adsns_adunit_status = $adsns_adunit_statuses[$adsns_adunit_status]; } $adsns_tbl_data[$adsns_adunit->getName()] = array('id' => $adsns_adunit->getId(), 'name' => $adsns_adunit->getName(), 'code' => $adsns_adunit->getCode(), 'summary' => sprintf('%s, %s', $adsns_adunit_type, $adsns_adunit_size), 'status' => $adsns_adunit_status); } } catch (Google_Service_Exception $e) { $adsns_err = $e->getErrors(); $adsns_api_notice = array('class' => 'error adsns_api_notice', 'message' => sprintf('<strong>%s</strong> %s %s', __('AdUnits Error:', 'adsense-plugin'), $adsns_err[0]['message'], sprintf(__('Create account in %s', 'adsense-plugin'), '<a href="https://www.google.com/adsense" target="_blank">Google AdSense.</a>'))); } } } catch (Google_Service_Exception $e) { $adsns_err = $e->getErrors(); $adsns_api_notice = array('class' => 'error adsns_api_notice', 'message' => sprintf('<strong>%s</strong> %s %s', __('AdClient Error:', 'adsense-plugin'), $adsns_err[0]['message'], sprintf(__('Create account in %s', 'adsense-plugin'), '<a href="https://www.google.com/adsense" target="_blank">Google AdSense.</a>'))); } } catch (Google_Service_Exception $e) { $adsns_err = $e->getErrors(); $adsns_api_notice = array('class' => 'error adsns_api_notice', 'message' => sprintf('<strong>%s</strong> %s %s', __('Account Error:', 'adsense-plugin'), $adsns_err[0]['message'], sprintf(__('Create account in %s', 'adsense-plugin'), '<a href="https://www.google.com/adsense" target="_blank">Google AdSense.</a>'))); } catch (Exception $e) { $adsns_api_notice = array('class' => 'error adsns_api_notice', 'message' => $e->getMessage()); } } if (isset($_POST['adsns_authorization_code']) && isset($_POST['adsns_authorize']) && !$adsns_client->getAccessToken() && check_admin_referer(plugin_basename(__FILE__), 'adsns_nonce_name')) { $adsns_api_notice = array('class' => 'error adsns_api_notice', 'message' => __('Invalid authorization code. Please, try again.', 'adsense-plugin')); } if (isset($_POST['adsns_save_settings']) && check_admin_referer(plugin_basename(__FILE__), 'adsns_nonce_name')) { $adsns_old_options = $this->adsns_options; $adsns_area = isset($_POST['adsns_area']) ? $_POST['adsns_area'] : ''; if (array_key_exists($adsns_area, $adsns_tabs)) { $adsns_save_settings = true; if (isset($this->adsns_options['adunits'][$this->adsns_options['publisher_id']][$adsns_area])) { $this->adsns_options['adunits'][$this->adsns_options['publisher_id']][$adsns_area] = array(); } if (isset($_POST['adsns_adunit_ids'])) { $adsns_adunit_ids = array_slice($_POST['adsns_adunit_ids'], 0, $adsns_tabs[$adsns_area]['max_ads']); $adsns_adunit_positions = isset($_POST['adsns_adunit_position']) ? $_POST['adsns_adunit_position'] : array(); if (isset($adsns_publisher_id) && isset($adsns_ad_client)) { foreach ($adsns_adunit_ids as $adsns_adunit_id) { try { $adsns_adunit_code = $adsns_adsense_adunits->getAdCode($adsns_ad_client, $adsns_adunit_id)->getAdCode(); $adsns_adunit_position = array_key_exists($adsns_adunit_id, $adsns_adunit_positions) ? $adsns_adunit_positions[$adsns_adunit_id] : NULL; $this->adsns_options['adunits'][$this->adsns_options['publisher_id']][$adsns_area][] = array('id' => $adsns_adunit_id, 'position' => $adsns_adunit_position, 'code' => htmlspecialchars($adsns_adunit_code)); } catch (Google_Service_Exception $e) { $adsns_err = $e->getErrors(); $adsns_save_settings = false; $adsns_settings_notices[] = array('class' => 'error', 'message' => sprintf('%s<br/>%s<br/>%s', sprintf(__('An error occurred while obtaining the code for the block %s.', 'adsense-plugin'), sprintf('<strong>%s</strong>', $adsns_adunit_id)), $adsns_err[0]['message'], __("Settings are not saved.", 'adsense-plugin'))); } } } } if ($adsns_area != 'widget') { if (isset($this->adsns_options['adunits'][$this->adsns_options['publisher_id']]['widget'])) { if (count($this->adsns_options['adunits'][$this->adsns_options['publisher_id']]['widget']) > 0 && count($this->adsns_options['adunits'][$this->adsns_options['publisher_id']][$adsns_area]) > 2) { $adsns_save_settings = false; $adsns_settings_notices[] = array('class' => 'error', 'message' => sprintf('%s<br/>%s<br/>%s', sprintf(__("The maximum number of ad blocks on the page cannot be more than 3 ad blocks (%s).", 'adsense-plugin'), sprintf('<a href="https://support.google.com/adsense/answer/1346295?hl=en#Ad_limit_per_page" target="_blank">%s</a>', __('Learn more', 'adsense-plugin'))), sprintf(__('Please select a smaller number of ad blocks or disable the ad block display in the %s tab.', 'adsense-plugin'), sprintf('<strong>"%s"</strong>', __('Widget', 'adsense-plugin'))), __("Settings are not saved.", 'adsense-plugin'))); } } } else { if (isset($this->adsns_options['adunits'][$this->adsns_options['publisher_id']]['widget']) && count($this->adsns_options['adunits'][$this->adsns_options['publisher_id']]['widget']) > 0) { $adsns_crowded_tabs = ''; $adsns_crowded_tabs_count = 0; foreach ($this->adsns_options['adunits'][$this->adsns_options['publisher_id']] as $adsns_tab => $adsns_adunit) { if ($adsns_tab == 'widget') { continue; } if (count($adsns_adunit) > 2) { $adsns_crowded_tabs .= sprintf('"%s" (%s %s), ', $adsns_tabs[$adsns_tab]['tab']['title'], count($adsns_adunit), __('ad blocks', 'adsense-plugin')); $adsns_crowded_tabs_count++; } } $adsns_crowded_tabs = substr($adsns_crowded_tabs, 0, -2); if ($adsns_crowded_tabs_count > 0) { if ($adsns_crowded_tabs_count <= 1) { $adsns_settings_notices[] = array('class' => 'error', 'message' => sprintf('%s<br/>%s<br/>%s', sprintf(__("The maximum number of ad blocks on the page cannot be more than 3 ad blocks (%s).", 'adsense-plugin'), sprintf('<a href="https://support.google.com/adsense/answer/1346295?hl=en#Ad_limit_per_page" target="_blank">%s</a>', __('Learn more', 'adsense-plugin'))), sprintf(__('To display the ad block in widget, please set a smaller number of ad blocks in the %s tab.', 'adsense-plugin'), sprintf('<strong>%s</strong>', $adsns_crowded_tabs)), __("Settings are not saved.", 'adsense-plugin'))); } else { $adsns_settings_notices[] = array('class' => 'error', 'message' => sprintf('%s<br/>%s<br/>%s', sprintf(__("The maximum number of ad blocks on the page cannot be more than 3 ad blocks (%s).", 'adsense-plugin'), sprintf('<a href="https://support.google.com/adsense/answer/1346295?hl=en#Ad_limit_per_page" target="_blank">%s</a>', __('Learn more', 'adsense-plugin'))), sprintf(__('To display the ad block in widget, please set a smaller number of ad blocks in tabs: %s.', 'adsense-plugin'), sprintf('<strong>%s</strong>', $adsns_crowded_tabs)), __("Settings are not saved.", 'adsense-plugin'))); } $adsns_save_settings = false; } } } if ($adsns_save_settings) { update_option('adsns_settings', $this->adsns_options); $adsns_settings_notices[] = array('class' => 'updated fade', 'message' => __("Settings saved.", 'adsense-plugin')); } else { $this->adsns_options = $adsns_old_options; } } else { $adsns_settings_notices[] = array('class' => 'error', 'message' => __("Settings are not saved.", 'adsense-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'])) { $adsns_settings_notices[] = array('class' => 'error', 'message' => $go_pro_result['error']); } } ?> <div class="wrap" id="adsns_wrap"> <h1><?php _e('Google AdSense Settings', 'adsense-plugin'); ?> </h1> <h2 class="nav-tab-wrapper"> <a class="nav-tab<?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=adsense-plugin.php"><?php _e('Settings', 'adsense-plugin'); ?> </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=adsense-plugin.php&action=go_pro"><?php _e('Go PRO', 'adsense-plugin'); ?> </a> </h2> <?php if (isset($adsns_api_notice)) { printf('<div class="below-h2 %s"><p>%s</p></div>', $adsns_api_notice['class'], $adsns_api_notice['message']); } if (isset($adsns_settings_notices)) { foreach ($adsns_settings_notices as $adsns_settings_notice) { printf('<div class="below-h2 %s"><p>%s</p></div>', $adsns_settings_notice['class'], $adsns_settings_notice['message']); } } bws_show_settings_notice(); if (!isset($_GET['action'])) { if (!$this->adsns_adsense_api) { ?> <form id="adsns_settings_form" action="admin.php?page=adsense-plugin.php" method="post"> <div id="adsns_update"> <p> <strong><?php _e("Attention:", 'adsense-plugin'); ?> </strong> <?php _e('We updated the plugin to use Google AdSense API, which is not compatible with the old settings. At the moment, plugin use old settings. But for further plugin usage with a new Google AdSense API, you will need to re-configure the ad blocks display. Please note that the old settings and plugin ad blocks in the frontend will be removed.', 'adsense-plugin'); ?> <div><input class="button-primary" type="submit" name="adsns_upgrade" value="<?php _e('Upgrade to new functionality', 'adsense-plugin'); ?> "></div> </p> <?php wp_nonce_field(plugin_basename(__FILE__), 'adsns_nonce_name'); ?> </div> </form> <?php } else { ?> <form id="adsns_settings_form" class="bws_form" action="admin.php?page=adsense-plugin.php<?php echo $adsns_form_action; ?> " method="post"> <table id="adsns_api" class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Remote work with Google AdSense', 'adsense-plugin'); ?> </th> <td> <?php if ($adsns_client->getAccessToken()) { ?> <div id="adsns_api_buttons"> <input class="button-secondary" name="adsns_logout" type="submit" value="<?php _e('Log out from Google AdSense', 'adsense-plugin'); ?> " /> </div> <?php } else { $adsns_state = mt_rand(); $adsns_client->setState($adsns_state); $_SESSION['gglstmp_state' . $adsns_blog_prefix] = $adsns_client; $adsns_auth_url = $adsns_client->createAuthUrl(); ?> <div id="adsns_authorization_notice"> <?php _e("Please authorize via your Google Account to manage ad blocks.", 'adsense-plugin'); ?> </div> <a id="adsns_authorization_button" class="button-primary" href="<?php echo $adsns_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', 'adsense-plugin'); ?> </a> <div id="adsns_authorization_form"> <input id="adsns_authorization_code" name="adsns_authorization_code" type="text" autocomplete="off" maxlength="100"> <input id="adsns_authorize" class="button-primary" name="adsns_authorize" type="submit" value="<?php _e('Authorize', 'adsense-plugin'); ?> "> </div> <?php } ?> </td> </tr> <?php if (isset($adsns_publisher_id)) { ?> <tr valign="top"> <th scope="row"><?php _e('Your Publisher ID:', 'adsense-plugin'); ?> </th> <td> <span id="adsns_publisher_id"><?php echo $adsns_publisher_id; ?> </span> </td> </tr> <?php } ?> </table> <?php if (isset($adsns_publisher_id) && isset($adsns_tabs[$adsns_current_tab])) { ?> <h2 id="adsns-tabs" class="nav-tab-wrapper"> <?php foreach ($adsns_tabs as $adsns_tab => $adsns_tab_data) { if (isset($this->adsns_options['adunits'][$this->adsns_options['publisher_id']][$adsns_tab])) { $adsns_count_ads = count($this->adsns_options['adunits'][$this->adsns_options['publisher_id']][$adsns_tab]); } else { $adsns_count_ads = 0; } printf('<a class="nav-tab%s" href="%s">%s <span class="adsns_count_ads">%d</span></a>', $adsns_tab == $adsns_current_tab ? ' nav-tab-active' : '', $adsns_tab_data['tab']['url'], $adsns_tab_data['tab']['title'], $adsns_count_ads); } ?> </h2> <div id="adsns_tab_content" <?php if ($adsns_current_tab == 'search') { echo 'class="bws_pro_version_bloc adsns_pro_version_bloc"'; } ?> > <div <?php if ($adsns_current_tab == 'search') { echo 'class="bws_pro_version_table_bloc adsns_pro_version_table_bloc"'; } ?> > <div <?php if ($adsns_current_tab == 'search') { echo 'class="bws_table_bg adsns_table_bg"'; } ?> ></div> <div id="adsns_usage_notice"> <p><?php printf('<strong>%s</strong> %s <a href="https://support.google.com/adsense/answer/1346295?hl=en#Ad_limit_per_page" target="_blank">%s</a>.', __('Please note:', 'adsense-plugin'), __('The maximum number of ad blocks on the page cannot be more than 3 ad blocks.', 'adsense-plugin'), __('Learn more', 'adsense-plugin')); ?> </p> <?php if ($adsns_current_tab == 'widget') { ?> <p><?php printf(__("Please don't forget to place the AdSense widget into a needed sidebar on the %s.", 'adsense-plugin'), sprintf('<a href="widgets.php" target="_blank">%s</a>', __('widget page', 'adsense-plugin'))); printf(' %s <a href="http://bestwebsoft.com/products/google-adsense/?k=2887beb5e9d5e26aebe6b7de9152ad1f&pn=80&v=%s&wp_v=%s" target="_blank"><strong>PRO</strong></a>.', __('An opportunity to add several widgets is available in the', 'adsense-plugin'), $this->adsns_plugin_info["Version"], $wp_version); ?> </p> <?php } ?> <p> <?php printf(__('Add or manage existing ad blocks in the %s.', 'adsense-plugin'), sprintf('<a href="https://www.google.com/adsense/app#main/myads-viewall-adunits" target="_blank">%s</a>', __('Google AdSense', 'adsense-plugin'))); ?> <br /> <span class="bws_info"><?php printf(__('After adding the ad block in Google AdSense, please %s to see the new ad block in the list of plugin ad blocks.', 'adsense-plugin'), sprintf('<a href="admin.php?page=adsense-plugin.php%s">%s</a>', $adsns_form_action, __('reload the page', 'adsense-plugin'))); ?> </span> </p> </div> <?php if (isset($this->adsns_options['adunits'][$this->adsns_options['publisher_id']][$adsns_current_tab])) { foreach ($this->adsns_options['adunits'][$this->adsns_options['publisher_id']][$adsns_current_tab] as $adsns_tbl_adunit) { $adsns_tbl_adunits[$adsns_tbl_adunit['id']] = $adsns_tbl_adunit['position']; } } $adsns_lt = new Adsns_List_Table(); $adsns_lt->adsns_tbl_data = $adsns_tbl_data; $adsns_lt->adsns_tbl_adunits = isset($adsns_tbl_adunits) && is_array($adsns_tbl_adunits) ? $adsns_tbl_adunits : array(); $adsns_lt->adsns_adunit_positions = $adsns_tabs[$adsns_current_tab]['adunit_positions']; $adsns_lt->adsns_adunit_positions_pro = $adsns_tabs[$adsns_current_tab]['adunit_positions_pro']; $adsns_lt->prepare_items(); $adsns_lt->display(); ?> </div> <?php if ($adsns_current_tab == 'search') { ?> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'adsense-plugin'); ?> </div> <a class="bws_button" href="http://bestwebsoft.com/products/google-adsense/?k=2887beb5e9d5e26aebe6b7de9152ad1f&pn=80&v=<?php echo $this->adsns_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Google AdSense Pro"><?php _e('Learn More', 'adsense-plugin'); ?> </a> <div class="clear"></div> </div> <?php } ?> </div> <?php } if ($adsns_current_tab != 'search') { ?> <p> <input type="hidden" name="adsns_area" value="<?php echo $adsns_current_tab; ?> " /> <input id="bws-submit-button" type="submit" class="button-primary" name="adsns_save_settings" value="<?php _e('Save Changes', 'adsense-plugin'); ?> " /> <?php wp_nonce_field(plugin_basename(__FILE__), 'adsns_nonce_name'); ?> </p> <?php } ?> </form> <?php } bws_plugin_reviews_block($this->adsns_plugin_info['Name'], 'adsense-plugin'); } elseif ('go_pro' == $_GET['action']) { bws_go_pro_tab($this->adsns_plugin_info, $plugin_basename, 'adsense-plugin.php', 'adsense-pro.php', 'adsense-pro/adsense-pro.php', 'google-adsense', '2887beb5e9d5e26aebe6b7de9152ad1f', '80', isset($go_pro_result['pro_plugin_is_activated'])); } ?> </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 vstrsnln_settings_page() { global $wpdb, $vstrsnln_options, $vstrsnln_plugin_info, $vstrsnln_prefix, $wp_version; $message = $error = ''; if (isset($_REQUEST['vstrsnln_submit']) && check_admin_referer(plugin_basename(__FILE__), 'vstrsnln_nonce_name')) { if (isset($_POST['bws_hide_premium_options'])) { $hide_result = bws_hide_premium_options($vstrsnln_options); $vstrsnln_options = $hide_result['options']; } /* Pressing the clear statistics */ if (isset($_POST['vstrsnln_button_clean'])) { $wpdb->query("TRUNCATE `" . $vstrsnln_prefix . "general`;"); $wpdb->query("TRUNCATE `" . $vstrsnln_prefix . "detailing`;"); $vstrsnln_number_general = $wpdb->get_var("\n\t\t\t\t\tSELECT count( * )\n\t\t\t\t\tFROM `" . $vstrsnln_prefix . "general`\n\t\t\t\t\tLIMIT 1"); if ($vstrsnln_number_general == 0) { $message = __('Statistics was cleared successfully', 'visitors-online'); } } else { /* Save data for settings page */ if ($vstrsnln_options['check_user_interval'] != $_REQUEST['vstrsnln_check_user_interval']) { /* Add the planned hook - check users online */ wp_clear_scheduled_hook('vstrsnln_check_users'); if (!wp_next_scheduled('vstrsnln_check_users')) { wp_schedule_event(time(), 'vstrsnln_interval', 'vstrsnln_check_users'); } } if (isset($_REQUEST['vstrsnln_check_user_interval'])) { if (empty($_REQUEST['vstrsnln_check_user_interval'])) { $error = __('Please fill The time period. The settings are not saved', 'visitors-online'); } else { $vstrsnln_options['check_user_interval'] = isset($_REQUEST['vstrsnln_check_user_interval']) ? $_REQUEST['vstrsnln_check_user_interval'] : 1; $vstrsnln_options['check_browser'] = isset($_REQUEST['check_browser']) ? 1 : 0; $vstrsnln_options['check_country'] = isset($_REQUEST['check_country']) ? 1 : 0; update_option('vstrsnln_options', $vstrsnln_options); $message = __('Settings saved', 'visitors-online'); } } } } /* Pressing the 'Import Country' */ $vstrsnln_result_downloaded = vstrsnln_press_buttom_import(); $result = $vstrsnln_result_downloaded['result']; if (0 !== $result) { $message = $vstrsnln_result_downloaded['message']; $error = $vstrsnln_result_downloaded['error']; } if (true == $result) { vstrsnln_check_country(true); } $bws_hide_premium_options_check = bws_hide_premium_options_check($vstrsnln_options); /* GO PRO */ if (isset($_GET['action']) && 'go_pro' == $_GET['action']) { $go_pro_result = bws_go_pro_tab_check(plugin_basename(__FILE__), 'vstrsnln_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('Visitors Online Settings', 'visitors-online'); ?> </h2> <h2 class="nav-tab-wrapper"> <a class="nav-tab <?php if (!isset($_GET['action'])) { echo ' nav-tab-active'; } ?> " href="admin.php?page=visitors-online.php"><?php _e('Settings', 'visitors-online'); ?> </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=visitors-online.php&action=go_pro"><?php _e('Go PRO', 'visitors-online'); ?> </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 (!empty($hide_result['message'])) { ?> <div class="updated fade"><p><strong><?php echo $hide_result['message']; ?> </strong></p></div> <?php } if (!isset($_GET['action'])) { bws_show_settings_notice(); ?> <br/> <div> <?php printf(__('You can add the counter of Visitors Online by clicking on %s button.', 'visitors-online'), '<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 the counter of Visitors Online to your content 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", 'visitors-online'), '<code><img style="vertical-align: sub;" src="' . plugins_url('bws_menu/images/shortcode-icon.png', __FILE__) . '" alt="" /></code>', '<code>[vstrsnln_info]</code>'); ?> </div> </div> <br> <?php _e('You can also add a widget', 'visitors-online'); ?> : <strong>Visitors Online</strong> </div> <p><?php _e('Statistics can be viewed on the Dashboard.', 'visitors-online'); ?> </p> <form class="bws_form" method="post" action="admin.php?page=visitors-online.php"> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('The time period when the user is online, without making any actions', 'visitors-online'); ?> </th> <td> <input type="number" min="1" max="60" name="vstrsnln_check_user_interval" value="<?php echo $vstrsnln_options['check_user_interval']; ?> " /> <?php _e('min', 'visitors-online'); ?> </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', 'visitors-online'); ?> "></button> <div class="bws_table_bg"></div> <table class="form-table bws_pro_version"> <tr valign="top"> <th scope="row"> <?php _e('Update GeoIP', 'visitors-online'); ?> </th> <td> <?php _e('every', 'visitors-online'); ?> <input type="number" disabled name="vstrsnln_loading_country" value="0" /> <?php _e('months', 'visitors-online'); ?> <br> <span class="bws_info"> <?php _e('This option allows you to download lists with registered IP addresses all over the world to the database (from', 'visitors-online'); ?> <a href="https://www.maxmind.com" target="_blank">https://www.maxmind.com</a>). <br> <?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', 'visitors-online'); ?> . </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.', 'visitors-online'); ?> </th> </tr> </table> </div> <div class="bws_pro_version_tooltip"> <div class="bws_info"> <?php _e('Unlock premium options by upgrading to Pro version', 'visitors-online'); ?> </div> <a class="bws_button" href="http://bestwebsoft.com/products/visitors-online/?k=1b01d30e84bb97b2afecb5f34c43931d&pn=216&v=<?php echo $vstrsnln_plugin_info["Version"]; ?> &wp_v=<?php echo $wp_version; ?> " target="_blank" title="Visitors Online Pro"><?php _e('Learn More', 'visitors-online'); ?> </a> <div class="clear"></div> </div> </div> <?php } ?> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e('Clear the statistics', 'visitors-online'); ?> </th> <td> <input type="submit" name="vstrsnln_button_clean" class="button" value=<?php _e('Clear', 'visitors-online'); ?> /> </td> </tr> </table> <p class="submit"> <input type="hidden" name="vstrsnln_submit" value="submit" /> <input id="bws-submit-button" type="submit" name="vstrsnln_button_save" class="button-primary" value="<?php _e('Save Changes', 'visitors-online'); ?> " /> </p> <?php wp_nonce_field(plugin_basename(__FILE__), 'vstrsnln_nonce_name'); ?> </form> <?php vstrsnln_form_import_country("admin.php?page=visitors-online.php"); } elseif ('go_pro' == $_GET['action']) { bws_go_pro_tab_show($bws_hide_premium_options_check, $vstrsnln_plugin_info, plugin_basename(__FILE__), 'visitors-online.php', 'visitors-online-pro.php', 'visitors-online-pro/visitors-online-pro.php', 'visitors-online', '1b01d30e84bb97b2afecb5f34c43931d', '216', isset($go_pro_result['pro_plugin_is_activated'])); } bws_plugin_reviews_block($vstrsnln_plugin_info['Name'], 'visitors-online'); ?> </div> <?php }
function cstmfldssrch_page_of_settings() { global $wpdb, $cstmfldssrch_options, $cstmfldssrch_plugin_info; $message = ""; if (isset($_REQUEST['cstmfldssrch_submit_nonce']) && check_admin_referer(plugin_basename(__FILE__), 'cstmfldssrch_nonce_name')) { $cstmfldssrch_options['fields'] = isset($_REQUEST['cstmfldssrch_fields_array']) ? $_REQUEST['cstmfldssrch_fields_array'] : array(); $cstmfldssrch_options['plugin_option_version'] = $cstmfldssrch_plugin_info["Version"]; $cstmfldssrch_options['show_hidden_fields'] = isset($_REQUEST['cstmfldssrch_show_hidden_fields']) ? 1 : 0; update_option('cstmfldssrch_options', $cstmfldssrch_options); $message = __("Settings saved", 'custom-fields-search'); } /* Retrieve all the values of custom fields from the database - the keys */ if (0 == $cstmfldssrch_options['show_hidden_fields']) { $meta_key_custom_posts = $wpdb->get_col("SELECT DISTINCT(meta_key) FROM " . $wpdb->postmeta . " JOIN " . $wpdb->posts . " ON " . $wpdb->posts . ".id = " . $wpdb->postmeta . ".post_id WHERE " . $wpdb->posts . ".post_type NOT IN ('revision', 'page', 'post', 'attachment', 'nav_menu_item') AND meta_key NOT REGEXP '^_'"); $meta_key_result = $wpdb->get_col("SELECT DISTINCT(meta_key) FROM " . $wpdb->postmeta . " WHERE `meta_key` NOT REGEXP '^_'"); /* select all user's meta_key from table `wp_postmeta` */ } else { $meta_key_custom_posts = $wpdb->get_col("SELECT DISTINCT(meta_key) FROM " . $wpdb->postmeta . " JOIN " . $wpdb->posts . " ON " . $wpdb->posts . ".id = " . $wpdb->postmeta . ".post_id WHERE " . $wpdb->posts . ".post_type NOT IN ('revision', 'page', 'post', 'attachment', 'nav_menu_item')"); $meta_key_result = $wpdb->get_col("SELECT DISTINCT(meta_key) FROM " . $wpdb->postmeta); /* select all meta_key from table `wp_postmeta` */ } $install_plugins = get_plugins(); ?> <div class="wrap"> <h1><?php echo get_admin_page_title(); ?> </h1> <div class="updated fade" <?php if (!isset($_REQUEST['cstmfldssrch_submit_nonce'])) { echo "style=\"display:none\""; } ?> ><p><strong><?php echo $message; ?> </strong></p></div> <?php bws_show_settings_notice(); ?> <form method="post" action="" id="cstmfldssrch_settings_form" class="bws_form"> <table class="form-table"> <tr valign="top"> <?php if (0 < count($meta_key_result)) { ?> <th scope="row"><?php _e('Enable search for the custom field:', 'custom-fields-search'); ?> </th> <?php if (is_plugin_active('custom-search-pro/custom-search-pro.php') || is_plugin_active('custom-search-plugin/custom-search-plugin.php')) { ?> <td> <div id="cstmfldssrch_div_select_all" style="display:none;"><label ><input id="cstmfldssrch_select_all" type="checkbox" /><span style="text-transform: capitalize; padding-left: 5px;"><strong><?php _e('All', 'custom-fields-search'); ?> </strong></span></label></div> <?php foreach ($meta_key_result as $value) { ?> <label><input type="checkbox" <?php if (in_array($value, $cstmfldssrch_options['fields'])) { echo 'checked="checked"'; } ?> name="cstmfldssrch_fields_array[]" value="<?php echo $value; ?> " /><span class="cstmfldssrch_value_of_metakey"><?php echo $value; ?> </span></label><br /> <?php } ?> </td> <?php } else { $i = 1; ?> <td> <div id="cstmfldssrch_div_select_all" style="display:none;"><label ><input id="cstmfldssrch_select_all" type="checkbox" /><span style="text-transform: capitalize; padding-left: 5px;"><strong><?php _e('All', 'custom-fields-search'); ?> </strong></span></label></div> <?php foreach ($meta_key_result as $value) { if (FALSE !== in_array($value, $meta_key_custom_posts)) { $list_custom_key[$i] = $value; $i++; } else { ?> <label><input type="checkbox" <?php if (in_array($value, $cstmfldssrch_options['fields'])) { echo 'checked="checked"'; } ?> name="cstmfldssrch_fields_array[]" value="<?php echo $value; ?> " /><span class="cstmfldssrch_value_of_metakey"><?php echo $value; ?> </span></label><br /> <?php } } echo "<br />"; if (isset($list_custom_key)) { foreach ($list_custom_key as $value) { $post_type_of_mkey = $wpdb->get_col("SELECT DISTINCT(post_type) FROM " . $wpdb->posts . " JOIN " . $wpdb->postmeta . " ON " . $wpdb->posts . ".id = " . $wpdb->postmeta . ".post_id WHERE " . $wpdb->postmeta . ".meta_key LIKE ('" . $value . "')"); ?> <label><input type="checkbox" disabled="disabled" name="cstmfldssrch_fields_array[]" value="<?php echo $value; ?> " /> <span class="cstmfldssrch_disable_key"> <?php echo $value . " (" . $post_type_of_mkey[0] . " " . __('custom post type', 'custom-fields-search'); ?> ) </span></label><br /> <?php } if (array_key_exists('custom-search-pro/custom-search-pro.php', $install_plugins) || array_key_exists('custom-search-plugin/custom-search-plugin.php', $install_plugins)) { ?> <span class="bws_info"><?php _e('You need to', 'custom-fields-search'); ?> <a href="<?php echo bloginfo("url"); ?> /wp-admin/plugins.php"><?php _e('activate plugin', 'custom-fields-search'); ?> Custom Search</a><span> <?php } else { ?> <span class="bws_info"><?php _e('If the type of the post is not default - you need to install and activate the plugin', 'custom-fields-search'); ?> <a href="http://bestwebsoft.com/products/custom-search/download">Custom Search</a>.<span> <?php } } ?> </td> <?php } } else { ?> <th scope="row" colspan="2"><?php _e('Custom fields not found.', 'custom-fields-search'); ?> </th> <?php } ?> </tr> <tr valign="top"> <th scope="row"><?php _e('Show hidden fields', 'custom-fields-search'); ?> </th> <td> <input type="checkbox" <?php if (1 == $cstmfldssrch_options['show_hidden_fields']) { echo 'checked="checked"'; } ?> name="cstmfldssrch_show_hidden_fields" value="1" /> </td> </tr> </table> <p class="submit"> <input id="bws-submit-button" type="submit" class="button-primary" value="<?php _e('Save Changes', 'custom-fields-search'); ?> " /> <input type="hidden" name="cstmfldssrch_submit_nonce" value="submit" /> <?php wp_nonce_field(plugin_basename(__FILE__), 'cstmfldssrch_nonce_name'); ?> </p> </form> <?php bws_plugin_reviews_block($cstmfldssrch_plugin_info['Name'], 'custom-fields-search'); ?> </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 }