summaryrefslogtreecommitdiff
path: root/includes/search.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/search.inc')
-rw-r--r--includes/search.inc30
1 files changed, 30 insertions, 0 deletions
diff --git a/includes/search.inc b/includes/search.inc
new file mode 100644
index 000000000..2fd527a90
--- /dev/null
+++ b/includes/search.inc
@@ -0,0 +1,30 @@
+<?
+
+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\">";
+ $output .= " <INPUT TYPE=\"submit\" VALUE=\"Search\">\n";
+ $output .= "</FORM>\n";
+ return $output;
+}
+
+function search_data($keys, $type) {
+ if ($keys && $type) {
+ $result = module_execute($type, "find", $keys);
+ foreach ($result as $entry) {
+ $output .= "<P>\n";
+ $output .= " <B><U><A HREF=\"$entry[link]\">$entry[subject]</A></U></B><BR>";
+ $output .= " <SMALL>$site_url$entry[link]". ($entry[user] ? " - ". format_username($entry[user]) : "") ."". ($entry[date] ? " - ". format_date($entry[date], "small") : "") ."</SMALL>";
+ $output .= "</P>\n";
+ }
+ }
+
+ if (!$output) {
+ $output .= "<P><SMALL>Your search yielded no results:</P><UL><LI>try using fewer words.</LI><LI>try using more general keywords.</LI><LI>try using different keywords.</LI></UL></SMALL>\n";
+ }
+
+ return $output;
+}
+
+?> \ No newline at end of file