rss.phtml 1.2 KB

123456789101112131415161718192021222324252627282930
  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 View::title(); ?></title>
  5. <link><?php echo Url::display(); ?></link>
  6. <description><?php echo Translate::t ('rss_feeds_of', View::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 _url ('index', 'index', 'output', 'rss'); ?>" rel="self" type="application/rss+xml" />
  10. <?php
  11. $items = $this->entryPaginator->items ();
  12. foreach ($items as $item) {
  13. ?>
  14. <item>
  15. <title><?php echo htmlspecialchars(html_entity_decode($item->title ())); ?></title>
  16. <link><?php echo $item->link (); ?></link>
  17. <?php $author = $item->author (); ?>
  18. <?php if ($author != '') { ?>
  19. <dc:creator><?php echo $author; ?></dc:creator>
  20. <?php } ?>
  21. <description><![CDATA[<?php
  22. echo $item->content ();
  23. ?>]]></description>
  24. <pubDate><?php echo date('D, d M Y H:i:s O', $item->date (true)); ?></pubDate>
  25. <guid isPermaLink="false"><?php echo $item->id (); ?></guid>
  26. </item>
  27. <?php } ?>
  28. </channel>
  29. </rss>