From 01b48e74b7e40029c964437e5d90c01e26c1f5aa Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 9 Dec 2008 23:15:11 +0000 Subject: [PATCH] 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() --- code/RSSWidget.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/code/RSSWidget.php b/code/RSSWidget.php index 77be619..be20c9f 100644 --- a/code/RSSWidget.php +++ b/code/RSSWidget.php @@ -45,18 +45,18 @@ class RSSWidget extends Widget { function FeedItems() { $output = new DataObjectSet(); - if(class_exists('SimplePie')) { - $this->feed = new SimplePie($this->AbsoluteRssUrl); - $this->feed->init(); - if($items = $this->feed->get_items(0, $this->NumberToShow)) { - foreach($items as $item) { - $output->push(new ArrayData(array( - "Title" => $item->get_title(), - "Link" => $item->get_link() - ))); - } - return $output; + include_once(Director::getAbsFile(SAPPHIRE_DIR . '/thirdparty/simplepie/SimplePie.php')); + + $this->feed = new SimplePie($this->AbsoluteRssUrl); + $this->feed->init(); + if($items = $this->feed->get_items(0, $this->NumberToShow)) { + foreach($items as $item) { + $output->push(new ArrayData(array( + "Title" => $item->get_title(), + "Link" => $item->get_link() + ))); } + return $output; } } }