From fd24c5a4218e42d40b1fc5b46845869e2e46992a Mon Sep 17 00:00:00 2001 From: chrislemonier Date: Wed, 17 Jul 2013 16:37:32 -0700 Subject: [PATCH 1/2] Ignore Files Change --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 34ad99499122dab620d5ad7fbae68f27671a6bff Mon Sep 17 00:00:00 2001 From: Chris Lemonier Date: Thu, 18 Jul 2013 15:54:24 -0700 Subject: [PATCH 2/2] Added Feed Title to infos section In Link Post types of feed sites the url of the post may refer to a site different than the feed site. This modification shows the site name in the infos section for bookmarks, history, unread_items and show_item in addition to the url for the post --- index.php | 7 ++++++- model.php | 8 ++++---- templates/bookmarks.php | 1 + templates/history.php | 1 + templates/show_item.php | 1 + templates/unread_items.php | 1 + 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index 7d36bb7..00062ce 100644 --- a/index.php +++ b/index.php @@ -87,11 +87,14 @@ Router\post_action('login', 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' ))); }); @@ -102,12 +105,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 c2d2dfb..9dd713f 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 9571b42..3f5f488 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 6b07bd3..4312e67 100644 --- a/templates/unread_items.php +++ b/templates/unread_items.php @@ -33,6 +33,7 @@

+ | | |