public.phtml 1.2 KB

12345678910111213141516171819202122232425262728293031
  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>Flux public de <?php echo View::title(); ?></description>
  7. <language>fr</language>
  8. <pubDate><?php echo date('D, d M Y H:i:s O'); ?></pubDate>
  9. <lastBuildDate><?php echo gmdate('D, d M Y H:i:s'); ?> GMT</lastBuildDate>
  10. <atom:link href="<?php echo Url::display(array('a' => 'rss')); ?>" rel="self" type="application/rss+xml" />
  11. <?php
  12. $items = $this->itemPaginator->items ();
  13. foreach ($items as $item) {
  14. ?>
  15. <item>
  16. <title><?php echo htmlspecialchars(html_entity_decode($item->title ())); ?></title>
  17. <link><?php echo $item->link (); ?></link>
  18. <?php $author = $item->author (); ?>
  19. <?php if ($author != '') { ?>
  20. <dc:creator><?php echo $author; ?></dc:creator>
  21. <?php } ?>
  22. <description><![CDATA[<?php
  23. echo html_entity_decode($item->notes (false, false));
  24. ?>]]></description>
  25. <pubDate><?php echo date('D, d M Y H:i:s O', $item->date (true)); ?></pubDate>
  26. <guid><?php echo $item->guid (); ?></guid>
  27. </item>
  28. <?php } ?>
  29. </channel>
  30. </rss>