From ef0acbf2ddbfdfb8d639c317b82fa40daa6e1c5b Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 21 Jan 2003 22:38:47 +0000 Subject: - A node's comment table is now being emitted by the new table rendering functions. --- modules/comment.module | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'modules/comment.module') diff --git a/modules/comment.module b/modules/comment.module index 79b71522f..38c5b3c80 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -731,7 +731,7 @@ function comment_page() { function comment_node_link($node) { - if (user_access("administer comments") && comment_num_all($node->nid)) { + if (user_access("administer comments")) { /* ** Edit comments: @@ -739,15 +739,17 @@ function comment_node_link($node) { $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 nid = '%d' AND c.status = 0 ORDER BY c.timestamp", $node->nid); - $output .= "

". t("Edit comments") ."

"; - $output .= ""; - $output .= " "; + + $header = array(t("title"), t("author"), array("data" => t("operations"), "colspan" => 3)); while ($comment = db_fetch_object($result)) { - $output .= ""; + $rows[] = array(l($comment->subject, "node/view/$node->nid#$comment->cid"), format_name($comment), l(t("view comment"), "node/view/$node->nid#$comment->cid"), l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid")); } - $output .= "
titleauthoroperations
". l($comment->subject, "node/view/$node->nid#$comment->cid") ."". format_name($comment) ."". l(t("view comment"), "node/view/$node->nid#$comment->cid") ."". l(t("edit comment"), "admin/comment/edit/$comment->cid") ."". l(t("delete comment"), "admin/comment/delete/$comment->cid") ."
"; + if ($rows) { + $output = "

". t("Edit comments") ."

"; + $output .= table($header, $rows); + } return $output; } -- cgit v1.2.3