image.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Individual image RSS view
  4. *
  5. * @uses $vars['entity'] TidypicsImage
  6. *
  7. * @author Cash Costello
  8. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
  9. */
  10. $permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');
  11. $pubdate = date('r', $vars['entity']->getTimeCreated());
  12. $title = $vars['entity']->getTitle();
  13. $description = elgg_autop($vars['entity']->description);
  14. $creator = elgg_view('page/components/creator', $vars);
  15. $georss = elgg_view('page/components/georss', $vars);
  16. $extension = elgg_view('extensions/item', $vars);
  17. $thumbnail_url = $vars['entity']->getIconURL('tiny');
  18. $download_url = $vars['entity']->getIconURL('large');
  19. $mime_type = $vars['entity']->getMimeType();
  20. $item = <<<__HTML
  21. <item>
  22. <guid isPermaLink="true">$permalink</guid>
  23. <pubDate>$pubdate</pubDate>
  24. <link>$permalink</link>
  25. <title><![CDATA[$title]]></title>
  26. <description><![CDATA[$description]]></description>
  27. $creator$georss$extension
  28. <media:content url="$download_url" medium="image" type="$mime_type" />
  29. <media:title><![CDATA[$title]]></media:title>
  30. <media:description><![CDATA[$description]]></media:description>
  31. <media:thumbnail url="$thumbnail_url"></media:thumbnail>
  32. </item>
  33. __HTML;
  34. echo $item;