4 * Contains the Aggregator Item RSS row style plugin.
8 * Plugin which loads an aggregator item and formats it as an RSS item.
10 class views_plugin_row_aggregator_rss
extends views_plugin_row
{
11 function option_definition() {
12 $options = parent
::option_definition();
14 $options['item_length'] = array('default' => 'default');
19 function options_form(&$form, &$form_state) {
20 $form['item_length'] = array(
22 '#title' => t('Display type'),
24 'fulltext' => t('Full text'),
25 'teaser' => t('Title plus teaser'),
26 'title' => t('Title only'),
27 'default' => t('Use default RSS settings'),
29 '#default_value' => $this->options
['item_length'],
33 function render($row) {
34 $sql = "SELECT ai.iid, ai.fid, ai.title, ai.link, ai.author, ai.description, ";
35 $sql .
= "ai.timestamp, ai.guid, af.title AS feed_title, ai.link AS feed_LINK ";
36 $sql .
= "FROM {aggregator_item} ai LEFT JOIN {aggregator_feed} af ON ai.fid = af.fid ";
37 $sql .
= "WHERE ai.iid = %d";
39 $item = db_fetch_object(db_query($sql, $row->iid
));
41 $item->elements
= array(
42 array('key' => 'pubDate', 'value' => gmdate('r', $item->timestamp
)),
44 'key' => 'dc:creator',
45 'value' => $item->author
,
46 'namespace' => array('xmlns:dc' => 'http://purl.org/dc/elements/1.1/'),
50 'value' => $item->guid
,
51 'attributes' => array('isPermaLink' => 'false')
55 foreach ($item->elements as
$element) {
56 if (isset($element['namespace'])) {
57 $this->view
->style_plugin
->namespaces
= array_merge($this->view
->style_plugin
->namespaces
, $element['namespace']);
61 return theme($this->theme_functions(), $this->view
, $this->options
, $item);