rss.phtml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php echo '<?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><?php echo $this->rss_title; ?></title>
  5. <link><?php echo Minz_Url::display(null, 'html', true); ?></link>
  6. <description><?php echo _t('index.feed.rss_of', $this->rss_title); ?></description>
  7. <pubDate><?php echo date('D, d M Y H:i:s O'); ?></pubDate>
  8. <lastBuildDate><?php echo gmdate('D, d M Y H:i:s'); ?> GMT</lastBuildDate>
  9. <atom:link href="<?php echo 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><?php echo $item->title(); ?></title>
  15. <link><?php echo $item->link(); ?></link>
  16. <?php
  17. $authors = $item->authors();
  18. if (is_array($authors)) {
  19. foreach ($authors as $author) {
  20. echo "\t\t\t" , '<author>', $author, '</author>', "\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><?php echo date('D, d M Y H:i:s O', $item->date(true)); ?></pubDate>
  34. <guid isPermaLink="false"><?php echo $item->id(); ?></guid>
  35. </item>
  36. <?php } ?>
  37. </channel>
  38. </rss>