2001-03-10 11:07:52 +00:00
|
|
|
<?php
|
2001-02-10 14:36:49 +00:00
|
|
|
|
|
|
|
function search_form($keys) {
|
|
|
|
global $REQUEST_URI;
|
|
|
|
$output .= "<FORM ACTION=\"$REQUEST_URI\" METHOD=\"POST\">\n";
|
|
|
|
$output .= " <INPUT SIZE=\"50\" VALUE=\"". check_textfield($keys) ."\" NAME=\"keys\">";
|
2001-05-09 18:28:09 +00:00
|
|
|
$output .= " <INPUT TYPE=\"submit\" VALUE=\"". t("Search") ."\">\n";
|
2001-02-10 14:36:49 +00:00
|
|
|
$output .= "</FORM>\n";
|
|
|
|
return $output;
|
|
|
|
}
|
|
|
|
|
|
|
|
function search_data($keys, $type) {
|
2001-05-09 18:28:09 +00:00
|
|
|
if ($keys && $type && $result = module_invoke($type, "search", check_input($keys))) {
|
2001-02-10 14:36:49 +00:00
|
|
|
foreach ($result as $entry) {
|
|
|
|
$output .= "<P>\n";
|
2001-03-25 10:57:01 +00:00
|
|
|
$output .= " <B><U><A HREF=\"$entry[link]\">$entry[title]</A></U></B><BR>";
|
2001-04-06 14:14:16 +00:00
|
|
|
$output .= " <SMALL>$entry[link]". ($entry[user] ? " - ". format_username($entry[user]) : "") ."". ($entry[date] ? " - ". format_date($entry[date], "small") : "") ."</SMALL>";
|
2001-02-10 14:36:49 +00:00
|
|
|
$output .= "</P>\n";
|
|
|
|
}
|
|
|
|
}
|
2001-05-09 18:28:09 +00:00
|
|
|
else {
|
2001-02-12 20:40:43 +00:00
|
|
|
$output .= t("Your search yielded no results.");
|
2001-02-10 14:36:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return $output;
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|