Index: search.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.module,v
retrieving revision 1.222
diff -u -F^function -r1.222 search.module
--- search.module	15 May 2007 05:43:16 -0000	1.222
+++ search.module	23 May 2007 15:16:30 -0000
@@ -251,6 +251,25 @@ function search_admin_settings() {
   $form['indexing_settings']['minimum_word_size'] = array('#type' => 'textfield', '#title' => t('Minimum word length to index'), '#default_value' => variable_get('minimum_word_size', 3), '#size' => 5, '#maxlength' => 3, '#description' => t('The number of characters a word has to be to be indexed. A lower setting means better search result ranking, but also a larger database. Each search query must contain at least one keyword that is this size (or longer).'));
   $form['indexing_settings']['overlap_cjk'] = array('#type' => 'checkbox', '#title' => t('Simple CJK handling'), '#default_value' => variable_get('overlap_cjk', TRUE), '#description' => t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.'));
 
+  // Display settings:
+  $form['search_results'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Show in search results'),
+    '#description' => t('Select which additional information, besides title and snippet, should be displayed for each search result.'),
+    '#collapsible' => FALSE,
+    '#collapsed' => FALSE,
+  );
+  $form['search_results']['search_result_node_info'] = array(
+    '#type' => 'checkboxes',
+    '#default_value' => variable_get('search_result_node_info', array('date', 'author', 'type', 'extra')),
+    '#options' => array(
+      'date' => t('Date'),
+      'author' => t('Author'),
+      'type' => t('Content type'),
+      'extra' => t('Module-provided fields'),
+    ),
+  );
+  
   // Per module settings
   $form = array_merge($form, module_invoke_all('search', 'admin'));
 
@@ -1267,17 +1286,18 @@ function _search_excerpt_replace(&$text)
  */
 function theme_search_item($item, $type) {
   $output = ' <dt class="title"><a href="'. check_url($item['link']) .'">'. check_plain($item['title']) .'</a></dt>';
+  $show_node_info = array_filter(variable_get('search_result_node_info', array('date', 'author', 'type', 'extra')));
   $info = array();
-  if (!empty($item['type'])) {
+  if (!empty($item['type']) && isset($show_node_info['type'])) {
     $info[] = $item['type'];
   }
-  if (!empty($item['user'])) {
+  if (!empty($item['user']) && isset($show_node_info['user'])) {
     $info[] = $item['user'];
   }
-  if (!empty($item['date'])) {
+  if (!empty($item['date']) && isset($show_node_info['date'])) {
     $info[] = format_date($item['date'], 'small');
   }
-  if (isset($item['extra']) && is_array($item['extra'])) {
+  if (isset($item['extra']) && is_array($item['extra']) && isset($show_node_info['extra'])) {
     $info = array_merge($info, $item['extra']);
   }
   $output .= ' <dd>'. (!empty($item['snippet']) ? '<p>'. $item['snippet'] .'</p>' : '') .'<p class="search-info">'. implode(' - ', $info) .'</p></dd>';
