Fix: Rss parsing

This commit is contained in:
Laurent Destailleur 2011-08-28 15:38:54 +00:00
parent f4e6c0413b
commit 99bf6b91c1

View File

@ -149,7 +149,7 @@ class RssParser
$status = xml_parse( $xmlparser, $str ); $status = xml_parse( $xmlparser, $str );
xml_parser_free( $xmlparser ); xml_parser_free( $xmlparser );
$rss=$this; $rss=$this;
//var_dump($this);exit; //var_dump($rss->_format);exit;
} }
// If $rss loaded // If $rss loaded
@ -196,14 +196,15 @@ class RssParser
} }
else else
{ {
if (!empty($rss->channel['rss_language'])) $this->_language = (string) $rss->channel['rss_language']; //var_dump($rss->channel);
if (!empty($rss->channel['rss_generator'])) $this->_generator = (string) $rss->channel['rss_generator']; if (!empty($rss->channel['language'])) $this->_language = (string) $rss->channel['language'];
if (!empty($rss->channel['rss_copyright'])) $this->_copyright = (string) $rss->channel['rss_copyright']; if (!empty($rss->channel['generator'])) $this->_generator = (string) $rss->channel['generator'];
if (!empty($rss->channel['rss_lastbuilddate'])) $this->_lastbuilddate = (string) $rss->channel['rss_lastbuilddate']; if (!empty($rss->channel['copyright'])) $this->_copyright = (string) $rss->channel['copyright'];
if (!empty($rss->image['rss_url'])) $this->_imageurl = (string) $rss->image['rss_url']; if (!empty($rss->channel['lastbuilddate'])) $this->_lastbuilddate = (string) $rss->channel['lastbuilddate'];
if (!empty($rss->channel['rss_link'])) $this->_link = (string) $rss->channel['rss_link']; if (!empty($rss->image['url'])) $this->_imageurl = (string) $rss->image['url'];
if (!empty($rss->channel['rss_title'])) $this->_title = (string) $rss->channel['rss_title']; if (!empty($rss->channel['link'])) $this->_link = (string) $rss->channel['link'];
if (!empty($rss->channel['rss_description'])) $this->_description = (string) $rss->channel['rss_description']; if (!empty($rss->channel['title'])) $this->_title = (string) $rss->channel['title'];
if (!empty($rss->channel['description'])) $this->_description = (string) $rss->channel['description'];
} }
if (! empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) $items=$rss->channel->item; // With simplexml if (! empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) $items=$rss->channel->item; // With simplexml
@ -255,12 +256,12 @@ class RssParser
} }
else else
{ {
$itemLink = (string) $item['rss_link']; $itemLink = (string) $item['link'];
$itemTitle = (string) $item['rss_title']; $itemTitle = (string) $item['title'];
$itemDescription = (string) $item['rss_description']; $itemDescription = (string) $item['description'];
$itemPubDate = (string) $item['rss_pubdate']; $itemPubDate = (string) $item['pubdate'];
$itemId = (string) $item['rss_guid']; $itemId = (string) $item['guid'];
$itemAuthor = (string) $item['rss_author']; $itemAuthor = (string) $item['author'];
} }
// Loop on each category // Loop on each category
@ -305,6 +306,7 @@ class RssParser
'category'=>$itemCategory, 'category'=>$itemCategory,
'id'=>$itemId, 'id'=>$itemId,
'author'=>$itemAuthor); 'author'=>$itemAuthor);
//var_dump($this->_rssarray);
$i++; $i++;