From f17574c2b053e7fb0fb81f76a05ef3b8d21efa78 Mon Sep 17 00:00:00 2001 From: Alessandro Cosentino Date: Fri, 19 Oct 2012 14:14:49 -0400 Subject: index accepts feedid as parameter; fix to make the search provider work and to have nice urls anyway --- controllers/news.controller.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'controllers') diff --git a/controllers/news.controller.php b/controllers/news.controller.php index 814f90d10..be3cdbf08 100644 --- a/controllers/news.controller.php +++ b/controllers/news.controller.php @@ -50,10 +50,11 @@ class NewsController extends Controller { $feedMapper = new FeedMapper($this->userId); $itemMapper = new ItemMapper($this->userId); - // always show the last viewed feed on reload - $lastViewedFeedId = (int)$this->getUserValue('lastViewedFeed'); - $lastViewedFeedType = (int)$this->getUserValue('lastViewedFeedType'); - $showAll = $this->getUserValue('showAll'); + // if no feed id is passed as parameter, then show the last viewed feed on reload + $lastViewedFeedId = isset( $_GET['feedid'] ) ? $_GET['feedid'] : (int)$this->getUserValue('lastViewedFeed'); + $lastViewedFeedType = isset( $_GET['feedid'] ) ? FeedType::FEED : (int)$this->getUserValue('lastViewedFeedType'); + + $showAll = $this->getUserValue('showAll'); if( $lastViewedFeedId === null || $lastViewedFeedType === null) { $lastViewedFeedId = $feedMapper->mostRecent(); -- cgit v1.2.3