]> git.wh0rd.org Git - tt-rss.git/commitdiff
implement recently read vfeed (-6)
authorAndrew Dolgov <fox@fakecake.org>
Mon, 27 Aug 2012 06:08:11 +0000 (10:08 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Mon, 27 Aug 2012 06:08:11 +0000 (10:08 +0400)
classes/pref/feeds.php
images/recently_read.png [new file with mode: 0644]
include/functions.php

index 5899115b421d183c0300a1cd19c2ebd5e22ea199..b81f8265fdeb13e302049ecf21f62038d7ac1770 100644 (file)
@@ -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 (file)
index 0000000..ac1bf17
Binary files /dev/null and b/images/recently_read.png differ
index 262b544bb7927a53a75e40369bbc12ba9ea2b7ae..9f0ae7306f62283ce89223ddd2a3aa2b0d3178f8 100644 (file)
 
                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);
 
                case -4:
                        return "images/tag.png";
                        break;
+               case -6:
+                       return "images/recently_read.png";
+                       break;
                default:
                        if ($id < -10) {
                                return "images/label.png";
                        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'");
                                                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";