function comment_view_multiple

cis7 comment.module comment_view_multiple($comments, $node, $view_mode = 'full', $weight = 0, $langcode = NULL)
cle7 comment.module comment_view_multiple($comments, $node, $view_mode = 'full', $weight = 0, $langcode = NULL)
elmsmedia7 comment.module comment_view_multiple($comments, $node, $view_mode = 'full', $weight = 0, $langcode = NULL)
icor7 comment.module comment_view_multiple($comments, $node, $view_mode = 'full', $weight = 0, $langcode = NULL)
meedjum_blog7 comment.module comment_view_multiple($comments, $node, $view_mode = 'full', $weight = 0, $langcode = NULL)
mooc7 comment.module comment_view_multiple($comments, $node, $view_mode = 'full', $weight = 0, $langcode = NULL)

Construct a drupal_render() style array from an array of loaded comments.

Parameters

$comments: An array of comments as returned by comment_load_multiple().

$node: The node the comments are attached to.

$view_mode: View mode, e.g. 'full', 'teaser'...

$weight: An integer representing the weight of the first comment in the list.

$langcode: A string indicating the language field values are to be shown in. If no language is provided the current content language is used.

Return value

An array in the format expected by drupal_render().

5 calls to comment_view_multiple()
comment_node_page_additions in modules/comment/comment.module
Build the comment-related elements for node detail pages.
comment_node_update_index in modules/comment/comment.module
Implements hook_node_update_index().
ctools_comment_render in sites/all/modules/ulmus/ctools/plugins/content_types/node_context/node_comments.inc
This function is a somewhat stripped down version of comment_render that removes a bunch of cruft that we both don't need, and makes it difficult to modify this.
entity_metadata_view_comment in sites/all/modules/ulmus/entity/modules/callbacks.inc
Callback to view comments.
template_preprocess_views_view_row_comment in sites/all/modules/ulmus/views/modules/comment.views.inc
Template helper for theme_views_view_row_comment

File

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

Code

function comment_view_multiple($comments, $node, $view_mode = 'full', $weight = 0, $langcode = NULL) {
  field_attach_prepare_view('comment', $comments, $view_mode, $langcode);
  entity_prepare_view('comment', $comments, $langcode);

  $build = array(
    '#sorted' => TRUE,
  );
  foreach ($comments as $comment) {
    $build[$comment->cid] = comment_view($comment, $node, $view_mode, $langcode);
    $build[$comment->cid]['#weight'] = $weight;
    $weight++;
  }
  return $build;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.