title; $channel['pubDate'] = $xml->updated; $channel['timestamp'] = strtotime($xml->updated); echo '

' . $channel['title'] . '

'; $cpt=0; foreach ($xml->entry as $item) { $article = array(); $article['title'] = $item->title; $article['link'] = $item->link['href']; $orgStrings = array('?xtor=rss-450'); $newStrings = array(''); $article['link'] = str_replace($orgStrings, $newStrings, $article['link']); $article['pubDate'] = $item->updated; $article['timestamp'] = strtotime($item->updated); $article['description'] = $item->summary; $article['image']="img/liberation.png"; foreach ($item->link as $item2 ) { if( ( 0 == strcmp( $item2['type'], "image/jpeg") ) || ( 0 == strcmp( $item2['type'], "image/png") ) ) { $pos_start=strpos($item2['href'],"?modified_at"); if( $pos_start ) { $image_link=substr($item2['href'],0,$pos_start); $article['image']=substr($item2['href'],0,$pos_start); } } } $articles[$cpt] = $article; echo "
\n"; echo '
'; echo ' '; echo ' '; echo $article['title'].' '; echo '
'; $cpt++; if( $cpt > $NEWS_RSS_MAX_ITEMS ) { break; } } } echo ''; echo ''; echo ''; echo '
'; echo '
'; echo '
'; echo '
'; $cpt=0; foreach ($articles as $article ) { $cpt_prev=$cpt-1; $cpt_next=$cpt+1; echo ''; echo "
\n"; echo "
"; echo ""; $article_content = file_get_contents($article['link']); $article_content_utf8 = mb_convert_encoding($article_content, 'HTML-ENTITIES', "UTF-8"); $doc = new DOMDocument(); $doc->preserveWhiteSpace = false; $doc->formatOutput = true; $doc->loadHTML($article_content_utf8); $articles = $doc->getElementsByTagName('article'); $article_only=""; foreach ( $articles as $node) { $article_only = DOMinnerHTML($node); } $SEARCH_SUB='
     '; echo '     '; echo '     '; echo ''; echo '
'.$article_only.'
'; echo '     '; echo '     '; echo '     '; echo '     '; echo '
'; $cpt++; if( $cpt > $NEWS_RSS_MAX_ITEMS ) { break; } } ?>