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-221'); $newStrings = array(''); $article['link'] = str_replace($orgStrings, $newStrings, $article['link']); $article['pubDate'] = $item->pubDate; $article['timestamp'] = strtotime($item->pubDate); $article['description'] = $item->description; $orgStrings = array( 'w_200,h_134,' ); $newStrings = array( 'w_2000,h_1125,' ); $article['image'] = str_replace($orgStrings, $newStrings, $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 = http_get_contents($article['link']); /* $SEARCH_SUB1='

'; $pos_start = strpos($article_content, $SEARCH_SUB1); $pos_stop = false; if(!$pos_start) { $SEARCH_SUB1='

'; $pos_start = strpos($article_content, $SEARCH_SUB1); } if($pos_start) { $SEARCH_SUB1='

'; $pos_stop = strpos($article_content, $SEARCH_SUB1); if(!$pos_stop) { $SEARCH_SUB1=''; $pos_stop = strpos($article_content, $SEARCH_SUB1); if(!$pos_stop) { $SEARCH_SUB1=''; $pos_stop = strpos($article_content, $SEARCH_SUB1); } } } if( $pos_start && $pos_stop ) { $article_only = substr($article_content, $pos_start, $pos_stop - $pos_start); } else { $article_only=""; } //echo "pos_start : $pos_start
"; //echo "pos_stop : $pos_stop
"; */ $doc = new DOMDocument(); $doc->preserveWhiteSpace = false; $doc->formatOutput = true; $libxml_previous_state = libxml_use_internal_errors(true); $doc->loadHTML($article_content); libxml_clear_errors(); libxml_use_internal_errors($libxml_previous_state); //$articles = $doc->getElementsByTagName('article_container'); $articles = $doc->getElementsByTagName('div'); $article_only=""; foreach ( $articles as $node) { if(0==strcmp("article_container",$node->getAttribute('class'))) { $article_only = DOMinnerHTML($node); } } $orgStrings = array( ' href="/', ' src="/sites/', '', '
', '
', '