From a423eefe957da6cb174b7dcf3114f0d8be3df5cf Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 17 Oct 2004 19:09:09 +0000 Subject: - Patch #11670 by TDobes: comment.module did not properly set a breadcrumb for creating/previewing new comments. The node on which your commenting and its location within the menu is not displayed. Instead, there is only a "Home" link. This is especially apparent when the "add new comment" form is set up to display on a separate page. --- modules/comment.module | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'modules/comment.module') diff --git a/modules/comment.module b/modules/comment.module index f8b08f27f..3de38864d 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -380,6 +380,9 @@ function comment_edit($cid) { } function comment_reply($nid, $pid = NULL) { + // set the breadcrumb trail + $node = node_load(array('nid' => $nid)); + menu_set_location(array(array('path' => "node/$nid", 'title' => $node->title), array('path' => "comment/reply/$nid"))); $output = ''; @@ -409,7 +412,7 @@ function comment_reply($nid, $pid = NULL) { $output .= theme('comment_view', $comment); } else if (user_access('access content')) { - $output .= node_view(node_load(array('nid' => $nid))); + $output .= node_view($node); $pid = 0; } @@ -1689,7 +1692,7 @@ function _comment_per_page() { * - last_comment_timestamp: the timestamp of the last comment for this node or the node create stamp if no comments exist for the node. * - last_comment_name: the name of the anonymous poster for the last comment * - last_comment_uid: the uid of the poster for the last comment for this node or the node authors uid if no comments exists for the node. - * - comment_count: the total number of comments on this node. + * - comment_count: the total number of approved/published comments on this node. */ function _comment_update_node_statistics($nid) { $count = db_result(db_query('SELECT COUNT(cid) FROM {comments} WHERE nid = %d AND status = 0', $nid)); -- cgit v1.2.3