rss.phtml 1.3 KB

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