opml.phtml 691 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. $opml_array = array(
  3. 'head' => array(
  4. 'title' => FreshRSS_Context::$system_conf->title,
  5. 'dateCreated' => date('D, d M Y H:i:s')
  6. ),
  7. 'body' => array()
  8. );
  9. foreach ($this->categories as $key => $cat) {
  10. $opml_array['body'][$key] = array(
  11. 'text' => $cat['name'],
  12. '@outlines' => array()
  13. );
  14. foreach ($cat['feeds'] as $feed) {
  15. $opml_array['body'][$key]['@outlines'][] = array(
  16. 'text' => htmlspecialchars_decode($feed->name()),
  17. 'type' => 'rss',
  18. 'xmlUrl' => htmlspecialchars_decode($feed->url()),
  19. 'htmlUrl' => htmlspecialchars_decode($feed->website()),
  20. 'description' => htmlspecialchars_decode($feed->description()),
  21. );
  22. }
  23. }
  24. echo libopml_render($opml_array);