issue 2192, Get thumbnail when rss/atom

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.1@10958 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2012-07-31 05:10:30 +00:00
parent f240a210b6
commit 3f8aed1b8b

View file

@ -443,6 +443,7 @@
//$content_item->setCategory($item->category);
$item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->description);
$content_item->setContent($this->_getSummary($item->description, $args->content_cut_size));
$content_item->setThumbnail($this->_getRssThumbnail($item->description));
$content_item->setLink($item->link);
$date = date('YmdHis', strtotime(max($item->pubdate,$item->pubDate,$item->{'dc:date'})));
$content_item->setRegdate($date);
@ -477,6 +478,7 @@
//$content_item->setCategory($item->category);
$item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->description);
$content_item->setContent($this->_getSummary($item->description, $args->content_cut_size));
$content_item->setThumbnail($this->_getRssThumbnail($item->description));
$content_item->setLink($item->link);
$date = date('YmdHis', strtotime(max($item->pubdate,$item->pubDate,$item->{'dc:date'})));
$content_item->setRegdate($date);
@ -544,6 +546,7 @@
}
}
$content_item->setContent($this->_getSummary($item->description, $args->content_cut_size));
$content_item->setThumbnail($this->_getRssThumbnail($item->description));
$content_item->setLink($item->link);
$date = date('YmdHis', strtotime(max($item->published,$item->updated,$item->{'dc:date'})));
$content_item->setRegdate($date);
@ -554,6 +557,13 @@
return $content_items;
}
function _getRssThumbnail($content)
{
@preg_match('@<img[^>]+src *= *(?:"(.+)"|\'(.+)\'|([^ ]+))@', $content, $matches);
return $matches[1];
}
function _getTrackbackItems($args){
// Get categories
$output = executeQueryArray('widgets.content.getCategories',$obj);