1 views_plugin_row_comment_rss.inc views_plugin_row_comment_rss::pre_render($result)

Allow the style to do stuff before each row is rendered.

Parameters

$result: The full array of results from the query.

Overrides views_plugin_row::pre_render

File

core/modules/comment/views/views_plugin_row_comment_rss.inc, line 40
Contains the comment RSS row style plugin.

Class

views_plugin_row_comment_rss
Plugin which formats the comments as RSS items.

Code

function pre_render($result) {
  $cids = array();
  $nids = array();

  foreach ($result as $row) {
    $cids[] = $row->cid;
  }

  $this->comments = comment_load_multiple($cids);
  foreach ($this->comments as &$comment) {
    $comment->depth = count(explode('.', $comment->thread)) - 1;
    $nids[] = $comment->nid;
  }

  $this->nodes = node_load_multiple($nids);
}