From: Andrew Dolgov Date: Mon, 27 Aug 2012 06:08:11 +0000 (+0400) Subject: implement recently read vfeed (-6) X-Git-Tag: 1.6.0~105 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=5417fbd77e363a9a777d05f33d1ac40652fc4dee;p=tt-rss.git implement recently read vfeed (-6) --- diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 5899115b..b81f8265 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -110,7 +110,7 @@ class Pref_Feeds extends Handler_Protected { $cat['items'] = array(); } - foreach (array(-4, -3, -1, -2, 0) as $i) { + foreach (array(-4, -3, -1, -2, 0, -6) as $i) { array_push($cat['items'], $this->feedlist_init_feed($i)); } diff --git a/images/recently_read.png b/images/recently_read.png new file mode 100644 index 00000000..ac1bf178 Binary files /dev/null and b/images/recently_read.png differ diff --git a/include/functions.php b/include/functions.php index 262b544b..9f0ae730 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1551,7 +1551,9 @@ if ($is_cat) { return getCategoryUnread($link, $n_feed, $owner_uid); - } if ($feed != "0" && $n_feed == 0) { + } else if ($n_feed == -6) { + return 0; + } else if ($feed != "0" && $n_feed == 0) { $feed = db_escape_string($feed); @@ -2077,6 +2079,9 @@ case -4: return "images/tag.png"; break; + case -6: + return "images/recently_read.png"; + break; default: if ($id < -10) { return "images/label.png"; @@ -2099,6 +2104,8 @@ return __("All articles"); } else if ($id === 0 || $id === "0") { return __("Archived articles"); + } else if ($id == -6) { + return __("Recently read"); } else if ($id < -10) { $label_id = -$id - 11; $result = db_query($link, "SELECT caption FROM ttrss_labels2 WHERE id = '$label_id'"); @@ -2458,7 +2465,10 @@ ttrss_user_labels2.article_id = ref_id"; } - + } else if ($feed == -6) { // recently read + $query_strategy_part = "unread = false"; + $vfeed_query_part = "ttrss_feeds.title AS feed_title,"; + $override_order = "last_read DESC"; } else if ($feed == -3) { // fresh virtual feed $query_strategy_part = "unread = true AND score >= 0";