aboutsummaryrefslogtreecommitdiff
path: root/views/rss/annotation/default.php
blob: 98329f132e085a0e093b2eec476639d5d2278080 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
 * Elgg RSS view for a generic comment
 *
 * @package Elgg
 * @subpackage Core
 */

$entity = get_entity($vars['annotation']->entity_guid);

$title = substr($vars['annotation']->value, 0, 32);
if (strlen($vars['annotation']->value) > 32) {
	$title .= " ...";
}

$permalink = $entity->getURL();
$pubdate = date('r', $entity->time_created);

$creator = elgg_view('object/creator', array('entity' => $entity));
$georss = elgg_view('object/georss', array('entity' => $entity));
$extensions = elgg_view('extensions/item');

$item = <<<__HTML
<item>
	<guid isPermaLink='true'>$permalink#{$vars['annotation']->id}</guid>
	<pubDate>$pubdate</pubDate>
	<link>$permalink#{$vars['annotation']->id}</link>
	<title><![CDATA[$title]]></title>
	<description><![CDATA[{$vars['annotation']->value}]]></description>
	$creator$georss$extensions
</item>
__HTML;

echo $item;