From 77ed5310351b53372ba2eb6250d18b333ac3c1a2 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 7 Feb 2001 22:01:57 +0000 Subject: - added new feature for evaluating purpose: user rating (mojo, karma)! - removed tabs from Jeroen's theme --- modules/comment/comment.module | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'modules/comment') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index e4a8ca9ac..bd6594dbc 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1,6 +1,16 @@ "comment_admin"); +$module = array("find" => "comment_find", + "admin" => "comment_admin"); + +function comment_find($keys) { + $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 '%". check_input($keys) ."%' OR c.comment LIKE '%". check_input($keys) ."%' ORDER BY c.timestamp DESC LIMIT 20"); + while ($comment = db_fetch_object($result)) { + array_push($find, array("subject" => check_output($comment->subject), "link" => "story.php?id=$comment->lid&cid=$comment->cid", "user" => $story->userid, "date" => $comment->timestamp)); + } + return $find; +} function comment_edit($id) { $result = db_query("SELECT c.*, u.userid FROM comments c LEFT JOIN users u ON c.author = u.id WHERE c.cid = $id"); -- cgit v1.2.3