type == $node_type['type']) $nbresults++; } if ($nbresults) $items[] = l($node_type['name'], 'search/node/' . $keys . ' type:' . $node_type['type']); } if (!isset($variables['filter-title'])) { $variables['filter-title'] = filter_xss(variable_get('custom_search_filter_label', CUSTOM_SEARCH_FILTER_LABEL_DEFAULT)); } if (count($items) > 2) $variables['filter'] = theme('item_list', $items, $variables['filter-title']); } } } /* * Customisation of the results info. */ function custom_search_preprocess_search_result(&$variables) { // used to identify the correct info string $comment_str = preg_replace("/[0-9] (\b[a-z]*\b).*/", "$1", t('1 comment')); $attachment_str = preg_replace("/@*[a-z0-9]* (\b[a-z]*\b).*/", "$1", t('1 attachment')); $infos = array(); if (isset($variables['info_split'])) { foreach ($variables['info_split'] as $key => $info) { if (!is_numeric($key)) { if (variable_get('custom_search_results_info_' . $key, TRUE)) array_push($infos, $info); } else { if (variable_get('custom_search_results_info_comment', TRUE) && !empty($comment_str) && strpos($info, $comment_str) !== FALSE) array_push($infos, $info); if (variable_get('custom_search_results_info_upload', TRUE) && !empty($attachment_str) && strpos($info, $attachment_str) !== FALSE) array_push($infos, $info); } } } $variables['info'] = implode(' - ', $infos); }