diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-29 13:25:04 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-29 13:30:01 +0200 |
commit | 3fc18156ae0b586e8de0c82949acfa6291317536 (patch) | |
tree | 201e97511bea44c58b5e9d78d8cf36ae2e2b54f9 /controller/itemcontroller.php | |
parent | a03b54c6a59837d0045c140ea7aef3fae95daa95 (diff) |
go back to order by id, fix #138, use a newest item id to prevent marking items as read that the user didnt see yet fix #141, also update the starred count periodically
Diffstat (limited to 'controller/itemcontroller.php')
-rw-r--r-- | controller/itemcontroller.php | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/controller/itemcontroller.php b/controller/itemcontroller.php index 459435a7e..a4d9abf3f 100644 --- a/controller/itemcontroller.php +++ b/controller/itemcontroller.php @@ -61,7 +61,6 @@ class ItemController extends Controller { $type = (int) $this->params('type'); $id = (int) $this->params('id'); $offset = (int) $this->params('offset', 0); - $newestItemId = (int) $this->params('newestItemId'); $this->api->setUserValue('lastViewedFeedId', $id); $this->api->setUserValue('lastViewedFeedType', $type); @@ -76,14 +75,12 @@ class ItemController extends Controller { if($offset === 0) { $params['newestItemId'] = $this->itemBusinessLayer->getNewestItemId($userId); - $newestItemId = $params['newestItemId']; $params['feeds'] = $this->feedBusinessLayer->findAll($userId); + $params['starred'] = $this->itemBusinessLayer->starredCount($userId); } - $params['items'] = $this->itemBusinessLayer->findAll( - $id, $type, $limit, - $offset, $newestItemId, - $showAll, $userId); + $params['items'] = $this->itemBusinessLayer->findAll($id, $type, $limit, + $offset, $showAll, $userId); // this gets thrown if there are no items // in that case just return an empty array } catch(BusinessLayerException $ex) {} @@ -92,23 +89,6 @@ class ItemController extends Controller { } - /** - * @IsAdminExemption - * @IsSubAdminExemption - * @Ajax - */ - public function starred(){ - $userId = $this->api->getUserId(); - $starredCount = $this->itemBusinessLayer->starredCount($userId); - - $params = array( - 'starred' => (int) $starredCount - ); - - return $this->renderJSON($params); - } - - private function setStarred($isStarred){ $userId = $this->api->getUserId(); $feedId = (int) $this->params('feedId'); |