Fix bug on nav item when bookmarking an item

This commit is contained in:
Frederic Guillot 2013-08-04 15:57:43 -04:00
parent d12fa5b76b
commit 97b45bebe5
2 changed files with 4 additions and 5 deletions

View File

@ -486,8 +486,7 @@ function get_nav_item($item, $status = array('unread'), $bookmark = array(1, 0))
{
$items = \PicoTools\singleton('db')
->table('items')
->columns('id', 'status', 'title')
->in('bookmark', $bookmark)
->columns('id', 'status', 'title', 'bookmark')
->neq('status', 'removed')
->desc('updated')
->findAll();
@ -505,7 +504,7 @@ function get_nav_item($item, $status = array('unread'), $bookmark = array(1, 0))
while ($j >= 0) {
if (in_array($items[$j]['status'], $status)) {
if (in_array($items[$j]['status'], $status) && in_array($items[$j]['bookmark'], $bookmark)) {
$previous_item = $items[$j];
break;
}
@ -520,7 +519,7 @@ function get_nav_item($item, $status = array('unread'), $bookmark = array(1, 0))
while ($j < $ilen) {
if (in_array($items[$j]['status'], $status)) {
if (in_array($items[$j]['status'], $status) && in_array($items[$j]['bookmark'], $bookmark)) {
$next_item = $items[$j];
break;
}

View File

@ -53,7 +53,7 @@
<?php elseif (! $item_nav['previous'] && $item_nav['next']): ?>
<a href="?action=<?= $menu ?>&amp;feed_id=<?= $feed['id'] ?>#item-<?= $item_nav['next']['id'] ?>"><?= t('Listing') ?></a>
<?php elseif (! $item_nav['previous'] && ! $item_nav['next']): ?>
<a href="?action=<?= $menu ?>&amp;feed_id=<?= $feed['id'] ?>"><?= t('Unread items') ?></a>
<a href="?action=<?= $menu ?>&amp;feed_id=<?= $feed['id'] ?>"><?= t('Listing') ?></a>
<?php endif ?>
</span>