rss.phtml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php /** @var FreshRSS_View $this */ ?>
  2. <?= '<?xml version="1.0" encoding="UTF-8" ?>'; ?>
  3. <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  4. <channel>
  5. <title><?= $this->rss_title ?></title>
  6. <link><?= Minz_Url::display('', 'html', true) ?></link>
  7. <description><?= _t('index.feed.rss_of', $this->rss_title) ?></description>
  8. <pubDate><?= date('D, d M Y H:i:s O') ?></pubDate>
  9. <lastBuildDate><?= gmdate('D, d M Y H:i:s') ?> GMT</lastBuildDate>
  10. <atom:link href="<?= Minz_Url::display($this->url, 'html', true) ?>" rel="self" type="application/rss+xml" />
  11. <?php
  12. foreach ($this->entries as $item) {
  13. ?>
  14. <item>
  15. <title><?= $item->title() ?></title>
  16. <link><?= $item->link() ?></link>
  17. <?php
  18. $authors = $item->authors();
  19. if (is_array($authors)) {
  20. foreach ($authors as $author) {
  21. echo "\t\t\t" , '<dc:creator>', $author, '</dc:creator>', "\n";
  22. }
  23. }
  24. $categories = $item->tags();
  25. if (is_array($categories)) {
  26. foreach ($categories as $category) {
  27. echo "\t\t\t" , '<category>', $category, '</category>', "\n";
  28. }
  29. }
  30. ?>
  31. <description><![CDATA[<?php
  32. echo $item->content();
  33. ?>]]></description>
  34. <pubDate><?= date('D, d M Y H:i:s O', $item->date(true)) ?></pubDate>
  35. <guid isPermaLink="false"><?= $item->id() ?></guid>
  36. </item>
  37. <?php } ?>
  38. </channel>
  39. </rss>