From 10aaea33428ef0757dbc92780f9a755d6d79a90d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 24 Mar 2001 17:01:23 +0000 Subject: - simplified the comment code: the SQL queries are less complex, thus faster now. --- modules/comment/comment.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/comment/comment.module') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index cb86997b4..b9281eb34 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -8,7 +8,7 @@ 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 '%$keys%' OR c.comment LIKE '%$keys%' ORDER BY c.timestamp DESC LIMIT 20"); while ($comment = db_fetch_object($result)) { - array_push($find, array("subject" => check_output($comment->subject), "link" => (user_access($user, "comment") ? "admin.php?mod=comment&op=edit&id=$comment->cid" : "story.php?id=$comment->lid&cid=$comment->cid"), "user" => $story->userid, "date" => $comment->timestamp)); + 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" => $story->userid, "date" => $comment->timestamp)); } return $find; } @@ -75,7 +75,7 @@ function comment_display($order = "date") { $output .= " \n"; while ($comment = db_fetch_object($result)) { - $output .= " ". ($comment->link == "story" ? "lid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">". check_output($comment->subject) ."" : check_output($comment->subject)) ."". format_username($comment->userid) ."cid\">edit\n"; + $output .= " ". ($comment->link == "story" ? "lid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">". check_output($comment->subject) ."" : check_output($comment->subject)) ."". format_username($comment->userid) ."cid\">edit\n"; } $output .= "\n"; -- cgit v1.2.3