diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-03-24 17:01:23 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-03-24 17:01:23 +0000 |
commit | 10aaea33428ef0757dbc92780f9a755d6d79a90d (patch) | |
tree | 460b490f6106e276cccc20eb4e01f54fd2879c3c /modules/comment.module | |
parent | c5efdeb4b41f68974320f41c5cecd84e0e73ea7f (diff) | |
download | brdo-10aaea33428ef0757dbc92780f9a755d6d79a90d.tar.gz brdo-10aaea33428ef0757dbc92780f9a755d6d79a90d.tar.bz2 |
- simplified the comment code: the SQL queries are less complex, thus
faster now.
Diffstat (limited to 'modules/comment.module')
-rw-r--r-- | modules/comment.module | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/comment.module b/modules/comment.module index cb86997b4..b9281eb34 100644 --- a/modules/comment.module +++ b/modules/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 .= " </TR>\n"; while ($comment = db_fetch_object($result)) { - $output .= " <TR><TD>". ($comment->link == "story" ? "<A HREF=\"story.php?id=$comment->lid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">". check_output($comment->subject) ."</A>" : check_output($comment->subject)) ."</TD><TD>". format_username($comment->userid) ."</TD><TD ALIGN=\"center\"><A HREF=\"admin.php?mod=comment&op=edit&id=$comment->cid\">edit</A></TD></TR>\n"; + $output .= " <TR><TD>". ($comment->link == "story" ? "<A HREF=\"node.php?id=$comment->lid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">". check_output($comment->subject) ."</A>" : check_output($comment->subject)) ."</TD><TD>". format_username($comment->userid) ."</TD><TD ALIGN=\"center\"><A HREF=\"admin.php?mod=comment&op=edit&id=$comment->cid\">edit</A></TD></TR>\n"; } $output .= "</TABLE>\n"; |