","",$rss_content); $rss_content = str_replace("","",$rss_content); $articles = array(); $xml = simplexml_load_string($rss_content); if ($xml === false) { echo 'Failed to read RSS'; } else { $channel = array(); $channel['name'] = "vicefr.html"; $channel['title'] = $xml->channel->title; $channel['link'] = $xml->channel->link; $channel['description'] = $xml->channel->description; $channel['pubDate'] = $xml->channel->pubDate; $channel['timestamp'] = strtotime($xml->channel->pubDate); echo '

' . $channel['title'].''.PHP_EOL; echo '

'.PHP_EOL; $cpt=0; foreach ($xml->channel->item as $item) { $article = array(); $article['title'] = $item->title; $article['link'] = $item->link; $article['pubDate'] = $item->pubDate; $article['timestamp'] = strtotime($item->pubDate); $article['description'] = $item->description; $article['content'] = $item->contentEncoded; $article['image'] = $item->enclosure['url']; $articles[$cpt]=$article; echo '
'.PHP_EOL; echo '

'.PHP_EOL; echo '  '.PHP_EOL; echo ' '; echo $article['title'].'  '.PHP_EOL; echo '
'.PHP_EOL; $cpt++; if( $cpt > $NEWS_RSS_MAX_ITEMS ) { break; } } } echo ''; echo '
'.PHP_EOL; echo '
'; echo '
'.PHP_EOL; $cpt=0; foreach ($articles as $article ) { $cpt_prev=$cpt-1; $cpt_next=$cpt+1; echo PHP_EOL.PHP_EOL.''.PHP_EOL; echo "
\n"; echo "
"; echo ""; $article_only = $article['content']; $temp = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $article_only); $article_only = $temp; $temp = preg_replace('/\s\s+/', ' ', $article_only); $article_only = $temp; $re='/
/'; $newre='
'; $temp = preg_replace($re, $newre, $article_only); $article_only = $temp; $re='/
/'; $newre='
'; $temp = preg_replace($re, $newre, $article_only); $article_only = $temp; $re='/>'; $article_only = preg_replace($re, $newre, $article_only); $re = '/
', $article_only); $re='/
" ', $article_only); $article_only = $temp; echo '     '.PHP_EOL; echo '     '.PHP_EOL; echo ''.PHP_EOL; echo ''.PHP_EOL; echo '     '.PHP_EOL; echo ''.PHP_EOL; echo '

'.$article['title'].'

'.$article_only.'
'.PHP_EOL; echo ' '.PHP_EOL; echo '     '.PHP_EOL; echo '     '.PHP_EOL; echo '     '.PHP_EOL; echo '
'.PHP_EOL; echo ''.PHP_EOL; $cpt++; if( $cpt > $NEWS_RSS_MAX_ITEMS ) { break; } } ?>