From e95aa56e02215ae211942b4e3192a17f115e99c7 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 25 Jun 2003 22:10:54 +0000 Subject: - Bugfix: fixed bug in the search module that prevented the title module from working properly. Patch by Moshe. Fixes bug #1852. --- includes/common.inc | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index d00c04f2f..12a71bbda 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -317,7 +317,7 @@ function search_item($item, $type) { $output = module_invoke($type, "search_item", $item); } else { - $output .= " ". $item["count"] ."  ". $item["title"] ."
"; + $output .= " ". $item["title"] ."
"; $output .= " $type ". ($item["user"] ? " - ". $item["user"] : "") ."". ($item["date"] ? " - ". format_date($item["date"], "small") : "") .""; $output .= "

"; } @@ -335,21 +335,16 @@ function search_item($item, $type) { * parts of this form. * * @param $action Form action. Defaults to 'site.com/search'. - * @param $query Query string. Defaults to global $keys. + * @param $keys string containing keywords for the search. * @param $options != 0: Render additional form fields/text * ("Restrict search to", help text, etc). */ -function search_form($action = 0, $query = 0, $options = 0) { - $keys = $_POST["keys"]; +function search_form($action = 0, $keys = 0, $options = 0) { if (!$action) { $action = url("search"); } - if (!$query) { - $query = $keys; - } - $output .= "
"; $output .= " \n"; @@ -372,9 +367,8 @@ function search_form($action = 0, $query = 0, $options = 0) { /* * Collect the search results: */ -function search_data() { +function search_data($keys = NULL) { - $keys = $_POST["keys"]; $edit = $_POST["edit"]; if (isset($keys)) { @@ -391,9 +385,6 @@ function search_data() { } } } - if (!$output) { - $output .= t("Your search yielded no results."); - } } return $output; @@ -409,13 +400,13 @@ function search_data() { * @param $options != 0: Render additional form fields/text * ("Restrict search to", help text, etc). */ -function search_type($type = 0, $action = 0, $query = 0, $options = 0) { +function search_type($type = 0, $action = 0, $keys = 0, $options = 0) { if (isset($type)) { $_POST["edit"]["type"][$type] = "on"; } - return search_form($action, $query, $options) . search_data(); + return search_form($action, $keys, $options) . "
". search_data($keys); } -- cgit v1.2.3