From 5b92a64179459e00485d25f14dc97f55d590e2ac Mon Sep 17 00:00:00 2001 From: Piotr KUCHARSKI Date: Wed, 26 Nov 2014 21:47:38 +0100 Subject: [PATCH] rewrite xml generation --- rss.php | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/rss.php b/rss.php index aab1293..044b613 100644 --- a/rss.php +++ b/rss.php @@ -122,33 +122,22 @@ if (($current_time - $last_rss_gen) > $rss_refresh_interval && file_exists("rss. file_put_contents($old_files_list, $content); unlink("rss.locker"); } + /*===================*/ /* XML Gen */ /*===================*/ $temp = explode("\n", $temp); -$pieceOfTitle; -$titleLenght; -echo " - - - ".$title." - ".$gallery_link." - ".$description." - "; -for ($i=0; $i < $nb_items_rss; $i++) { - $pieceOfTitle = strrchr ($temp[$i] , "/"); - $titleLenght = strlen($pieceOfTitle) - strlen(strrchr($pieceOfTitle, ".")); - echo " - " . substr($pieceOfTitle, 1, $titleLenght-1) . " - ". $temp[$i] . " - - ]]> - - "; - if ($temp[$i+1] == NULL) - break; +echo "\n"; +echo "$title"; +echo "$gallery_link"; +echo "$description\n"; +for ($i=0; $i < $nb_items_rss && $i < count($temp); $i++) { + if (empty($temp[$i])) + continue; + echo "\n"; + echo " " . basename($temp[$i]) . "\n"; + echo " ". $temp[$i] . "\n"; + echo " ]]>\n"; + echo "\n"; } -echo " - - -"; +echo "\n";