From 97b45bebe56cba7cad0b970d4f6ca2407de8ad44 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 4 Aug 2013 15:57:43 -0400 Subject: [PATCH] Fix bug on nav item when bookmarking an item --- model.php | 7 +++---- templates/show_item.php | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/model.php b/model.php index b979a1f..458ef85 100644 --- a/model.php +++ b/model.php @@ -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; } diff --git a/templates/show_item.php b/templates/show_item.php index 916ef17..ab0ef77 100644 --- a/templates/show_item.php +++ b/templates/show_item.php @@ -53,7 +53,7 @@ - +