Changeset 919904
- Timestamp:
- 05/23/2014 11:33:31 AM (12 years ago)
- Location:
- opensearchserver-search/trunk
- Files:
-
- 2 edited
-
index.php (modified) (3 diffs)
-
opensearchserver_admin.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
opensearchserver-search/trunk/index.php
r919453 r919904 160 160 delete_option('oss_log_ip'); 161 161 delete_option('oss_display_category'); 162 delete_option('oss_enable_autoindexation'); 162 163 $taxonomies=get_taxonomies('','names'); 163 164 foreach ($taxonomies as $taxonomy ) { … … 183 184 add_filter("plugin_action_links_$plugin", 'opensearchserver_settings_link'); 184 185 186 function 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 } 185 195 186 196 function opensearchserver_do_while_posting($post_id,$post) { … … 188 198 return; 189 199 } 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') { 192 201 opensearchserver_reindex_site($post->ID,$post->post_type); 193 202 } -
opensearchserver-search/trunk/opensearchserver_admin.php
r919445 r919904 601 601 $oss_display_user = isset($_POST['oss_display_user']) ? $_POST['oss_display_user'] : NULL; 602 602 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); 603 605 $oss_display_type = isset($_POST['oss_display_type']) ? $_POST['oss_display_type'] : NULL; 604 606 update_option('oss_display_type', $oss_display_type); … … 607 609 $oss_display_use_radio_buttons = isset($_POST['oss_display_use_radio_buttons']) ? $_POST['oss_display_use_radio_buttons'] : NULL; 608 610 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; 610 612 update_option('oss_sort_timestamp', $oss_sort_timestamp); 611 613 $oss_clean_query = isset($_POST['oss_clean_query']) ? $_POST['oss_clean_query'] : NULL; … … 617 619 $oss_log_ip = isset($_POST['oss_log_ip']) ? $_POST['oss_log_ip'] : NULL; 618 620 update_option('oss_log_ip', $oss_log_ip); 619 620 621 $oss_taxonomy_display = isset($_POST['oss_taxonomy_display']) ? $_POST['oss_taxonomy_display'] : NULL; 621 622 update_option('oss_taxonomy_display', $oss_taxonomy_display); 622 623 623 624 //some options needs to post changes to OSS 624 625 if(!opensearchserver_is_query_settings_not_automatic() || (isset($_POST['oss_query_settings_post_to_oss']) && $_POST['oss_query_settings_post_to_oss'] == 1)) { … … 651 652 update_option('oss_taxonomy_'.$taxonomy, $check_taxonomy_name); 652 653 } 654 $oss_enable_autoindexation = isset($_POST['oss_enable_autoindexation']) ? $_POST['oss_enable_autoindexation'] : NULL; 655 update_option('oss_enable_autoindexation', (int)$oss_enable_autoindexation); 653 656 opensearchserver_display_messages('OpenSearchServer Index Settings have been updated.'); 654 657 } else { … … 1014 1017 <input type="checkbox" name="oss_display_type" id="oss_display_type" value="1" <?php checked( 1 == get_option('oss_display_type')); ?> /> 1015 1018 <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')); ?> /> 1017 1020 <label for="oss_display_user">user</label> 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> 1018 1023 <br/><span class="help">Choose what kind of information should be displayed below each result.</span> 1019 1024 </p> … … 1099 1104 ?> 1100 1105 </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> 1101 1111 </p> 1102 1112
Note: See TracChangeset
for help on using the changeset viewer.