2 // $Id: views_plugin_row_comment_rss.inc,v 1.3 2009/01/08 19:40:44 merlinofchaos Exp $
5 * Contains the comment RSS row style plugin.
9 * Plugin which formats the comments as RSS items.
11 class views_plugin_row_comment_rss extends views_plugin_row {
13 function render($row) {
16 // Load the specified comment:
17 $comment = _comment_load($row->cid);
19 $item = new stdClass();
20 $item->title = $comment->subject;
21 $item->link = url('node/' . $comment->nid, array('absolute' => TRUE, 'fragment' => 'comment-' . $comment->cid));
22 $item->description = check_markup($comment->comment, $comment->format, FALSE);
23 $item->elements = array(
24 array('key' => 'pubDate', 'value' => gmdate('r', $comment->timestamp)),
25 array('key' => 'dc:creator', 'value' => $comment->name),
28 'value' => 'comment ' . $row->cid . ' at ' . $base_url,
29 'attributes' => array('isPermaLink' => 'false'),
30 'namespace' => array('xmlns:dc' => 'http://purl.org/dc/elements/1.1/'),
34 foreach ($item->elements as $element) {
35 if (isset($element['namespace'])) {
36 $this->view->style_plugin->namespaces = array_merge($this->view->style_plugin->namespaces, $element['namespace']);
40 return theme($this->theme_functions(), $this->view, $this->options, $item);