diff --git a/.gitignore b/.gitignore index 9b8d154..dae60d5 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,7 @@ # OS generated files # ###################### -.DS_Store? +.DS_Store ehthumbs.db Icon? Thumbs.db diff --git a/index.php b/index.php index 1c630d3..429c9ac 100644 --- a/index.php +++ b/index.php @@ -96,11 +96,14 @@ Router\get_action('show-help', function() { Router\get_action('show', function() { $id = Model\decode_item_id(Request\param('id')); + $item = Model\get_item($id); + $feed = Model\get_feed($item['feed_id']); Model\set_item_read($id); Response\html(Template\layout('show_item', array( - 'item' => Model\get_item($id), + 'item' => $item, + 'feed' => $feed, 'menu' => 'show' ))); }); @@ -111,12 +114,14 @@ Router\get_action('read', function() { $id = Model\decode_item_id(Request\param('id')); $item = Model\get_item($id); + $feed = Model\get_feed($item['feed_id']); $nav = Model\get_nav_item($item); // must be placed before set_item_read() Model\set_item_read($id); Response\html(Template\layout('show_item', array( 'item' => $item, + 'feed' => $feed, 'item_nav' => $nav, 'menu' => 'read' ))); diff --git a/model.php b/model.php index b4adf02..477da44 100644 --- a/model.php +++ b/model.php @@ -327,7 +327,7 @@ function get_unread_items($offset = null, $limit = null) { return \PicoTools\singleton('db') ->table('items') - ->columns('items.id', 'items.title', 'items.updated', 'items.url', 'items.content', 'items.bookmark', 'items.status', 'feeds.site_url') + ->columns('items.id', 'items.title', 'items.updated', 'items.url', 'items.content', 'items.bookmark', 'items.status', 'feeds.site_url', 'feeds.title AS feed_title') ->join('feeds', 'id', 'feed_id') ->eq('status', 'unread') ->desc('updated') @@ -350,7 +350,7 @@ function get_read_items($offset = null, $limit = null) { return \PicoTools\singleton('db') ->table('items') - ->columns('items.id', 'items.title', 'items.updated', 'items.url', 'items.bookmark', 'feeds.site_url') + ->columns('items.id', 'items.title', 'items.updated', 'items.url', 'items.bookmark', 'feeds.site_url', 'feeds.title AS feed_title') ->join('feeds', 'id', 'feed_id') ->eq('status', 'read') ->desc('updated') @@ -374,7 +374,7 @@ function get_bookmarks($offset = null, $limit = null) { return \PicoTools\singleton('db') ->table('items') - ->columns('items.id', 'items.title', 'items.updated', 'items.url', 'items.status', 'feeds.site_url') + ->columns('items.id', 'items.title', 'items.updated', 'items.url', 'items.status', 'feeds.site_url', 'feeds.title AS feed_title') ->join('feeds', 'id', 'feed_id') ->in('status', array('read', 'unread')) ->eq('bookmark', 1) @@ -412,7 +412,7 @@ function get_feed_items($feed_id, $offset = null, $limit = null) function get_item($id) { - return \PicoTools\singleton('db') + return \PicoTools\singleton('db') ->table('items') ->eq('id', $id) ->findOne(); diff --git a/templates/bookmarks.php b/templates/bookmarks.php index 899bc2a..0019c6c 100644 --- a/templates/bookmarks.php +++ b/templates/bookmarks.php @@ -22,6 +22,7 @@

+ | | | | diff --git a/templates/history.php b/templates/history.php index 9c39398..0358a38 100644 --- a/templates/history.php +++ b/templates/history.php @@ -24,6 +24,7 @@

+ | | | diff --git a/templates/show_item.php b/templates/show_item.php index 632438b..31dd1b9 100644 --- a/templates/show_item.php +++ b/templates/show_item.php @@ -12,6 +12,7 @@

+ | | | diff --git a/templates/unread_items.php b/templates/unread_items.php index f3b4f8d..5cf6675 100644 --- a/templates/unread_items.php +++ b/templates/unread_items.php @@ -33,6 +33,7 @@

+ | | |