diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-03-01 11:18:31 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-03-01 11:18:31 +0000 |
commit | 74e94b7e019d29bb58928df0b5b5de8ec3651359 (patch) | |
tree | 3069a0bbaa496960c4af6ab57503f61bf917c77e | |
parent | 1c26e2cee1dfde11eb505db66ec2b97baa7244d9 (diff) | |
download | brdo-74e94b7e019d29bb58928df0b5b5de8ec3651359.tar.gz brdo-74e94b7e019d29bb58928df0b5b5de8ec3651359.tar.bz2 |
- Patch #721374 by jhodgdon: 'Add new comment' is put into the search index along with each node.
-rw-r--r-- | modules/comment/comment.module | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 9758877c6..05cb8ce3f 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -589,7 +589,9 @@ function comment_node_view($node, $view_mode) { } } elseif ($view_mode == 'teaser') { - // Main page: display the number of comments that have been posted. + // Teaser view: display the number of comments that have been posted, + // or a link to add new comments if the user has permission, the node + // is open to new comments, and there currently are none. if (user_access('access comments')) { if (!empty($node->comment_count)) { $links['comment_comments'] = array( @@ -630,9 +632,11 @@ function comment_node_view($node, $view_mode) { } } } - else { - // Node page: add a "post comment" link if the user is allowed to post - // comments and if this node is not read-only. + elseif ($view_mode != 'search_index') { + // Node in other view modes: add a "post comment" link if the user is + // allowed to post comments and if this node is allowing new comments. + // But we don't want this link if we're building the node for search + // indexing. if ($node->comment == COMMENT_NODE_OPEN) { if (user_access('post comments')) { $links['comment_add'] = array( |