mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
BUGFIX Fix RSS feeds in RSSWidget not working. Since SimplePie has manifest_excluse, we need to include the SimplePie.php file manually in order to use the SimplePie class for RSSWidget->FeedItems()
This commit is contained in:
parent
733cce2290
commit
01b48e74b7
@ -45,18 +45,18 @@ class RSSWidget extends Widget {
|
|||||||
function FeedItems() {
|
function FeedItems() {
|
||||||
$output = new DataObjectSet();
|
$output = new DataObjectSet();
|
||||||
|
|
||||||
if(class_exists('SimplePie')) {
|
include_once(Director::getAbsFile(SAPPHIRE_DIR . '/thirdparty/simplepie/SimplePie.php'));
|
||||||
$this->feed = new SimplePie($this->AbsoluteRssUrl);
|
|
||||||
$this->feed->init();
|
$this->feed = new SimplePie($this->AbsoluteRssUrl);
|
||||||
if($items = $this->feed->get_items(0, $this->NumberToShow)) {
|
$this->feed->init();
|
||||||
foreach($items as $item) {
|
if($items = $this->feed->get_items(0, $this->NumberToShow)) {
|
||||||
$output->push(new ArrayData(array(
|
foreach($items as $item) {
|
||||||
"Title" => $item->get_title(),
|
$output->push(new ArrayData(array(
|
||||||
"Link" => $item->get_link()
|
"Title" => $item->get_title(),
|
||||||
)));
|
"Link" => $item->get_link()
|
||||||
}
|
)));
|
||||||
return $output;
|
|
||||||
}
|
}
|
||||||
|
return $output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user