layout.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * RSS river view
  4. *
  5. * @uses $vars['item']
  6. */
  7. $item = $vars['item'];
  8. $name = $item->getSubjectEntity()->name;
  9. $name = htmlspecialchars($name, ENT_NOQUOTES, 'UTF-8');
  10. $title = elgg_echo('river:update', array($name));
  11. $timestamp = date('r', $item->getTimePosted());
  12. $summary = elgg_view('river/elements/summary', $vars, false, false, 'default');
  13. $body = elgg_extract('summary', $vars, $summary);
  14. $object = $item->getObjectEntity();
  15. if ($object) {
  16. $url = htmlspecialchars($object->getURL());
  17. } else {
  18. $url = elgg_normalize_url('activity');
  19. }
  20. $site_url = parse_url(elgg_get_site_url());
  21. $domain = htmlspecialchars($site_url['host'], ENT_NOQUOTES, 'UTF-8');
  22. $path = '';
  23. if ($site_url['path']) {
  24. $path = htmlspecialchars($site_url['path'], ENT_NOQUOTES, 'UTF-8');
  25. $path = "::$path";
  26. }
  27. $html = <<<__HTML
  28. <guid isPermaLink="false">$domain$path::river::$item->id</guid>
  29. <pubDate>$timestamp</pubDate>
  30. <link>$url</link>
  31. <title><![CDATA[$title]]></title>
  32. <description><![CDATA[$body]]></description>
  33. __HTML;
  34. echo $html;