Ejemplo n.º 1
0
function relevanssi_options_form()
{
    global $relevanssi_variables, $wpdb;
    wp_enqueue_style('dashboard');
    wp_print_styles('dashboard');
    wp_enqueue_script('dashboard');
    wp_print_scripts('dashboard');
    $docs_count = $wpdb->get_var("SELECT COUNT(DISTINCT doc) FROM " . $relevanssi_variables['relevanssi_table']);
    $terms_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $relevanssi_variables['relevanssi_table']);
    $biggest_doc = $wpdb->get_var("SELECT doc FROM " . $relevanssi_variables['relevanssi_table'] . " ORDER BY doc DESC LIMIT 1");
    $serialize_options = array();
    $title_boost = get_option('relevanssi_title_boost');
    $serialize_options['relevanssi_title_boost'] = $title_boost;
    $comment_boost = get_option('relevanssi_comment_boost');
    $serialize_options['relevanssi_comment_boost'] = $comment_boost;
    $admin_search = get_option('relevanssi_admin_search');
    $serialize_options['relevanssi_admin_search'] = $admin_search;
    if ('on' == $admin_search) {
        $admin_search = 'checked="checked"';
    } else {
        $admin_search = '';
    }
    $index_limit = get_option('relevanssi_index_limit');
    $serialize_options['relevanssi_index_limit'] = $index_limit;
    $excerpts = get_option('relevanssi_excerpts');
    $serialize_options['relevanssi_excerpts'] = $excerpts;
    if ('on' == $excerpts) {
        $excerpts = 'checked="checked"';
    } else {
        $excerpts = '';
    }
    $excerpt_length = get_option('relevanssi_excerpt_length');
    $serialize_options['relevanssi_excerpt_length'] = $excerpt_length;
    $excerpt_type = get_option('relevanssi_excerpt_type');
    $serialize_options['relevanssi_excerpt_type'] = $excerpt_type;
    $excerpt_chars = "";
    $excerpt_words = "";
    switch ($excerpt_type) {
        case "chars":
            $excerpt_chars = 'selected="selected"';
            break;
        case "words":
            $excerpt_words = 'selected="selected"';
            break;
    }
    $excerpt_allowable_tags = get_option('relevanssi_excerpt_allowable_tags');
    $serialize_options['relevanssi_excerpt_allowable_tags'] = $excerpt_allowable_tags;
    $log_queries = get_option('relevanssi_log_queries');
    $serialize_options['relevanssi_log_queries'] = $log_queries;
    if ('on' == $log_queries) {
        $log_queries = 'checked="checked"';
    } else {
        $log_queries = '';
    }
    $log_queries_with_ip = get_option('relevanssi_log_queries_with_ip');
    $serialize_options['relevanssi_log_queries_with_ip'] = $log_queries_with_ip;
    if ('on' == $log_queries_with_ip) {
        $log_queries_with_ip = 'checked="checked"';
    } else {
        $log_queries_with_ip = '';
    }
    $hide_branding = get_option('relevanssi_hide_branding');
    $serialize_options['relevanssi_hide_branding'] = $hide_branding;
    if ('on' == $hide_branding) {
        $hide_branding = 'checked="checked"';
    } else {
        $hide_branding = '';
    }
    $highlight = get_option('relevanssi_highlight');
    $serialize_options['relevanssi_highlight'] = $highlight;
    $highlight_none = "";
    $highlight_mark = "";
    $highlight_em = "";
    $highlight_strong = "";
    $highlight_col = "";
    $highlight_bgcol = "";
    $highlight_style = "";
    $highlight_class = "";
    switch ($highlight) {
        case "no":
            $highlight_none = 'selected="selected"';
            break;
        case "mark":
            $highlight_mark = 'selected="selected"';
            break;
        case "em":
            $highlight_em = 'selected="selected"';
            break;
        case "strong":
            $highlight_strong = 'selected="selected"';
            break;
        case "col":
            $highlight_col = 'selected="selected"';
            break;
        case "bgcol":
            $highlight_bgcol = 'selected="selected"';
            break;
        case "css":
            $highlight_style = 'selected="selected"';
            break;
        case "class":
            $highlight_class = 'selected="selected"';
            break;
    }
    $index_fields = get_option('relevanssi_index_fields');
    $serialize_options['relevanssi_index_fields'] = $index_fields;
    $txt_col = get_option('relevanssi_txt_col');
    $serialize_options['relevanssi_txt_col'] = $txt_col;
    $bg_col = get_option('relevanssi_bg_col');
    $serialize_options['relevanssi_bg_col'] = $bg_col;
    $css = get_option('relevanssi_css');
    $serialize_options['relevanssi_css'] = $css;
    $class = get_option('relevanssi_class');
    $serialize_options['relevanssi_class'] = $class;
    $cat = get_option('relevanssi_cat');
    $serialize_options['relevanssi_cat'] = $cat;
    $excat = get_option('relevanssi_excat');
    $serialize_options['relevanssi_excat'] = $excat;
    $extag = get_option('relevanssi_extag');
    $serialize_options['relevanssi_extag'] = $extag;
    $fuzzy = get_option('relevanssi_fuzzy');
    $serialize_options['relevanssi_fuzzy'] = $fuzzy;
    $fuzzy_sometimes = 'sometimes' == $fuzzy ? 'selected="selected"' : '';
    $fuzzy_always = 'always' == $fuzzy ? 'selected="selected"' : '';
    $fuzzy_never = 'never' == $fuzzy ? 'selected="selected"' : '';
    $implicit = get_option('relevanssi_implicit_operator');
    $serialize_options['relevanssi_implicit_operator'] = $implicit;
    $implicit_and = 'AND' == $implicit ? 'selected="selected"' : '';
    $implicit_or = 'OR' == $implicit ? 'selected="selected"' : '';
    $expand_shortcodes = 'on' == get_option('relevanssi_expand_shortcodes') ? 'checked="checked"' : '';
    $serialize_options['relevanssi_expand_shortcodes'] = get_option('relevanssi_expand_shortcodes');
    $disablefallback = 'on' == get_option('relevanssi_disable_or_fallback') ? 'checked="checked"' : '';
    $serialize_options['relevanssi_disable_or_fallback'] = get_option('relevanssi_disable_or_fallback');
    $throttle = 'on' == get_option('relevanssi_throttle') ? 'checked="checked"' : '';
    $serialize_options['relevanssi_throttle'] = get_option('relevanssi_throttle');
    $throttle_limit = get_option('relevanssi_throttle_limit');
    $serialize_options['relevanssi_throttle_limit'] = $throttle_limit;
    $omit_from_logs = get_option('relevanssi_omit_from_logs');
    $serialize_options['relevanssi_omit_from_logs'] = $omit_from_logs;
    $synonyms = get_option('relevanssi_synonyms');
    $serialize_options['relevanssi_synonyms'] = $synonyms;
    isset($synonyms) ? $synonyms = str_replace(';', "\n", $synonyms) : ($synonyms = "");
    //Added by OdditY ->
    $expst = get_option('relevanssi_exclude_posts');
    $serialize_options['relevanssi_exclude_posts'] = $expst;
    $hititle = 'on' == get_option('relevanssi_hilite_title') ? 'checked="checked"' : '';
    $serialize_options['relevanssi_hilite_title'] = get_option('relevanssi_hilite_title');
    $incom_type = get_option('relevanssi_index_comments');
    $serialize_options['relevanssi_index_comments'] = $incom_type;
    $incom_type_all = "";
    $incom_type_normal = "";
    $incom_type_none = "";
    switch ($incom_type) {
        case "all":
            $incom_type_all = 'selected="selected"';
            break;
        case "normal":
            $incom_type_normal = 'selected="selected"';
            break;
        case "none":
            $incom_type_none = 'selected="selected"';
            break;
    }
    //added by OdditY END <-
    $highlight_docs = 'on' == get_option('relevanssi_highlight_docs') ? 'checked="checked"' : '';
    $highlight_coms = 'on' == get_option('relevanssi_highlight_comments') ? 'checked="checked"' : '';
    $serialize_options['relevanssi_highlight_docs'] = get_option('relevanssi_highlight_docs');
    $serialize_options['relevanssi_highlight_comments'] = get_option('relevanssi_highlight_comments');
    $respect_exclude = 'on' == get_option('relevanssi_respect_exclude') ? 'checked="checked"' : '';
    $serialize_options['relevanssi_respect_exclude'] = get_option('relevanssi_respect_exclude');
    $min_word_length = get_option('relevanssi_min_word_length');
    $serialize_options['relevanssi_min_word_length'] = $min_word_length;
    $index_author = 'on' == get_option('relevanssi_index_author') ? 'checked="checked"' : '';
    $serialize_options['relevanssi_index_author'] = get_option('relevanssi_index_author');
    $index_excerpt = 'on' == get_option('relevanssi_index_excerpt') ? 'checked="checked"' : '';
    $serialize_options['relevanssi_index_excerpt'] = get_option('relevanssi_index_excerpt');
    $show_matches = 'on' == get_option('relevanssi_show_matches') ? 'checked="checked"' : '';
    $serialize_options['relevanssi_show_matches'] = get_option('relevanssi_show_matches');
    $show_matches_text = stripslashes(get_option('relevanssi_show_matches_text'));
    $serialize_options['relevanssi_show_matches_text'] = get_option('relevanssi_show_matches_text');
    $wpml_only_current = 'on' == get_option('relevanssi_wpml_only_current') ? 'checked="checked"' : '';
    $serialize_options['relevanssi_wpml_only_current'] = get_option('relevanssi_wpml_only_current');
    $word_boundaries = 'on' == get_option('relevanssi_word_boundaries') ? 'checked="checked"' : '';
    $serialize_options['relevanssi_word_boundaries'] = get_option('relevanssi_word_boundaries');
    $post_type_weights = get_option('relevanssi_post_type_weights');
    $serialize_options['relevanssi_post_type_weights'] = $post_type_weights;
    $index_post_types = get_option('relevanssi_index_post_types');
    if (empty($index_post_types)) {
        $index_post_types = array();
    }
    $serialize_options['relevanssi_index_post_types'] = $index_post_types;
    $index_taxonomies_list = get_option('relevanssi_index_taxonomies_list');
    if (empty($index_taxonomies_list)) {
        $index_taxonomies_list = array();
    }
    $serialize_options['relevanssi_index_taxonomies_list'] = $index_taxonomies_list;
    $orderby = get_option('relevanssi_default_orderby');
    $serialize_options['relevanssi_default_orderby'] = $orderby;
    $orderby_relevance = 'relevance' == $orderby ? 'selected="selected"' : '';
    $orderby_date = 'post_date' == $orderby ? 'selected="selected"' : '';
    if (RELEVANSSI_PREMIUM) {
        $api_key = get_option('relevanssi_api_key');
        $serialize_options['relevanssi_api_key'] = $api_key;
        $link_boost = get_option('relevanssi_link_boost');
        $serialize_options['relevanssi_link_boost'] = $link_boost;
        $intlinks = get_option('relevanssi_internal_links');
        $serialize_options['relevanssi_internal_links'] = $intlinks;
        $intlinks_strip = 'strip' == $intlinks ? 'selected="selected"' : '';
        $intlinks_nostrip = 'nostrip' == $intlinks ? 'selected="selected"' : '';
        $intlinks_noindex = 'noindex' == $intlinks ? 'selected="selected"' : '';
        $highlight_docs_ext = 'on' == get_option('relevanssi_highlight_docs_external') ? 'checked="checked"' : '';
        $serialize_options['relevanssi_highlight_docs_external'] = get_option('relevanssi_highlight_docs_external');
        $thousand_separator = get_option('relevanssi_thousand_separator');
        $serialize_options['relevanssi_thousand_separator'] = $thousand_separator;
        $disable_shortcodes = get_option('relevanssi_disable_shortcodes');
        $serialize_options['relevanssi_disable_shortcodes'] = $disable_shortcodes;
        $index_users = 'on' == get_option('relevanssi_index_users') ? 'checked="checked"' : '';
        $serialize_options['relevanssi_index_users'] = get_option('relevanssi_index_users');
        $index_user_fields = get_option('relevanssi_index_user_fields');
        $serialize_options['relevanssi_index_user_fields'] = $index_user_fields;
        $index_subscribers = 'on' == get_option('relevanssi_index_subscribers') ? 'checked="checked"' : '';
        $serialize_options['relevanssi_index_subscribers'] = get_option('relevanssi_index_subscribers');
        $index_synonyms = 'on' == get_option('relevanssi_index_synonyms') ? 'checked="checked"' : '';
        $serialize_options['relevanssi_index_synonyms'] = get_option('relevanssi_index_synonyms');
        $index_taxonomies = 'on' == get_option('relevanssi_index_taxonomies') ? 'checked="checked"' : '';
        $serialize_options['relevanssi_index_taxonomies'] = get_option('relevanssi_index_taxonomies');
        $index_terms = get_option('relevanssi_index_terms');
        if (empty($index_terms)) {
            $index_terms = array();
        }
        $serialize_options['relevanssi_index_terms'] = $index_terms;
        $hide_post_controls = 'on' == get_option('relevanssi_hide_post_controls') ? 'checked="checked"' : '';
        $serialize_options['relevanssi_hide_post_controls'] = get_option('relevanssi_hide_post_controls');
        $recency_bonus_array = get_option('relevanssi_recency_bonus');
        $serialize_options['recency_bonus'] = $recency_bonus_array;
        $recency_bonus = $recency_bonus_array['bonus'];
        $recency_bonus_days = $recency_bonus_array['days'];
        $mysql_columns = get_option('relevanssi_mysql_columns');
        $serialize_options['relevanssi_mysql_columns'] = $mysql_columns;
        $serialized_options = serialize($serialize_options);
    }
    echo "<div class='postbox-container' style='width:70%;'>";
    if (RELEVANSSI_PREMIUM) {
        echo "<form method='post' action='options-general.php?page=relevanssi-premium/relevanssi.php'>";
    } else {
        echo "<form method='post'>";
    }
    wp_nonce_field(plugin_basename($relevanssi_variables['file']), 'relevanssi_options');
    ?>
	
    <p><a href="#basic"><?php 
    _e("Basic options", "relevanssi");
    ?>
</a> |
	<a href="#weights"><?php 
    _e("Weights", "relevanssi");
    ?>
</a> |
	<a href="#logs"><?php 
    _e("Logs", "relevanssi");
    ?>
</a> |
    <a href="#exclusions"><?php 
    _e("Exclusions and restrictions", "relevanssi");
    ?>
</a> |
    <a href="#excerpts"><?php 
    _e("Custom excerpts", "relevanssi");
    ?>
</a> |
    <a href="#highlighting"><?php 
    _e("Highlighting search results", "relevanssi");
    ?>
</a> |
    <a href="#indexing"><?php 
    _e("Indexing options", "relevanssi");
    ?>
</a> |
    <a href="#synonyms"><?php 
    _e("Synonyms", "relevanssi");
    ?>
</a> |
    <a href="#stopwords"><?php 
    _e("Stopwords", "relevanssi");
    ?>
</a> |
<?php 
    if (RELEVANSSI_PREMIUM) {
        echo '<a href="#options">' . __("Import/export options", "relevanssi") . '</a>';
    } else {
        echo '<strong><a href="http://www.relevanssi.com/buy-premium/?utm_source=plugin&utm_medium=link&utm_campaign=buy">' . __('Buy Relevanssi Premium', 'relevanssi') . '</a></strong>';
    }
    ?>
    </p>

	<h3><?php 
    _e('Quick tools', 'relevanssi');
    ?>
</h3>
	<p>
	<input type='submit' name='submit' value='<?php 
    esc_attr(_e('Save options', 'relevanssi'));
    ?>
' class='button-primary' />
	<input type="submit" name="index" value="<?php 
    esc_attr(_e('Build the index', 'relevanssi'));
    ?>
" class='button-primary' />
	<input type="submit" name="index_extend" value="<?php 
    esc_attr(_e('Continue indexing', 'relevanssi'));
    ?>
" class='button-secondary' />, <?php 
    _e('add', 'relevanssi');
    ?>
 <input type="text" size="4" name="relevanssi_index_limit" value="<?php 
    echo $index_limit;
    ?>
" /> <?php 
    _e('documents.', 'relevanssi');
    ?>
</p>

<?php 
    if (empty($index_post_types)) {
        echo "<p><strong>" . __("WARNING: You've chosen no post types to index. Nothing will be indexed. <a href='#indexing'>Choose some post types to index</a>.", 'relevanssi') . "</strong></p>";
    }
    ?>

	<p><?php 
    _e("Use 'Build the index' to build the index with current <a href='#indexing'>indexing options</a>. If you can't finish indexing with one go, use 'Continue indexing' to finish the job. You can change the number of documents to add until you find the largest amount you can add with one go. See 'State of the Index' below to find out how many documents actually go into the index.", 'relevanssi');
    ?>
</p>

	<h3><?php 
    _e("State of the Index", "relevanssi");
    ?>
</h3>
	<p>
	<?php 
    _e("Documents in the index", "relevanssi");
    ?>
: <strong><?php 
    echo $docs_count;
    ?>
</strong><br />
	<?php 
    _e("Terms in the index", "relevanssi");
    ?>
: <strong><?php 
    echo $terms_count;
    ?>
</strong><br />
	<?php 
    _e("Highest post ID indexed", "relevanssi");
    ?>
: <strong><?php 
    echo $biggest_doc;
    ?>
</strong>
	</p>
	
	<h3 id="basic"><?php 
    _e("Basic options", "relevanssi");
    ?>
</h3>

<?php 
    if (function_exists('relevanssi_form_api_key')) {
        relevanssi_form_api_key($api_key);
    }
    ?>

	<label for='relevanssi_admin_search'><?php 
    _e('Use search for admin:', 'relevanssi');
    ?>
	<input type='checkbox' name='relevanssi_admin_search' id='relevanssi_admin_search' <?php 
    echo $admin_search;
    ?>
 /></label>
	<small><?php 
    _e('If checked, Relevanssi will be used for searches in the admin interface', 'relevanssi');
    ?>
</small>

	<br /><br />

	<label for='relevanssi_implicit_operator'><?php 
    _e("Default operator for the search?", "relevanssi");
    ?>
	<select name='relevanssi_implicit_operator' id='relevanssi_implicit_operator'>
	<option value='AND' <?php 
    echo $implicit_and;
    ?>
><?php 
    _e("AND - require all terms", "relevanssi");
    ?>
</option>
	<option value='OR' <?php 
    echo $implicit_or;
    ?>
><?php 
    _e("OR - any term present is enough", "relevanssi");
    ?>
</option>
	</select></label><br />
	<small><?php 
    _e("If you choose AND and the search finds no matches, it will automatically do an OR search.", "relevanssi");
    ?>
</small>
	
	<br /><br />

	<label for='relevanssi_disable_or_fallback'><?php 
    _e("Disable OR fallback:", "relevanssi");
    ?>
	<input type='checkbox' name='relevanssi_disable_or_fallback' id='relevanssi_disable_or_fallback' <?php 
    echo $disablefallback;
    ?>
 /></label><br />
	<small><?php 
    _e("If you don't want Relevanssi to fall back to OR search when AND search gets no hits, check this option. For most cases, leave this one unchecked.", 'relevanssi');
    ?>
</small>

	<br /><br />

	<label for='relevanssi_default_orderby'><?php 
    _e('Default order for results:', 'relevanssi');
    ?>
	<select name='relevanssi_default_orderby' id='relevanssi_default_orderby'>
	<option value='relevance' <?php 
    echo $orderby_relevance;
    ?>
><?php 
    _e("Relevance (highly recommended)", "relevanssi");
    ?>
</option>
	<option value='post_date' <?php 
    echo $orderby_date;
    ?>
><?php 
    _e("Post date", "relevanssi");
    ?>
</option>
	</select></label><br />
	<small><?php 
    _e("If you want date-based results, see the recent post bonus in the Weights section.", "relevanssi");
    ?>
</small>
	
	<br /><br />

	<label for='relevanssi_fuzzy'><?php 
    _e('When to use fuzzy matching?', 'relevanssi');
    ?>
	<select name='relevanssi_fuzzy' id='relevanssi_fuzzy'>
	<option value='sometimes' <?php 
    echo $fuzzy_sometimes;
    ?>
><?php 
    _e("When straight search gets no hits", "relevanssi");
    ?>
</option>
	<option value='always' <?php 
    echo $fuzzy_always;
    ?>
><?php 
    _e("Always", "relevanssi");
    ?>
</option>
	<option value='never' <?php 
    echo $fuzzy_never;
    ?>
><?php 
    _e("Don't use fuzzy search", "relevanssi");
    ?>
</option>
	</select></label><br />
	<small><?php 
    _e("Straight search matches just the term. Fuzzy search matches everything that begins or ends with the search term.", "relevanssi");
    ?>
</small>

	<br /><br />

<?php 
    if (function_exists('relevanssi_form_internal_links')) {
        relevanssi_form_internal_links($intlinks_noindex, $intlinks_strip, $intlinks_nostrip);
    }
    ?>
	
	<label for='relevanssi_throttle'><?php 
    _e("Limit searches:", "relevanssi");
    ?>
	<input type='checkbox' name='relevanssi_throttle' id='relevanssi_throttle' <?php 
    echo $throttle;
    ?>
 /></label><br />
	<small><?php 
    _e("If this option is checked, Relevanssi will limit search results to at most 500 results per term. This will improve performance, but may cause some relevant documents to go unfound. However, Relevanssi tries to prioritize the most relevant documents. <strong>This does not work well when sorting results by date.</strong> The throttle can end up cutting off recent posts to favour more relevant posts.", 'relevanssi');
    ?>
</small>

	<br /><br />

	<label for='relevanssi_throttle_limit'><?php 
    _e("Limit:", "relevanssi");
    ?>
	<input type='text' size='4' name='relevanssi_throttle_limit' id='relevanssi_throttle_limit' value='<?php 
    echo $throttle_limit;
    ?>
' /></label><br />
	<small><?php 
    printf(__("For better performance, adjust the limit to a smaller number. Adjusting the limit to 100 or 200 should be safe for good results, and might bring a boost in search speed. DO NOT use this feature to limit the number of search results on search results pages, as that will lead to problems. For adjusting the number of search results displayed, see <a href='%s'>this knowledge base entry</a>.", 'relevanssi'), 'http://www.relevanssi.com/knowledge-base/posts-per-page/');
    ?>
</small>

	<br /><br />
	
<?php 
    if (function_exists('relevanssi_form_hide_post_controls')) {
        relevanssi_form_hide_post_controls($hide_post_controls);
    }
    ?>
	
	<h3 id="weights"><?php 
    _e('Weights', 'relevanssi');
    ?>
</h3>

	<p><?php 
    _e('These values affect the weights of the documents. These are all multipliers, so 1 means no change in weight, less than 1 means less weight, and more than 1 means more weight. Setting something to zero makes that worthless. For example, if title weight is more than 1, words in titles are more significant than words elsewhere. If title weight is 0, words in titles won\'t make any difference to the search results.', 'relevanssi');
    ?>
</p>
	
	<table class="widefat">
	<thead>
		<tr>
			<th><?php 
    _e('Element', 'relevanssi');
    ?>
</th>
			<th><?php 
    _e('Weight', 'relevanssi');
    ?>
</th>
			<th><?php 
    _e('Default weight', 'relevanssi');
    ?>
</th>
		</tr>
	</thead>
	<tr>
		<td>
			<?php 
    _e('Post titles', 'relevanssi');
    ?>
		</td>
		<td>
			<input type='text' name='relevanssi_title_boost' id='relevanssi_title_boost' size='4' value='<?php 
    echo $title_boost;
    ?>
' />
		</td>
		<td>
			<?php 
    echo $relevanssi_variables['title_boost_default'];
    ?>
		</td>
	</tr>
	<?php 
    if (function_exists('relevanssi_form_link_weight')) {
        relevanssi_form_link_weight($link_boost);
    }
    ?>
	<tr>
		<td>
			<?php 
    _e('Comment text', 'relevanssi');
    ?>
 
		</td>
		<td>
			<input type='text' name='relevanssi_comment_boost' id='relevanssi_comment_boost' size='4' value='<?php 
    echo $comment_boost;
    ?>
' />
		</td>
		<td>
			<?php 
    echo $relevanssi_variables['comment_boost_default'];
    ?>
		</td>
	</tr>
	<?php 
    if (function_exists('relevanssi_form_post_type_weights')) {
        relevanssi_form_post_type_weights($post_type_weights);
    }
    if (function_exists('relevanssi_form_taxonomy_weights')) {
        relevanssi_form_taxonomy_weights($post_type_weights);
    }
    if (function_exists('relevanssi_form_tag_weight')) {
        relevanssi_form_tag_weight($post_type_weights);
    }
    ?>
	</table>

	<br /><br />

	<?php 
    if (function_exists('relevanssi_form_recency')) {
        relevanssi_form_recency($recency_bonus, $recency_bonus_days);
    }
    ?>
	
	<?php 
    if (function_exists('icl_object_id')) {
        ?>
	<h3 id="wpml"><?php 
        _e('WPML/Polylang compatibility', 'relevanssi');
        ?>
</h3>
	
	<label for='relevanssi_wpml_only_current'><?php 
        _e("Limit results to current language:", "relevanssi");
        ?>
	<input type='checkbox' name='relevanssi_wpml_only_current' id='relevanssi_wpml_only_current' <?php 
        echo $wpml_only_current;
        ?>
 /></label>
	<small><?php 
        _e("If this option is checked, Relevanssi will only return results in the current active language. Otherwise results will include posts in every language.", "relevanssi");
        ?>
</small>
	
	<?php 
    }
    ?>
	
	<h3 id="logs"><?php 
    _e('Logs', 'relevanssi');
    ?>
</h3>
	
	<label for='relevanssi_log_queries'><?php 
    _e("Keep a log of user queries:", "relevanssi");
    ?>
	<input type='checkbox' name='relevanssi_log_queries' id='relevanssi_log_queries' <?php 
    echo $log_queries;
    ?>
 /></label>
	<small><?php 
    _e("If checked, Relevanssi will log user queries. The log appears in 'User searches' on the Dashboard admin menu.", 'relevanssi');
    ?>
</small>

	<br /><br />

	<label for='relevanssi_log_queries_with_ip'><?php 
    _e("Log the user's IP with the queries:", "relevanssi");
    ?>
	<input type='checkbox' name='relevanssi_log_queries_with_ip' id='relevanssi_log_queries_with_ip' <?php 
    echo $log_queries_with_ip;
    ?>
 /></label>
	<small><?php 
    _e("If checked, Relevanssi will log user's IP-Adress with the queries.", 'relevanssi');
    ?>
</small>

	<br /><br />

	<label for='relevanssi_omit_from_logs'><?php 
    _e("Don't log queries from these users:", "relevanssi");
    ?>
	<input type='text' name='relevanssi_omit_from_logs' id='relevanssi_omit_from_logs' size='20' value='<?php 
    echo esc_attr($omit_from_logs);
    ?>
' /></label>
	<small><?php 
    _e("Comma-separated list of numeric user IDs or user login names that will not be logged.", "relevanssi");
    ?>
</small>

<?php 
    if (RELEVANSSI_PREMIUM) {
        echo "<p>" . __("If you enable logs, you can see what your users are searching for. You can prevent your own searches from getting in the logs with the omit feature.", "relevanssi") . "</p>";
    } else {
        echo "<p>" . __("If you enable logs, you can see what your users are searching for. Logs are also needed to use the 'Did you mean?' feature. You can prevent your own searches from getting in the logs with the omit feature.", "relevanssi") . "</p>";
    }
    ?>

	<?php 
    if (function_exists('relevanssi_form_hide_branding')) {
        relevanssi_form_hide_branding($hide_branding);
    }
    ?>

	<h3 id="exclusions"><?php 
    _e("Exclusions and restrictions", "relevanssi");
    ?>
</h3>
	
	<label for='relevanssi_cat'><?php 
    _e('Restrict search to these categories and tags:', 'relevanssi');
    ?>
	<input type='text' name='relevanssi_cat' id='relevanssi_cat' size='20' value='<?php 
    echo esc_attr($cat);
    ?>
' /></label><br />
	<small><?php 
    _e("Enter a comma-separated list of category and tag IDs to restrict search to those categories or tags. You can also use <code>&lt;input type='hidden' name='cats' value='list of cats and tags' /&gt;</code> in your search form. The input field will \toverrun this setting.", 'relevanssi');
    ?>
</small>

	<br /><br />

	<label for='relevanssi_excat'><?php 
    _e('Exclude these categories from search:', 'relevanssi');
    ?>
	<input type='text' name='relevanssi_excat' id='relevanssi_excat' size='20' value='<?php 
    echo esc_attr($excat);
    ?>
' /></label><br />
	<small><?php 
    _e("Enter a comma-separated list of category IDs that are excluded from search results.", 'relevanssi');
    ?>
</small>

	<br /><br />

	<label for='relevanssi_extag'><?php 
    _e('Exclude these tags from search:', 'relevanssi');
    ?>
	<input type='text' name='relevanssi_extag' id='relevanssi_extag' size='20' value='<?php 
    echo esc_attr($extag);
    ?>
' /></label><br />
	<small><?php 
    _e("Enter a comma-separated list of tag IDs that are excluded from search results.", 'relevanssi');
    ?>
</small>

	<br /><br />

	<label for='relevanssi_expst'><?php 
    _e('Exclude these posts/pages from search:', 'relevanssi');
    ?>
	<input type='text'  name='relevanssi_expst' id='relevanssi_expst' size='20' value='<?php 
    echo esc_attr($expst);
    ?>
' /></label><br />
<?php 
    if (RELEVANSSI_PREMIUM) {
        echo "<small>" . __("Enter a comma-separated list of post/page IDs that are excluded from search results. This only works here, you can't use the input field option (WordPress doesn't pass custom parameters there). You can also use a checkbox on post/page edit pages to remove posts from index.", 'relevanssi') . "</small>";
    } else {
        echo "<small>" . __("Enter a comma-separated list of post/page IDs that are excluded from search results. This only works here, you can't use the input field option (WordPress doesn't pass custom parameters there).", 'relevanssi') . "</small>";
    }
    ?>

	<br /><br />

	<label for='relevanssi_respect_exclude'><?php 
    _e('Respect exclude_from_search for custom post types:', 'relevanssi');
    ?>
	<input type='checkbox' name='relevanssi_respect_exclude' id='relevanssi_respect_exclude' <?php 
    echo $respect_exclude;
    ?>
 /></label><br />
	<small><?php 
    _e("If checked, Relevanssi won't display posts of custom post types that have 'exclude_from_search' set to true. If not checked, Relevanssi will display anything that is indexed.", 'relevanssi');
    ?>
</small>

	<h3 id="excerpts"><?php 
    _e("Custom excerpts/snippets", "relevanssi");
    ?>
</h3>
	
	<label for='relevanssi_excerpts'><?php 
    _e("Create custom search result snippets:", "relevanssi");
    ?>
	<input type='checkbox' name='relevanssi_excerpts' id='relevanssi_excerpts' <?php 
    echo $excerpts;
    ?>
 /></label><br />
	<small><?php 
    _e("If checked, Relevanssi will create excerpts that contain the search term hits. To make them work, make sure your search result template uses the_excerpt() to display post excerpts.", 'relevanssi');
    ?>
</small>
	
	<p><?php 
    _e('Note: Building custom excerpts can be slow. If you are not actually using the excerpts, make sure you disable the option.', 'relevanssi');
    ?>
</p>
	
	<label for='relevanssi_excerpt_length'><?php 
    _e("Length of the snippet:", "relevanssi");
    ?>
	<input type='text' name='relevanssi_excerpt_length' id='relevanssi_excerpt_length' size='4' value='<?php 
    echo esc_attr($excerpt_length);
    ?>
' /></label>
	<select name='relevanssi_excerpt_type' id='relevanssi_excerpt_type'>
	<option value='chars' <?php 
    echo $excerpt_chars;
    ?>
><?php 
    _e("characters", "relevanssi");
    ?>
</option>
	<option value='words' <?php 
    echo $excerpt_words;
    ?>
><?php 
    _e("words", "relevanssi");
    ?>
</option>
	</select><br />
	<small><?php 
    _e("This must be an integer.", "relevanssi");
    ?>
</small>

	<br /><br />

	<label for='relevanssi_excerpt_allowable_tags'><?php 
    _e("Allowable tags in excerpts:", "relevanssi");
    ?>
	<input type='text' name='relevanssi_excerpt_allowable_tags' id='relevanssi_excerpt_allowable_tags' size='20' value='<?php 
    echo esc_attr($excerpt_allowable_tags);
    ?>
' /></label>
	<br />
	<small><?php 
    _e("List all tags you want to allow in excerpts, without any whitespace. For example: '&lt;p&gt;&lt;a&gt;&lt;strong&gt;'.", "relevanssi");
    ?>
</small>

	<br /><br />

	<label for='relevanssi_show_matches'><?php 
    _e("Show breakdown of search hits in excerpts:", "relevanssi");
    ?>
	<input type='checkbox' name='relevanssi_show_matches' id='relevanssi_show_matches' <?php 
    echo $show_matches;
    ?>
 /></label>
	<small><?php 
    _e("Check this to show more information on where the search hits were made. Requires custom snippets to work.", "relevanssi");
    ?>
</small>

	<br /><br />

	<label for='relevanssi_show_matches_text'><?php 
    _e("The breakdown format:", "relevanssi");
    ?>
	<input type='text' name='relevanssi_show_matches_text' id='relevanssi_show_matches_text' value="<?php 
    echo esc_attr($show_matches_text);
    ?>
" size='20' /></label>
	<small><?php 
    _e("Use %body%, %title%, %tags% and %comments% to display the number of hits (in different parts of the post), %total% for total hits, %score% to display the document weight and %terms% to show how many hits each search term got. No double quotes (\") allowed!", "relevanssi");
    ?>
</small>

	<h3 id="highlighting"><?php 
    _e("Search hit highlighting", "relevanssi");
    ?>
</h3>

	<?php 
    _e("First, choose the type of highlighting used:", "relevanssi");
    ?>
<br />

	<div style='margin-left: 2em'>
	<label for='relevanssi_highlight'><?php 
    _e("Highlight query terms in search results:", 'relevanssi');
    ?>
	<select name='relevanssi_highlight' id='relevanssi_highlight'>
	<option value='no' <?php 
    echo $highlight_none;
    ?>
><?php 
    _e('No highlighting', 'relevanssi');
    ?>
</option>
	<option value='mark' <?php 
    echo $highlight_mark;
    ?>
>&lt;mark&gt;</option>
	<option value='em' <?php 
    echo $highlight_em;
    ?>
>&lt;em&gt;</option>
	<option value='strong' <?php 
    echo $highlight_strong;
    ?>
>&lt;strong&gt;</option>
	<option value='col' <?php 
    echo $highlight_col;
    ?>
><?php 
    _e('Text color', 'relevanssi');
    ?>
</option>
	<option value='bgcol' <?php 
    echo $highlight_bgcol;
    ?>
><?php 
    _e('Background color', 'relevanssi');
    ?>
</option>
	<option value='css' <?php 
    echo $highlight_style;
    ?>
><?php 
    _e("CSS Style", 'relevanssi');
    ?>
</option>
	<option value='class' <?php 
    echo $highlight_class;
    ?>
><?php 
    _e("CSS Class", 'relevanssi');
    ?>
</option>
	</select></label>
	<small><?php 
    _e("Highlighting isn't available unless you use custom snippets", 'relevanssi');
    ?>
</small>
	
	<br />

	<label for='relevanssi_hilite_title'><?php 
    _e("Highlight query terms in result titles too:", 'relevanssi');
    ?>
	<input type='checkbox' name='relevanssi_hilite_title' id='relevanssi_hilite_title' <?php 
    echo $hititle;
    ?>
 /></label>
	<small><?php 
    _e("", 'relevanssi');
    ?>
</small>

	<br />

	<label for='relevanssi_highlight_docs'><?php 
    _e("Highlight query terms in documents from local searches:", 'relevanssi');
    ?>
	<input type='checkbox' name='relevanssi_highlight_docs' id='relevanssi_highlight_docs' <?php 
    echo $highlight_docs;
    ?>
 /></label>
	<small><?php 
    _e("Highlights hits when user opens the post from search results. This is based on HTTP referrer, so if that's blocked, there'll be no highlights.", "relevanssi");
    ?>
</small>

	<br />

	<?php 
    if (function_exists('relevanssi_form_highlight_external')) {
        relevanssi_form_highlight_external($highlight_docs_ext);
    }
    ?>
	
	<label for='relevanssi_highlight_comments'><?php 
    _e("Highlight query terms in comments:", 'relevanssi');
    ?>
	<input type='checkbox' name='relevanssi_highlight_comments' id='relevanssi_highlight_comments' <?php 
    echo $highlight_coms;
    ?>
 /></label>
	<small><?php 
    _e("Highlights hits in comments when user opens the post from search results.", "relevanssi");
    ?>
</small>

	<br />
	
	<label for='relevanssi_word_boundaries'><?php 
    _e("Uncheck this if you use non-ASCII characters:", 'relevanssi');
    ?>
	<input type='checkbox' name='relevanssi_word_boundaries' id='relevanssi_word_boundaries' <?php 
    echo $word_boundaries;
    ?>
 /></label>
	<small><?php 
    _e("If you use non-ASCII characters (like Cyrillic alphabet) and the highlights don't work, uncheck this option to make highlights work.", "relevanssi");
    ?>
</small>

	<br /><br />
	</div>
	
	<?php 
    _e("Then adjust the settings for your chosen type:", "relevanssi");
    ?>
<br />

	<div style='margin-left: 2em'>
	
	<label for='relevanssi_txt_col'><?php 
    _e("Text color for highlights:", "relevanssi");
    ?>
	<input type='text' name='relevanssi_txt_col' id='relevanssi_txt_col' size='7' value='<?php 
    echo esc_attr($txt_col);
    ?>
' /></label>
	<small><?php 
    _e("Use HTML color codes (#rgb or #rrggbb)", "relevanssi");
    ?>
</small>

	<br />
	
	<label for='relevanssi_bg_col'><?php 
    _e("Background color for highlights:", "relevanssi");
    ?>
	<input type='text' name='relevanssi_bg_col' id='relevanssi_bg_col' size='7' value='<?php 
    echo esc_attr($bg_col);
    ?>
' /></label>
	<small><?php 
    _e("Use HTML color codes (#rgb or #rrggbb)", "relevanssi");
    ?>
</small>

	<br />
	
	<label for='relevanssi_css'><?php 
    _e("CSS style for highlights:", "relevanssi");
    ?>
	<input type='text' name='relevanssi_css' id='relevanssi_css' size='30' value='<?php 
    echo esc_attr($css);
    ?>
' /></label>
	<small><?php 
    _e("You can use any CSS styling here, style will be inserted with a &lt;span&gt;", "relevanssi");
    ?>
</small>

	<br />
	
	<label for='relevanssi_class'><?php 
    _e("CSS class for highlights:", "relevanssi");
    ?>
	<input type='text' name='relevanssi_class' id='relevanssi_class' size='10' value='<?php 
    echo esc_attr($class);
    ?>
' /></label>
	<small><?php 
    _e("Name a class here, search results will be wrapped in a &lt;span&gt; with the class", "relevanssi");
    ?>
</small>

	</div>
	
	<br />
	<br />
	
	<input type='submit' name='submit' value='<?php 
    esc_attr(_e('Save the options', 'relevanssi'));
    ?>
' class='button button-primary' />

	<h3 id="indexing"><?php 
    _e('Indexing options', 'relevanssi');
    ?>
</h3>

	<p><?php 
    _e('Choose post types to index:', 'relevanssi');
    ?>
</p>
	
	<table class="widefat" id="index_post_types_table">
	<thead>
		<tr>
			<th><?php 
    _e('Type', 'relevanssi');
    ?>
</th>
			<th><?php 
    _e('Index', 'relevanssi');
    ?>
</th>
			<th><?php 
    _e('Public?', 'relevanssi');
    ?>
</th>
		</tr>
	</thead>
	<?php 
    $pt_1 = get_post_types(array('exclude_from_search' => '0'));
    $pt_2 = get_post_types(array('exclude_from_search' => false));
    $public_types = array_merge($pt_1, $pt_2);
    $post_types = get_post_types();
    foreach ($post_types as $type) {
        if ('nav_menu_item' == $type) {
            continue;
        }
        if ('revision' == $type) {
            continue;
        }
        if (in_array($type, $index_post_types)) {
            $checked = 'checked="checked"';
        } else {
            $checked = '';
        }
        $label = sprintf(__("%s", 'relevanssi'), $type);
        in_array($type, $public_types) ? $public = __('yes', 'relevanssi') : ($public = __('no', 'relevanssi'));
        echo <<<EOH
\t<tr>
\t\t<td>
\t\t\t{$label} 
\t\t</td>
\t\t<td>
\t\t\t<input type='checkbox' name='relevanssi_index_type_{$type}' id='relevanssi_index_type_{$type}' {$checked} />
\t\t</td>
\t\t<td>
\t\t\t{$public}
\t\t</td>
\t</tr>
EOH;
    }
    ?>
	</table>
	
	<br /><br />

	<p><?php 
    _e('Choose taxonomies to index:', 'relevanssi');
    ?>
</p>
	
	<table class="widefat" id="custom_taxonomies_table">
	<thead>
		<tr>
			<th><?php 
    _e('Taxonomy', 'relevanssi');
    ?>
</th>
			<th><?php 
    _e('Index', 'relevanssi');
    ?>
</th>
			<th><?php 
    _e('Public?', 'relevanssi');
    ?>
</th>
		</tr>
	</thead>
	<?php 
    $taxos = get_taxonomies('', 'objects');
    foreach ($taxos as $taxonomy) {
        if ($taxonomy->name == 'nav_menu') {
            continue;
        }
        if ($taxonomy->name == 'link_category') {
            continue;
        }
        if (in_array($taxonomy->name, $index_taxonomies_list)) {
            $checked = 'checked="checked"';
        } else {
            $checked = '';
        }
        $label = sprintf(__("%s", 'relevanssi'), $taxonomy->name);
        $taxonomy->public ? $public = __('yes', 'relevanssi') : ($public = __('no', 'relevanssi'));
        $type = $taxonomy->name;
        echo <<<EOH
\t<tr>
\t\t<td>
\t\t\t{$label} 
\t\t</td>
\t\t<td>
\t\t\t<input type='checkbox' name='relevanssi_index_taxonomy_{$type}' id='relevanssi_index_taxonomy_{$type}' {$checked} />
\t\t</td>
\t\t<td>
\t\t\t{$public}
\t\t</td>
\t</tr>
EOH;
    }
    ?>
	</table>
	
	<p><?php 
    _e('If you check a taxonomy here, the terms for that taxonomy are indexed with the posts. If you for example choose "post_tag", searching for tags will find all posts that have the tag.', 'relevanssi');
    ?>
	
	<br /><br />
		
	<label for='relevanssi_min_word_length'><?php 
    _e("Minimum word length to index", "relevanssi");
    ?>
:
	<input type='text' name='relevanssi_min_word_length' id='relevanssi_min_word_length' size='30' value='<?php 
    echo esc_attr($min_word_length);
    ?>
' /></label><br />
	<small><?php 
    _e("Words shorter than this number will not be indexed.", "relevanssi");
    ?>
</small>

	<br /><br />

	<?php 
    if (function_exists('relevanssi_form_thousep')) {
        relevanssi_form_thousep($thousand_separator);
    }
    ?>

	<label for='relevanssi_expand_shortcodes'><?php 
    _e("Expand shortcodes in post content:", "relevanssi");
    ?>
	<input type='checkbox' name='relevanssi_expand_shortcodes' id='relevanssi_expand_shortcodes' <?php 
    echo $expand_shortcodes;
    ?>
 /></label><br />
	<small><?php 
    _e("If checked, Relevanssi will expand shortcodes in post content before indexing. Otherwise shortcodes will be stripped. If you use shortcodes to include dynamic content, Relevanssi will not keep the index updated, the index will reflect the status of the shortcode content at the moment of indexing.", "relevanssi");
    ?>
</small>

	<br /><br />

<?php 
    if (function_exists('relevanssi_form_disable_shortcodes')) {
        relevanssi_form_disable_shortcodes($disable_shortcodes);
    }
    ?>

	<label for='relevanssi_index_author'><?php 
    _e('Index and search your posts\' authors:', 'relevanssi');
    ?>
	<input type='checkbox' name='relevanssi_index_author' id='relevanssi_index_author' <?php 
    echo $index_author;
    ?>
 /></label><br />
	<small><?php 
    _e("If checked, Relevanssi will also index and search the authors of your posts. Author display name will be indexed. Remember to rebuild the index if you change this option!", 'relevanssi');
    ?>
</small>

	<br /><br />

	<label for='relevanssi_index_excerpt'><?php 
    _e('Index and search post excerpts:', 'relevanssi');
    ?>
	<input type='checkbox' name='relevanssi_index_excerpt' id='relevanssi_index_excerpt' <?php 
    echo $index_excerpt;
    ?>
 /></label><br />
	<small><?php 
    _e("If checked, Relevanssi will also index and search the excerpts of your posts.Remember to rebuild the index if you change this option!", 'relevanssi');
    ?>
</small>

	<br /><br />
	
	<label for='relevanssi_index_comments'><?php 
    _e("Index and search these comments:", "relevanssi");
    ?>
	<select name='relevanssi_index_comments' id='relevanssi_index_comments'>
	<option value='none' <?php 
    echo $incom_type_none;
    ?>
><?php 
    _e("none", "relevanssi");
    ?>
</option>
	<option value='normal' <?php 
    echo $incom_type_normal;
    ?>
><?php 
    _e("normal", "relevanssi");
    ?>
</option>
	<option value='all' <?php 
    echo $incom_type_all;
    ?>
><?php 
    _e("all", "relevanssi");
    ?>
</option>
	</select></label><br />
	<small><?php 
    _e("Relevanssi will index and search ALL (all comments including track- &amp; pingbacks and custom comment types), NONE (no comments) or NORMAL (manually posted comments on your blog).<br />Remember to rebuild the index if you change this option!", 'relevanssi');
    ?>
</small>

	<br /><br />

	<label for='relevanssi_index_fields'><?php 
    _e("Custom fields to index:", "relevanssi");
    ?>
	<input type='text' name='relevanssi_index_fields' id='relevanssi_index_fields' size='30' value='<?php 
    echo esc_attr($index_fields);
    ?>
' /></label><br />
	<small><?php 
    _e("A comma-separated list of custom fields to include in the index. Set to 'visible' to index all visible custom fields and to 'all' to index all custom fields, also those starting with a '_' character.", "relevanssi");
    ?>
</small>

	<br /><br />

<?php 
    if (function_exists('relevanssi_form_mysql_columns')) {
        relevanssi_form_mysql_columns($mysql_columns);
    }
    ?>

<?php 
    if (function_exists('relevanssi_form_index_users')) {
        relevanssi_form_index_users($index_users, $index_subscribers, $index_user_fields);
    }
    ?>

<?php 
    if (function_exists('relevanssi_form_index_taxonomies')) {
        relevanssi_form_index_taxonomies($index_taxonomies, $index_terms);
    }
    ?>

	<input type='submit' name='index' value='<?php 
    esc_attr(_e("Save indexing options, erase index and rebuild the index", 'relevanssi'));
    ?>
' class='button button-primary' />

	<input type='submit' name='index_extend' value='<?php 
    esc_attr(_e("Continue indexing", 'relevanssi'));
    ?>
' class='button' />

	<h3 id="synonyms"><?php 
    _e("Synonyms", "relevanssi");
    ?>
</h3>
	
	<p><textarea name='relevanssi_synonyms' id='relevanssi_synonyms' rows='9' cols='60'><?php 
    echo htmlspecialchars($synonyms);
    ?>
</textarea></p>

	<p><small><?php 
    _e("Add synonyms here in 'key = value' format. When searching with the OR operator, any search of 'key' will be expanded to include 'value' as well. Using phrases is possible. The key-value pairs work in one direction only, but you can of course repeat the same pair reversed.", "relevanssi");
    ?>
</small></p>

<?php 
    if (function_exists('relevanssi_form_index_synonyms')) {
        relevanssi_form_index_synonyms($index_synonyms);
    }
    ?>
	

	<input type='submit' name='submit' value='<?php 
    esc_attr(_e('Save the options', 'relevanssi'));
    ?>
' class='button' />

	<h3 id="stopwords"><?php 
    _e("Stopwords", "relevanssi");
    ?>
</h3>
	
	<?php 
    relevanssi_show_stopwords();
    ?>

<?php 
    if (function_exists('relevanssi_form_importexport')) {
        relevanssi_form_importexport($serialized_options);
    }
    ?>
	
	
	</form>
</div>

	<?php 
    relevanssi_sidebar();
}
Ejemplo n.º 2
0
function relevanssi_options_form() {
	global $title_boost_default, $tag_boost_default, $comment_boost_default, $wpdb, $relevanssi_table;
	
	wp_enqueue_style('dashboard');
	wp_print_styles('dashboard');
	wp_enqueue_script('dashboard');
	wp_print_scripts('dashboard');
	
	$docs_count = $wpdb->get_var("SELECT COUNT(DISTINCT doc) FROM $relevanssi_table");
	$biggest_doc = $wpdb->get_var("SELECT doc FROM $relevanssi_table ORDER BY doc DESC LIMIT 1");
	
	$title_boost = get_option('relevanssi_title_boost');
	$tag_boost = get_option('relevanssi_tag_boost');
	$comment_boost = get_option('relevanssi_comment_boost');
	$admin_search = get_option('relevanssi_admin_search');
	if ('on' == $admin_search) {
		$admin_search = 'checked="checked"';
	}
	else {
		$admin_search = '';
	}

	$index_limit = get_option('relevanssi_index_limit');

	$excerpts = get_option('relevanssi_excerpts');
	if ('on' == $excerpts) {
		$excerpts = 'checked="checked"';
	}
	else {
		$excerpts = '';
	}
	
	$excerpt_length = get_option('relevanssi_excerpt_length');
	$excerpt_type = get_option('relevanssi_excerpt_type');
	$excerpt_chars = "";
	$excerpt_words = "";
	switch ($excerpt_type) {
		case "chars":
			$excerpt_chars = 'selected="selected"';
			break;
		case "words":
			$excerpt_words = 'selected="selected"';
			break;
	}

	$log_queries = ('on' == get_option('relevanssi_log_queries') ? 'checked="checked"' : '');
	
	$highlight = get_option('relevanssi_highlight');
	$highlight_none = "";
	$highlight_em = "";
	$highlight_strong = "";
	$highlight_col = "";
	$highlight_bgcol = "";
	$highlight_style = "";
	$highlight_class = "";
	switch ($highlight) {
		case "no":
			$highlight_none = 'selected="selected"';
			break;
		case "mark":
			$highlight_em = 'selected="selected"';
			break;
		case "em":
			$highlight_em = 'selected="selected"';
			break;
		case "strong":
			$highlight_strong = 'selected="selected"';
			break;
		case "col":
			$highlight_col = 'selected="selected"';
			break;
		case "bgcol":
			$highlight_bgcol = 'selected="selected"';
			break;
		case "css":
			$highlight_style = 'selected="selected"';
			break;
		case "class":
			$highlight_class = 'selected="selected"';
			break;
	}

	$index_type = get_option('relevanssi_index_type');
	$index_type_posts = "";
	$index_type_pages = "";
	$index_type_public = "";
	$index_type_both = "";
	switch ($index_type) {
		case "posts":
			$index_type_posts = 'selected="selected"';
			break;
		case "pages":
			$index_type_pages = 'selected="selected"';
			break;
		case "public":
			$index_type_public = 'selected="selected"';
			break;
		case "both":
			$index_type_both = 'selected="selected"';
			break;
	}
	
	$custom_types = get_option('relevanssi_custom_types');
	$custom_taxonomies = get_option('relevanssi_custom_taxonomies');
	$index_fields = get_option('relevanssi_index_fields');
	
	$txt_col = get_option('relevanssi_txt_col');
	$bg_col = get_option('relevanssi_bg_col');
	$css = get_option('relevanssi_css');
	$class = get_option('relevanssi_class');
	
	$cat = get_option('relevanssi_cat');
	$excat = get_option('relevanssi_excat');
	
	$fuzzy_sometimes = ('sometimes' == get_option('relevanssi_fuzzy') ? 'selected="selected"' : '');
	$fuzzy_always = ('always' == get_option('relevanssi_fuzzy') ? 'selected="selected"' : '');
	$fuzzy_never = ('never' == get_option('relevanssi_fuzzy') ? 'selected="selected"' : '');

	$implicit_and = ('AND' == get_option('relevanssi_implicit_operator') ? 'selected="selected"' : '');
	$implicit_or = ('OR' == get_option('relevanssi_implicit_operator') ? 'selected="selected"' : '');

	$expand_shortcodes = ('on' == get_option('relevanssi_expand_shortcodes') ? 'checked="checked"' : '');
	$disablefallback = ('on' == get_option('relevanssi_disable_or_fallback') ? 'checked="checked"' : '');

	$omit_from_logs	= get_option('relevanssi_omit_from_logs');
	
	$synonyms = get_option('relevanssi_synonyms');
	isset($synonyms) ? $synonyms = str_replace(';', "\n", $synonyms) : $synonyms = "";
	
	//Added by OdditY ->
	$expst = get_option('relevanssi_exclude_posts'); 
	$inctags = ('on' == get_option('relevanssi_include_tags') ? 'checked="checked"' : ''); 
	$hititle = ('on' == get_option('relevanssi_hilite_title') ? 'checked="checked"' : ''); 
	$incom_type = get_option('relevanssi_index_comments');
	$incom_type_all = "";
	$incom_type_normal = "";
	$incom_type_none = "";
	switch ($incom_type) {
		case "all":
			$incom_type_all = 'selected="selected"';
			break;
		case "normal":
			$incom_type_normal = 'selected="selected"';
			break;
		case "none":
			$incom_type_none = 'selected="selected"';
			break;
	}//added by OdditY END <-

	$highlight_docs = ('on' == get_option('relevanssi_highlight_docs') ? 'checked="checked"' : ''); 
	$highlight_coms = ('on' == get_option('relevanssi_highlight_comments') ? 'checked="checked"' : ''); 

	$attachments = ('on' == get_option('relevanssi_index_attachments') ? 'checked="checked"' : ''); 
	
	$inccats = ('on' == get_option('relevanssi_include_cats') ? 'checked="checked"' : ''); 
	$index_author = ('on' == get_option('relevanssi_index_author') ? 'checked="checked"' : ''); 
	$index_excerpt = ('on' == get_option('relevanssi_index_excerpt') ? 'checked="checked"' : ''); 
	
	$show_matches = ('on' == get_option('relevanssi_show_matches') ? 'checked="checked"' : '');
	$show_matches_text = stripslashes(get_option('relevanssi_show_matches_text'));
	
?>
<div class='postbox-container' style='width:70%;'>
	<form method='post'>

    <p><a href="#basic"><?php _e("Basic options", "relevanssi"); ?></a> |
	<a href="#logs"><?php _e("Logs", "relevanssi"); ?></a> |
    <a href="#exclusions"><?php _e("Exclusions and restrictions", "relevanssi"); ?></a> |
    <a href="#excerpts"><?php _e("Custom excerpts", "relevanssi"); ?></a> |
    <a href="#highlighting"><?php _e("Highlighting search results", "relevanssi"); ?></a> |
    <a href="#indexing"><?php _e("Indexing options", "relevanssi"); ?></a> |
    <a href="#synonyms"><?php _e("Synonyms", "relevanssi"); ?></a> |
    <a href="#stopwords"><?php _e("Stopwords", "relevanssi"); ?></a> |
    <a href="#uninstall"><?php _e("Uninstalling", "relevanssi"); ?></a>
    </p>

	<h3><?php _e('Quick tools', 'relevanssi') ?></h3>
	<p>
	<input type='submit' name='submit' value='<?php _e('Save options', 'relevanssi'); ?>' style="background-color:#007f00; border-color:#5fbf00; border-style:solid; border-width:thick; padding: 5px; color: #fff;" />
	<input type="submit" name="index" value="<?php _e('Build the index', 'relevanssi') ?>" style="background-color:#007f00; border-color:#5fbf00; border-style:solid; border-width:thick; padding: 5px; color: #fff;" />
	<input type="submit" name="index_extend" value="<?php _e('Continue indexing', 'relevanssi') ?>"  style="background-color:#e87000; border-color:#ffbb00; border-style:solid; border-width:thick; padding: 5px; color: #fff;" />, <?php _e('add', 'relevanssi'); ?> <input type="text" size="4" name="relevanssi_index_limit" value="<?php echo $index_limit ?>" /> <?php _e('documents.', 'relevanssi'); ?></p>

	<p><?php _e("Use 'Build the index' to build the index with current <a href='#indexing'>indexing options</a>. If you can't finish indexing with one go, use 'Continue indexing' to finish the job. You can change the number of documents to add until you find the largest amount you can add with one go. See 'State of the Index' below to find out how many documents actually go into the index.", 'relevanssi') ?></p>
	
	<h3><?php _e("State of the Index", "relevanssi"); ?></h3>
	<p>
	<?php _e("Documents in the index", "relevanssi"); ?>: <strong><?php echo $docs_count ?></strong><br />
	<?php _e("Highest post ID indexed", "relevanssi"); ?>: <strong><?php echo $biggest_doc ?></strong>
	</p>
	
	<h3 id="basic"><?php _e("Basic options", "relevanssi"); ?></h3>
	<label for='relevanssi_title_boost'><?php _e('Title boost:', 'relevanssi'); ?> 
	<input type='text' name='relevanssi_title_boost' size='4' value='<?php echo $title_boost ?>' /></label>
	<small><?php printf(__('Default: %d. 0 means titles are ignored, 1 means no boost, more than 1 gives extra value.', 'relevanssi'), $title_boost_default); ?></small>
	<br />
	<label for='relevanssi_tag_boost'><?php _e('Tag boost:', 'relevanssi'); ?> 
	<input type='text' name='relevanssi_tag_boost' size='4' value='<?php echo $tag_boost ?>' /></label>
	<small><?php printf(__('Default: %d. 0 means tags are ignored, 1 means no boost, more than 1 gives extra value.', 'relevanssi'), $tag_boost_default); ?></small>
	<br />
	<label for='relevanssi_comment_boost'><?php _e('Comment boost:', 'relevanssi'); ?> 
	<input type='text' name='relevanssi_comment_boost' size='4' value='<?php echo $comment_boost ?>' /></label>
	<small><?php printf(__('Default: %d. 0 means comments are ignored, 1 means no boost, more than 1 gives extra value.', 'relevanssi'), $comment_boost_default); ?></small>
	<br /><br />
	<label for='relevanssi_admin_search'><?php _e('Use search for admin:', 'relevanssi'); ?>
	<input type='checkbox' name='relevanssi_admin_search' <?php echo $admin_search ?> /></label>
	<small><?php _e('If checked, Relevanssi will be used for searches in the admin interface', 'relevanssi'); ?></small>

	<br /><br />

	<label for='relevanssi_implicit_operator'><?php _e("Default operator for the search?", "relevanssi"); ?>
	<select name='relevanssi_implicit_operator'>
	<option value='AND' <?php echo $implicit_and ?>><?php _e("AND - require all terms", "relevanssi"); ?></option>
	<option value='OR' <?php echo $implicit_or ?>><?php _e("OR - any term present is enough", "relevanssi"); ?></option>
	</select></label><br />
	<small><?php _e("If you choose AND and the search finds no matches, it will automatically do an OR search.", "relevanssi"); ?></small>
	
	<br /><br />

	<label for='relevanssi_disable_or_fallback'><?php _e("Disable OR fallback:", "relevanssi"); ?>
	<input type='checkbox' name='relevanssi_disable_or_fallback' <?php echo $disablefallback ?> /></label>
	<small><?php _e("If you don't want Relevanssi to fall back to OR search when AND search gets no hits, check this option. For most cases, leave this one unchecked.", 'relevanssi'); ?></small>

	<br /><br />

	<label for='relevanssi_fuzzy'><?php _e('When to use fuzzy matching?', 'relevanssi'); ?>
	<select name='relevanssi_fuzzy'>
	<option value='sometimes' <?php echo $fuzzy_sometimes ?>><?php _e("When straight search gets no hits", "relevanssi"); ?></option>
	<option value='always' <?php echo $fuzzy_always ?>><?php _e("Always", "relevanssi"); ?></option>
	<option value='never' <?php echo $fuzzy_never ?>><?php _e("Don't use fuzzy search", "relevanssi"); ?></option>
	</select></label><br />
	<small><?php _e("Straight search matches just the term. Fuzzy search matches everything that begins or ends with the search term.", "relevanssi"); ?></small>

	<h3 id="logs"><?php _e('Logs', 'relevanssi'); ?></h3>
	
	<label for='relevanssi_log_queries'><?php _e("Keep a log of user queries:", "relevanssi"); ?>
	<input type='checkbox' name='relevanssi_log_queries' <?php echo $log_queries ?> /></label>
	<small><?php _e("If checked, Relevanssi will log user queries. The log appears in 'User searches' on the Dashboard admin menu.", 'relevanssi'); ?></small>

	<br /><br />

	<label for='relevanssi_omit_from_logs'><?php _e("Don't log queries from these users:", "relevanssi"); ?>
	<input type='text' name='relevanssi_omit_from_logs' size='20' value='<?php echo $omit_from_logs ?>' /></label>
	<small><?php _e("Comma-separated list of user ids that will not be logged.", "relevanssi"); ?></small>

	<p><?php _e("If you enable logs, you can see what your users are searching for. Logs are also needed to use the 'Did you mean?' feature. You can prevent your own searches from getting in the logs with the omit feature.", "relevanssi"); ?></p>

	<h3 id="exclusions"><?php _e("Exclusions and restrictions", "relevanssi"); ?></h3>
	
	<label for='relevanssi_cat'><?php _e('Restrict search to these categories and tags:', 'relevanssi'); ?>
	<input type='text' name='relevanssi_cat' size='20' value='<?php echo $cat ?>' /></label><br />
	<small><?php _e("Enter a comma-separated list of category and tag IDs to restrict search to those categories or tags. You can also use <code>&lt;input type='hidden' name='cat' value='list of cats and tags' /&gt;</code> in your search form. The input field will 	overrun this setting.", 'relevanssi'); ?></small>

	<br /><br />

	<label for='relevanssi_excat'><?php _e('Exclude these categories and tags from search:', 'relevanssi'); ?>
	<input type='text' name='relevanssi_excat' size='20' value='<?php echo $excat ?>' /></label><br />
	<small><?php _e("Enter a comma-separated list of category and tag IDs that are excluded from search results. This only works here, you can't use the input field option (WordPress doesn't pass custom parameters there).", 'relevanssi'); ?></small>

	<br /><br />

	<label for='relevanssi_excat'><?php _e('Exclude these posts/pages from search:', 'relevanssi'); ?>
	<input type='text' name='relevanssi_expst' size='20' value='<?php echo $expst ?>' /></label><br />
	<small><?php _e("Enter a comma-separated list of post/page IDs that are excluded from search results. This only works here, you can't use the input field option (WordPress doesn't pass custom parameters there).", 'relevanssi'); ?></small>

	<h3 id="excerpts"><?php _e("Custom excerpts/snippets", "relevanssi"); ?></h3>
	
	<label for='relevanssi_excerpts'><?php _e("Create custom search result snippets:", "relevanssi"); ?>
	<input type='checkbox' name='relevanssi_excerpts' <?php echo $excerpts ?> /></label><br />
	<small><?php _e("If checked, Relevanssi will create excerpts that contain the search term hits. To make them work, make sure your search result template uses the_excerpt() to display post excerpts.", 'relevanssi'); ?></small>
	
	<br /><br />
	
	<label for='relevanssi_excerpt_length'><?php _e("Length of the snippet:", "relevanssi"); ?>
	<input type='text' name='relevanssi_excerpt_length' size='4' value='<?php echo $excerpt_length ?>' /></label>
	<select name='relevanssi_excerpt_type'>
	<option value='chars' <?php echo $excerpt_chars ?>><?php _e("characters", "relevanssi"); ?></option>
	<option value='words' <?php echo $excerpt_words ?>><?php _e("words", "relevanssi"); ?></option>
	</select><br />
	<small><?php _e("This must be an integer.", "relevanssi"); ?></small>

	<br /><br />

	<label for='relevanssi_show_matches'><?php _e("Show breakdown of search hits in excerpts:", "relevanssi"); ?>
	<input type='checkbox' name='relevanssi_show_matches' <?php echo $show_matches ?> /></label>
	<small><?php _e("Check this to show more information on where the search hits were made. Requires custom snippets to work.", "relevanssi"); ?></small>

	<br /><br />

	<label for='relevanssi_show_matches_text'><?php _e("The breakdown format:", "relevanssi"); ?>
	<input type='text' name='relevanssi_show_matches_text' value="<?php echo $show_matches_text ?>" size='20' /></label>
	<small><?php _e("Use %body%, %title%, %tags% and %comments% to display the number of hits (in different parts of the post), %total% for total hits, %score% to display the document weight and %terms% to show how many hits each search term got. No double quotes (\") allowed!", "relevanssi"); ?></small>

	<h3 id="highlighting"><?php _e("Search hit highlighting", "relevanssi"); ?></h3>

	<?php _e("First, choose the type of highlighting used:", "relevanssi"); ?><br />

	<div style='margin-left: 2em'>
	<label for='relevanssi_highlight'><?php _e("Highlight query terms in search results:", 'relevanssi'); ?>
	<select name='relevanssi_highlight'>
	<option value='no' <?php echo $highlight_none ?>><?php _e('No highlighting', 'relevanssi'); ?></option>
	<option value='mark' <?php echo $highlight_em ?>>&lt;mark&gt;</option>
	<option value='em' <?php echo $highlight_em ?>>&lt;em&gt;</option>
	<option value='strong' <?php echo $highlight_strong ?>>&lt;strong&gt;</option>
	<option value='col' <?php echo $highlight_col ?>><?php _e('Text color', 'relevanssi'); ?></option>
	<option value='bgcol' <?php echo $highlight_bgcol ?>><?php _e('Background color', 'relevanssi'); ?></option>
	<option value='css' <?php echo $highlight_style ?>><?php _e("CSS Style", 'relevanssi'); ?></option>
	<option value='class' <?php echo $highlight_class ?>><?php _e("CSS Class", 'relevanssi'); ?></option>
	</select></label>
	<small><?php _e("Highlighting isn't available unless you use custom snippets", 'relevanssi'); ?></small>
	
	<br />

	<label for='relevanssi_hilite_title'><?php _e("Highlight query terms in result titles too:", 'relevanssi'); ?>
	<input type='checkbox' name='relevanssi_hilite_title' <?php echo $hititle ?> /></label>
	<small><?php _e("", 'relevanssi'); ?></small>

	<br />

	<label for='relevanssi_highlight_docs'><?php _e("Highlight query terms in documents:", 'relevanssi'); ?>
	<input type='checkbox' name='relevanssi_highlight_docs' <?php echo $highlight_docs ?> /></label>
	<small><?php _e("Highlights hits when user opens the post from search results. This is based on HTTP referrer, so if that's blocked, there'll be no highlights.", "relevanssi"); ?></small>

	<br />
	
	<label for='relevanssi_highlight_comments'><?php _e("Highlight query terms in comments:", 'relevanssi'); ?>
	<input type='checkbox' name='relevanssi_highlight_comments' <?php echo $highlight_coms ?> /></label>
	<small><?php _e("Highlights hits in comments when user opens the post from search results.", "relevanssi"); ?></small>

	<br /><br />
	</div>
	
	<?php _e("Then adjust the settings for your chosen type:", "relevanssi"); ?><br />

	<div style='margin-left: 2em'>
	
	<label for='relevanssi_txt_col'><?php _e("Text color for highlights:", "relevanssi"); ?>
	<input type='text' name='relevanssi_txt_col' size='7' value='<?php echo $txt_col ?>' /></label>
	<small><?php _e("Use HTML color codes (#rgb or #rrggbb)", "relevanssi"); ?></small>

	<br />
	
	<label for='relevanssi_bg_col'><?php _e("Background color for highlights:", "relevanssi"); ?>
	<input type='text' name='relevanssi_bg_col' size='7' value='<?php echo $bg_col ?>' /></label>
	<small><?php _e("Use HTML color codes (#rgb or #rrggbb)", "relevanssi"); ?></small>

	<br />
	
	<label for='relevanssi_css'><?php _e("CSS style for highlights:", "relevanssi"); ?>
	<input type='text' name='relevanssi_css' size='30' value='<?php echo $css ?>' /></label>
	<small><?php _e("You can use any CSS styling here, style will be inserted with a &lt;span&gt;", "relevanssi"); ?></small>

	<br />
	
	<label for='relevanssi_css'><?php _e("CSS class for highlights:", "relevanssi"); ?>
	<input type='text' name='relevanssi_class' size='10' value='<?php echo $class ?>' /></label>
	<small><?php _e("Name a class here, search results will be wrapped in a &lt;span&gt; with the class", "relevanssi"); ?></small>

	</div>
	
	<br />
	<br />
	
	<input type='submit' name='submit' value='<?php _e('Save the options', 'relevanssi'); ?>' />

	<h3 id="indexing"><?php _e('Indexing options', 'relevanssi'); ?></h3>
	
	<label for='relevanssi_index_type'><?php _e("What to include in the index", "relevanssi"); ?>:
	<select name='relevanssi_index_type'>
	<option value='both' <?php echo $index_type_both ?>><?php _e("Everything", "relevanssi"); ?></option>
	<option value='public' <?php echo $index_type_public ?>><?php _e("All public post types", "relevanssi"); ?></option>
	<option value='posts' <?php echo $index_type_posts ?>><?php _e("Just posts", "relevanssi"); ?></option>
	<option value='pages' <?php echo $index_type_pages ?>><?php _e("Just pages", "relevanssi"); ?></option>
	</select></label><br />
	<small><?php _e("This determines which post types are included in the index. Choosing 'everything' will include posts, pages and all custom post types. 'All public post types' includes all registered post types that don't have the 'exclude_from_search' set to true. This includes post, page, and possible custom types. 'All public types' requires at least WP 2.9, otherwise it's the same as 'everything'. Note: attachments are covered with a separate option below.", "relevanssi"); ?></small>

	<br /><br />
	
	<label for='relevanssi_custom_types'><?php _e("Custom post types to index", "relevanssi"); ?>:
	<input type='text' name='relevanssi_custom_types' size='30' value='<?php echo $custom_types ?>' /></label><br />
	<small><?php _e("If you don't want to index all custom post types, list here the custom post types you want to see indexed. List comma-separated post type names (as used in the database). You can also use a hidden field in the search form to restrict the search to a certain post type: <code>&lt;input type='hidden' name='post_type' value='comma-separated list of post types' /&gt;</code>. If you choose 'All public post types' or 'Everything' above, this option has no effect. You can exclude custom post types with the minus notation, for example '-foo,bar,-baz' would include 'bar' and exclude 'foo' and 'baz'.", "relevanssi"); ?></small>

	<br /><br />

	<label for='relevanssi_index_attachments'><?php _e('Index and search your posts\' attachments:', 'relevanssi'); ?>
	<input type='checkbox' name='relevanssi_index_attachments' <?php echo $attachments ?> /></label><br />
	<small><?php _e("If checked, Relevanssi will also index and search attachments of your posts (pictures, files and so on). Remember to rebuild the index if you change this option!", 'relevanssi'); ?></small>

	<br /><br />

	<label for='relevanssi_expand_shortcodes'><?php _e("Expand shortcodes in post content:", "relevanssi"); ?>
	<input type='checkbox' name='relevanssi_expand_shortcodes' <?php echo $expand_shortcodes ?> /></label><br />
	<small><?php _e("If checked, Relevanssi will expand shortcodes in post content before indexing. Otherwise shortcodes will be stripped. If you use shortcodes to include dynamic content, Relevanssi will not keep the index updated, the index will reflect the status of the shortcode content at the moment of indexing.", "relevanssi"); ?></small>

	<br /><br />

	<label for='relevanssi_inctags'><?php _e('Index and search your posts\' tags:', 'relevanssi'); ?>
	<input type='checkbox' name='relevanssi_inctags' <?php echo $inctags ?> /></label><br />
	<small><?php _e("If checked, Relevanssi will also index and search the tags of your posts. Remember to rebuild the index if you change this option!", 'relevanssi'); ?></small>

	<br /><br />

	<label for='relevanssi_inccats'><?php _e('Index and search your posts\' categories:', 'relevanssi'); ?>
	<input type='checkbox' name='relevanssi_inccats' <?php echo $inccats ?> /></label><br />
	<small><?php _e("If checked, Relevanssi will also index and search the categories of your posts. Category titles will pass through 'single_cat_title' filter. Remember to rebuild the index if you change this option!", 'relevanssi'); ?></small>

	<br /><br />

	<label for='relevanssi_index_author'><?php _e('Index and search your posts\' authors:', 'relevanssi'); ?>
	<input type='checkbox' name='relevanssi_index_author' <?php echo $index_author ?> /></label><br />
	<small><?php _e("If checked, Relevanssi will also index and search the authors of your posts. Author display name will be indexed. Remember to rebuild the index if you change this option!", 'relevanssi'); ?></small>

	<br /><br />

	<label for='relevanssi_index_excerpt'><?php _e('Index and search post excerpts:', 'relevanssi'); ?>
	<input type='checkbox' name='relevanssi_index_excerpt' <?php echo $index_excerpt ?> /></label><br />
	<small><?php _e("If checked, Relevanssi will also index and search the excerpts of your posts.Remember to rebuild the index if you change this option!", 'relevanssi'); ?></small>

	<br /><br />
	
	<label for='relevanssi_index_comments'><?php _e("Index and search these comments:", "relevanssi"); ?>
	<select name='relevanssi_index_comments'>
	<option value='none' <?php echo $incom_type_none ?>><?php _e("none", "relevanssi"); ?></option>
	<option value='normal' <?php echo $incom_type_normal ?>><?php _e("normal", "relevanssi"); ?></option>
	<option value='all' <?php echo $incom_type_all ?>><?php _e("all", "relevanssi"); ?></option>
	</select></label><br />
	<small><?php _e("Relevanssi will index and search ALL (all comments including track- &amp; pingbacks and custom comment types), NONE (no comments) or NORMAL (manually posted comments on your blog).<br />Remember to rebuild the index if you change this option!", 'relevanssi'); ?></small>

	<br /><br />

	<label for='relevanssi_index_fields'><?php _e("Custom fields to index:", "relevanssi"); ?>
	<input type='text' name='relevanssi_index_fields' size='30' value='<?php echo $index_fields ?>' /></label><br />
	<small><?php _e("A comma-separated list of custom field names to include in the index.", "relevanssi"); ?></small>

	<br /><br />

	<label for='relevanssi_custom_taxonomies'><?php _e("Custom taxonomies to index:", "relevanssi"); ?>
	<input type='text' name='relevanssi_custom_taxonomies' size='30' value='<?php echo $custom_taxonomies ?>' /></label><br />
	<small><?php _e("A comma-separated list of custom taxonomies to include in the index.", "relevanssi"); ?></small>

	<br /><br />

	<input type='submit' name='index' value='<?php _e("Save indexing options and build the index", 'relevanssi'); ?>' />

	<input type='submit' name='index_extend' value='<?php _e("Continue indexing", 'relevanssi'); ?>' />

	<h3 id="synonyms"><?php _e("Synonyms", "relevanssi"); ?></h3>
	
	<p><textarea name='relevanssi_synonyms' rows='9' cols='60'><?php echo $synonyms ?></textarea></p>

	<p><small><?php _e("Add synonyms here in 'key = value' format. When searching with the OR operator, any search of 'key' will be expanded to include 'value' as well. Using phrases is possible. The key-value pairs work in one direction only, but you can of course repeat the same pair reversed.", "relevanssi"); ?></small></p>

	<input type='submit' name='submit' value='<?php _e('Save the options', 'relevanssi'); ?>' />

	<h3 id="stopwords"><?php _e("Stopwords", "relevanssi"); ?></h3>
	
	<?php relevanssi_show_stopwords(); ?>
	
	<h3 id="uninstall"><?php _e("Uninstalling the plugin", "relevanssi"); ?></h3>
	
	<p><?php _e("If you want to uninstall the plugin, start by clicking the button below to wipe clean the options and tables created by the plugin, then remove it from the plugins list.", "relevanssi");	 ?></p>
	
	<input type='submit' name='uninstall' value='<?php _e("Remove plugin data", "relevanssi"); ?>' />

	</form>
</div>

	<?php

	relevanssi_sidebar();
}