From facd9cc5176bf1146ee031c44d000b3806335fde Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 5 Dec 2001 20:22:58 +0000 Subject: - Bugfix: you can no longer add non-existant node types. Thanks barry. - Moved all comment related logic from node.module to comment.module. --- modules/comment/comment.module | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'modules/comment/comment.module') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 093054e82..100824459 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -19,7 +19,7 @@ function comment_link($type, $node = 0, $main = 0) { $links[] = "comments"; } - if ($node->comment) { + if ($type == "node" && $node->comment) { if ($main) { @@ -46,6 +46,25 @@ function comment_link($type, $node = 0, $main = 0) { return $links ? $links : array(); } +function comment_node_link($node) { + + /* + ** Edit comments: + */ + + $result = db_query("SELECT c.cid, c.subject, u.uid, u.name FROM comments c LEFT JOIN users u ON u.uid = c.uid WHERE lid = '$node->nid' ORDER BY c.timestamp"); + $output .= "

". t("Edit comments") ."

"; + $output .= ""; + $output .= " "; + while ($comment = db_fetch_object($result)) { + $output .= ""; + } + + $output .= "
titleauthoroperations
nid&cid=$comment->cid#$comment->cid\">$comment->subject". format_name($comment) ."nid&cid=$comment->cid#$comment->cid\">". t("view comment") ."cid\">". t("edit comment") ."cid\">". t("delete comment") ."
"; + + return $output; +} + function comment_edit($id) { $result = db_query("SELECT c.*, u.name, u.uid FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.cid = '$id'"); -- cgit v1.2.3