opml.phtml 771 B

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