function comment_node_page_additions

cis7 comment.module comment_node_page_additions($node)
cle7 comment.module comment_node_page_additions($node)
elmsmedia7 comment.module comment_node_page_additions($node)
icor7 comment.module comment_node_page_additions($node)
meedjum_blog7 comment.module comment_node_page_additions($node)
mooc7 comment.module comment_node_page_additions($node)

Build the comment-related elements for node detail pages.


$node: A node object.

3 calls to comment_node_page_additions()
comment_node_view in modules/comment/comment.module
Implements hook_node_view().
ds_views_row_render_node in sites/all/modules/ulmus/ds/views/
Render the node through the entity plugin.
node_row_node_view_preprocess_node in sites/all/modules/ulmus/views/modules/
Implements hook_preprocess_node().


modules/comment/comment.module, line 722
Enables users to comment on published content.


function comment_node_page_additions($node) {
  $additions = array();

  // Only attempt to render comments if the node has visible comments.
  // Unpublished comments are not included in $node->comment_count, so show
  // comments unconditionally if the user is an administrator.
  if (($node->comment_count && user_access('access comments')) || user_access('administer comments')) {
    $mode = variable_get('comment_default_mode_' . $node->type, COMMENT_MODE_THREADED);
    $comments_per_page = variable_get('comment_default_per_page_' . $node->type, 50);
    if ($cids = comment_get_thread($node, $mode, $comments_per_page)) {
      $comments = comment_load_multiple($cids);
      $build = comment_view_multiple($comments, $node);
      $build['pager']['#theme'] = 'pager';
      $additions['comments'] = $build;

  // Append comment form if needed.
  if (user_access('post comments') && $node->comment == COMMENT_NODE_OPEN && (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_BELOW) == COMMENT_FORM_BELOW)) {
    $build = drupal_get_form("comment_node_{$node->type}_form", (object) array('nid' => $node->nid));
    $additions['comment_form'] = $build;

  if ($additions) {
    $additions += array(
      '#theme' => 'comment_wrapper__node_' . $node->type,
      '#node' => $node,
      'comments' => array(),
      'comment_form' => array(),

  return $additions;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.