From fca236dc6d6ff6e09182c560f3566904cbc7a70a Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 23 Oct 2012 18:29:43 +0200 Subject: affichage par catégories + meilleur exportation opml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/lib_rss.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index c695b64b7..74a86558c 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -69,16 +69,23 @@ function sortReverseEntriesByDate ($entry1, $entry2) { return $entry1->date (true) - $entry2->date (true); } -function opml_export ($feeds) { - // TODO gérer les catégories - $txt = '' . "\n"; +function get_domain ($url) { + return parse_url($url, PHP_URL_HOST); +} + +function opml_export ($cats) { + $txt = ''; - foreach ($feeds as $feed) { - $txt .= "\t" . '' . "\n"; + foreach ($cats as $cat) { + $txt .= '' . "\n"; + + foreach ($cat['feeds'] as $feed) { + $txt .= "\t" . '' . "\n"; + } + + $txt .= '' . "\n"; } - $txt .= '' . "\n"; - return $txt; } -- cgit v1.2.3