summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-10-17 19:09:09 +0000
committerDries Buytaert <dries@buytaert.net>2004-10-17 19:09:09 +0000
commita423eefe957da6cb174b7dcf3114f0d8be3df5cf (patch)
treeac1c4b963ef031fcc97c58d5bb5c662a2557833a /modules
parent3302104ffca5bb190de97af8663b73075fbef237 (diff)
downloadbrdo-a423eefe957da6cb174b7dcf3114f0d8be3df5cf.tar.gz
brdo-a423eefe957da6cb174b7dcf3114f0d8be3df5cf.tar.bz2
- 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.
Diffstat (limited to 'modules')
-rw-r--r--modules/comment.module7
-rw-r--r--modules/comment/comment.module7
2 files changed, 10 insertions, 4 deletions
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));
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index f8b08f27f..3de38864d 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/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));