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; $article['pubDate'] = $item->pubDate; $article['timestamp'] = strtotime($item->pubDate); $article['description'] = $item->description; $SEARCH_SUB1='

description, $SEARCH_SUB2, $pos_start); $height=substr($item->description, $pos_start, $pos_stop - $pos_start); $article['width']=1024; $article['height']=$height; $SEARCH_SUB1='src="'; $pos_start = strpos($item->description, $SEARCH_SUB1); $pos_start += strlen($SEARCH_SUB1); $SEARCH_SUB2="\""; $pos_stop = strpos($item->description, $SEARCH_SUB2, $pos_start); $article['image']=$item->mediacontent['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 "\n"; echo ''; echo "\n"; echo "
\n"; echo "
"; echo ""; $article_content = file_get_contents($article['link']); $doc = new DOMDocument(); $doc->preserveWhiteSpace = false; $doc->formatOutput = true; $doc->loadHTML($article_content); $articles = $doc->getElementsByTagName('article'); foreach ( $articles as $node) { $article_only = DOMinnerHTML($node); } $orgStrings = array( '', ' width="500" height="281" frameborder="0" '); $newStrings = array( '"; } $re = '/alt="(.+?)" width="(.+?)" height="(.+?)"/'; $temp = preg_replace($re, 'width="100%"', $article_only); $article_only = $temp; $re = '/alt="" width="(.+?)" height="(.+?)"/'; $temp = preg_replace($re, 'width="100%"', $article_only); $article_only = $temp; $re = '/