aboutsummaryrefslogtreecommitdiff
path: root/views/rss/river/item/list.php
blob: 8047c24bfeeffbfa809890a6fd2621fc4ffc38ea (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
35
36
37
38
<?php
/**
 * @package Elgg
 * @subpackage Core
 * @author Curverider Ltd
 * @link http://elgg.org/
 */

if (isset($vars['items']) && is_array($vars['items']) && !empty($vars['items'])) {
	foreach($vars['items'] as $item) {
		if (elgg_view_exists($item->view)) {
			$body = elgg_view($item->view, array('item' => $item));
			$time = date('r', $item->posted);
			if ($entity = get_entity($item->object_guid)) {
				$url = htmlspecialchars($entity->getURL());
			} else {
				$url = $vars['url'];
			}
			$title = strip_tags($body);
			
			echo <<<__HTML
<item>
	<guid isPermaLink="true">$url</guid>
	<pubDate>$time</pubDate>
	<title><![CDATA[$title]]></title>
	<link>$url</link>
	<description><![CDATA[$body]]></description>
</item>

__HTML;
			
			$i++;
			if ($i >= $vars['limit']) {
				break;
			}
		}
	}
}