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'] . '

'; $cpt=0; foreach ($xml->channel->item as $item) { $article = array(); $article['title'] = $item->title; $article['link'] = $item->link; $orgStrings = array('?xtor=RSS-3208'); $newStrings = array(''); $article['link'] = str_replace($orgStrings, $newStrings, $article['link']); $article['pubDate'] = $item->pubDate; $article['timestamp'] = strtotime($item->pubDate); $article['description'] = $item->description; $article['image'] = $item->enclosure['url']; $articles[$cpt] = $article; echo '
'; 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 = http_get_contents($article['link']); $doc = new DOMDocument(); $doc->preserveWhiteSpace = false; $doc->formatOutput = true; $doc->loadHTML($article_content); $articles = $doc->getElementsByTagName('article'); $article_only=""; foreach ( $articles as $node) { $article_only = DOMinnerHTML($node); } $orgStrings = array( ' href="/', ' src="/sites/', '', '
', '
', '
', '
', '

', '

', '

', '

' ); $newStrings = array('

', '
', '
', '
', '
', '', '

', '

', '

'); $article_only = str_replace($orgStrings, $newStrings, $article_only); $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 = '/ style="height:(.+?)width: 640px;">/'; $temp = preg_replace($re, '>', $article_only); $article_only = $temp; $re = '/