diff options
Diffstat (limited to 'views/rss/object/image.php')
-rw-r--r-- | views/rss/object/image.php | 57 |
1 files changed, 40 insertions, 17 deletions
diff --git a/views/rss/object/image.php b/views/rss/object/image.php index b93592081..a59021bd1 100644 --- a/views/rss/object/image.php +++ b/views/rss/object/image.php @@ -1,19 +1,42 @@ <?php +/** + * Individual image RSS view + * + * @uses $vars['entity'] TidypicsImage + * + * @author Cash Costello + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 + */ -$title = $vars['entity']->title; -$descr = $vars['entity']->description; -$download = $vars['url'] . 'pg/photos/download/' . $vars['entity']->guid . '/inline/'; -$base_url = $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid='; -?> - - <item> - <title><?php echo $title; ?></title> - <link><?php echo $base_url . $vars['entity']->guid . '&size=large'; ?></link> - <description><?php echo htmlentities($descr, ENT_QUOTES); ?></description> - <pubDate><?php echo date("r", $vars['entity']->time_created); ?></pubDate> - <guid isPermaLink="true"><?php echo $vars['entity']->getURL(); ?></guid> - <media:content url="<?php echo $download; ?>" medium="image" type="<?php echo $vars['entity']->getMimeType(); ?>" /> - <media:title><?php echo $title; ?></media:title> - <media:description><?php echo htmlentities($descr); ?></media:description> - <media:thumbnail url="<?php echo $base_url . $vars['entity']->guid . '&size=thumb'; ?>"></media:thumbnail> - </item>
\ No newline at end of file +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); + +$title = $vars['entity']->getTitle(); +$description = autop($vars['entity']->description); + +$creator = elgg_view('page/components/creator', $vars); +$georss = elgg_view('page/components/georss', $vars); +$extension = elgg_view('extensions/item', $vars); + +$thumbnail_url = $vars['entity']->getSrcUrl('thumb'); +$download_url = $vars['entity']->getSrcUrl('large'); + +$mime_type = $vars['entity']->getMimeType(); + +$item = <<<__HTML +<item> + <guid isPermaLink="true">$permalink</guid> + <pubDate>$pubdate</pubDate> + <link>$permalink</link> + <title><![CDATA[$title]]></title> + <description><![CDATA[$description]]></description> + $creator$georss$extension + <media:content url="$download_url" medium="image" type="$mime_type" /> + <media:title><![CDATA[$title]]></media:title> + <media:description><![CDATA[$description]]></media:description> + <media:thumbnail url="$thumbnail_url"></media:thumbnail> +</item> + +__HTML; + +echo $item; |