Fix bug on nav item for the page "feed-items"

This commit is contained in:
Frederic Guillot 2013-08-04 16:23:00 -04:00
parent dafa3c9a4c
commit ea1c5fdfbf
2 changed files with 8 additions and 5 deletions

View File

@ -105,7 +105,7 @@ Router\get_action('show', function() {
$nav = Model\get_nav_item($item, array('read'));
break;
case 'feed-items':
$nav = Model\get_nav_item($item, array('unread', 'read'));
$nav = Model\get_nav_item($item, array('unread', 'read'), array(1, 0), $item['feed_id']);
break;
case 'bookmarks':
$nav = Model\get_nav_item($item, array('unread', 'read'), array(1));

View File

@ -482,14 +482,17 @@ function get_item($id)
}
function get_nav_item($item, $status = array('unread'), $bookmark = array(1, 0))
function get_nav_item($item, $status = array('unread'), $bookmark = array(1, 0), $feed_id = null)
{
$items = \PicoTools\singleton('db')
$query = \PicoTools\singleton('db')
->table('items')
->columns('id', 'status', 'title', 'bookmark')
->neq('status', 'removed')
->desc('updated')
->findAll();
->desc('updated');
if ($feed_id) $query->eq('feed_id', $feed_id);
$items = $query->findAll();
$next_item = null;
$previous_item = null;