summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-05-09 18:28:09 +0000
committerDries Buytaert <dries@buytaert.net>2001-05-09 18:28:09 +0000
commit0000c2e401290042d7d4eb140acd0f1652f13176 (patch)
tree759de19ca67cef5271ba2a90a5fbe5ecbc9475a2 /modules/comment/comment.module
parentfae651d75fb3b42c7643a19973cdd4a36975488e (diff)
downloadbrdo-0000c2e401290042d7d4eb140acd0f1652f13176.tar.gz
brdo-0000c2e401290042d7d4eb140acd0f1652f13176.tar.bz2
- Code review: improved search API, tidied up the search related code,
and fixed a tiny bug when searching for users.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 9af8d04e8..24b156443 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -1,11 +1,10 @@
<?php
-function comment_find($keys) {
+function comment_search($keys) {
global $user;
- $find = array();
$result = db_query("SELECT c.*, u.userid FROM comments c LEFT JOIN users u ON c.author = u.id WHERE c.subject LIKE '%$keys%' OR c.comment LIKE '%$keys%' ORDER BY c.timestamp DESC LIMIT 20");
while ($comment = db_fetch_object($result)) {
- array_push($find, array("title" => check_output($comment->subject), "link" => (user_access($user, "comment") ? "admin.php?mod=comment&op=edit&id=$comment->cid" : "node.php?id=$comment->lid&cid=$comment->cid"), "user" => $comment->userid, "date" => $comment->timestamp));
+ $find[$i++] = array("title" => check_output($comment->subject), "link" => (user_access($user, "comment") ? "admin.php?mod=comment&op=edit&id=$comment->cid" : "node.php?id=$comment->lid&cid=$comment->cid"), "user" => $comment->userid, "date" => $comment->timestamp);
}
return $find;
}