diff options
author | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-17 20:12:55 +0000 |
---|---|---|
committer | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-17 20:12:55 +0000 |
commit | fcc8efa279aab75419022bd8fc1b3134023c7806 (patch) | |
tree | ea9d162ea0cfe5969cef9dd960460b4c68a909a7 /views/rss/object | |
parent | 63159053d7f94c4e32d48ebc0ab90733070e0215 (diff) | |
download | elgg-fcc8efa279aab75419022bd8fc1b3134023c7806.tar.gz elgg-fcc8efa279aab75419022bd8fc1b3134023c7806.tar.bz2 |
Updating RSS feeds to use proper views called with page_shells.
git-svn-id: http://code.elgg.org/elgg/trunk@6073 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/rss/object')
-rw-r--r-- | views/rss/object/default.php | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/views/rss/object/default.php b/views/rss/object/default.php index 5d11599dc..7b1ab10bc 100644 --- a/views/rss/object/default.php +++ b/views/rss/object/default.php @@ -11,38 +11,43 @@ $title = $vars['entity']->title; if (empty($title)) { $subtitle = strip_tags($vars['entity']->description); - $title = substr($subtitle,0,32); + $title = substr($subtitle, 0, 32); if (strlen($subtitle) > 32) { - $title .= " ..."; + $title .= ' ...'; } } -?> +$permalink = htmlspecialchars($vars['entity']->getURL()); +$pubdate = date('r', $vars['entity']->time_created); +$creator = ''; +if ($owner = $vars['entity']->getOwnerEntity()) { + $creator = "<dc:creator>{$owner->name}</dc:creator>"; +} + +$georss = ''; +if ( + ($vars['entity'] instanceof Locatable) && + ($vars['entity']->getLongitude()) && + ($vars['entity']->getLatitude()) +) { + $latitude = $vars['entity']->getLatitude(); + $longitude = $vars['entity']->getLongitude(); + $georss = "<georss:point>$latitude $longitude</georss:point>"; +} + +$extension = elgg_view('extensions/item'); + +$item = <<<__HTML <item> -<guid isPermaLink='true'><?php echo htmlspecialchars($vars['entity']->getURL()); ?></guid> -<pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate> -<link><?php echo htmlspecialchars($vars['entity']->getURL()); ?></link> -<title><![CDATA[<?php echo $title; ?>]]></title> -<description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description> -<?php - $owner = $vars['entity']->getOwnerEntity(); - if ($owner) { -?> -<dc:creator><?php echo $owner->name; ?></dc:creator> -<?php - } -?> -<?php - if ( - ($vars['entity'] instanceof Locatable) && - ($vars['entity']->getLongitude()) && - ($vars['entity']->getLatitude()) - ) { - ?> - <georss:point><?php echo $vars['entity']->getLatitude(); ?> <?php echo $vars['entity']->getLongitude(); ?></georss:point> - <?php - } -?> -<?php echo elgg_view('extensions/item'); ?> + <guid isPermaLink="true">$permalink</guid> + <pubDate>$pubdate</pubDate> + <link>$permalink</link> + <title><![CDATA[$title]]></title> + <description><![CDATA[{$vars['entity']->description}]]></description> + $creator$georss$extension </item> + +__HTML; + +echo $item; |