Plugin Directory

Changeset 919904


Ignore:
Timestamp:
05/23/2014 11:33:31 AM (12 years ago)
Author:
naveenann
Message:
  • Fix taxonomy display issue.
  • Only Selected content type will be autoindexed.
Location:
opensearchserver-search/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • opensearchserver-search/trunk/index.php

    r919453 r919904  
    160160  delete_option('oss_log_ip');
    161161  delete_option('oss_display_category');
     162  delete_option('oss_enable_autoindexation');
    162163  $taxonomies=get_taxonomies('','names');
    163164    foreach ($taxonomies as $taxonomy ) {
     
    183184add_filter("plugin_action_links_$plugin", 'opensearchserver_settings_link');
    184185
     186function is_content_type_allowed($post_type) {
     187    foreach (get_post_types() as $post_type) {
     188      $content_type = 'oss_index_types_'.$post_type;
     189        if(get_option($content_type) == 1) {
     190          return TRUE;
     191        }
     192    }
     193   return FALSE;
     194}
    185195
    186196function opensearchserver_do_while_posting($post_id,$post) {
     
    188198    return;
    189199  }
    190   if ($post->post_type == 'post' || $post->post_type == 'page'
    191     && $post->post_status == 'publish') {
     200  if (is_content_type_allowed($post->post_type) && get_option('oss_enable_autoindexation') == 1 && $post->post_status == 'publish') {
    192201    opensearchserver_reindex_site($post->ID,$post->post_type);
    193202  }
  • opensearchserver-search/trunk/opensearchserver_admin.php

    r919445 r919904  
    601601    $oss_display_user = isset($_POST['oss_display_user']) ? $_POST['oss_display_user'] : NULL;
    602602    update_option('oss_display_user', $oss_display_user);
     603    $oss_display_category = isset($_POST['oss_display_category']) ? $_POST['oss_display_category'] : NULL;
     604    update_option('oss_display_category', $oss_display_category);
    603605    $oss_display_type = isset($_POST['oss_display_type']) ? $_POST['oss_display_type'] : NULL;
    604606    update_option('oss_display_type', $oss_display_type);
     
    607609    $oss_display_use_radio_buttons = isset($_POST['oss_display_use_radio_buttons']) ? $_POST['oss_display_use_radio_buttons'] : NULL;
    608610    update_option('oss_display_use_radio_buttons', $oss_display_use_radio_buttons);
    609       $oss_sort_timestamp = isset($_POST['oss_sort_timestamp']) ? $_POST['oss_sort_timestamp'] : NULL;
     611    $oss_sort_timestamp = isset($_POST['oss_sort_timestamp']) ? $_POST['oss_sort_timestamp'] : NULL;
    610612    update_option('oss_sort_timestamp', $oss_sort_timestamp);
    611613    $oss_clean_query = isset($_POST['oss_clean_query']) ? $_POST['oss_clean_query'] : NULL;
     
    617619    $oss_log_ip = isset($_POST['oss_log_ip']) ? $_POST['oss_log_ip'] : NULL;
    618620    update_option('oss_log_ip', $oss_log_ip);
    619 
    620621    $oss_taxonomy_display = isset($_POST['oss_taxonomy_display']) ? $_POST['oss_taxonomy_display'] : NULL;
    621622    update_option('oss_taxonomy_display', $oss_taxonomy_display);
    622    
     623
    623624    //some options needs to post changes to OSS
    624625    if(!opensearchserver_is_query_settings_not_automatic() || (isset($_POST['oss_query_settings_post_to_oss']) && $_POST['oss_query_settings_post_to_oss'] == 1)) {
     
    651652        update_option('oss_taxonomy_'.$taxonomy, $check_taxonomy_name);
    652653    }
     654    $oss_enable_autoindexation = isset($_POST['oss_enable_autoindexation']) ? $_POST['oss_enable_autoindexation'] : NULL;
     655    update_option('oss_enable_autoindexation', (int)$oss_enable_autoindexation);
    653656    opensearchserver_display_messages('OpenSearchServer Index Settings have been updated.');
    654657  } else {
     
    10141017                                    <input type="checkbox" name="oss_display_type" id="oss_display_type" value="1" <?php checked( 1 == get_option('oss_display_type')); ?> />&nbsp;
    10151018                                    <label for="oss_display_type">type</label>
    1016                                    <input type="checkbox" name="oss_display_user" id="oss_display_user" value="1" <?php checked( 1 == get_option('oss_display_user')); ?> />
     1019                                    <input type="checkbox" name="oss_display_user" id="oss_display_user" value="1" <?php checked( 1 == get_option('oss_display_user')); ?> />
    10171020                                    <label for="oss_display_user">user</label>&nbsp;&nbsp;
     1021                                    <input type="checkbox" name="oss_display_category" id="oss_display_category" value="1" <?php checked( 1 == get_option('oss_display_category')); ?> />
     1022                                    <label for="oss_display_category">Chosen taxonomy (see list below)</label>
    10181023                                     <br/><span class="help">Choose what kind of information should be displayed below each result.</span>
    10191024                            </p>
     
    10991104                                  ?>
    11001105                              </fieldset>
     1106                      <fieldset>
     1107                         <legend>Auto Indexation </legend>
     1108                         <input type="checkbox" name="oss_enable_autoindexation" id="oss_enable_autoindexation" value="1" <?php checked( 1 == get_option('oss_enable_autoindexation')); ?> />
     1109                         <label for="oss_enable_autoindexation">Enable automatic indexation when content are added, edited or deleted.</label>
     1110                      </fieldset>
    11011111                            </p>
    11021112                           
Note: See TracChangeset for help on using the changeset viewer.