]> git.wh0rd.org Git - tt-rss.git/commitdiff
vfeed grouping: allow per-feed catchup
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 17 May 2008 04:26:56 +0000 (05:26 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 17 May 2008 04:26:56 +0000 (05:26 +0100)
functions.php
tt-rss.js

index 9f3505f933d421a95f56967f67544fd6c4e85ba5..e9134328c6f0b15c6566211658c5c7fd7729f083 100644 (file)
 
                if ($subop == "undefined") $subop = "";
 
+               $subop_split = split(":", $subop);
+
                if ($subop == "CatchupSelected") {
                        $ids = split(",", db_escape_string($_GET["ids"]));
                        $cmode = sprintf("%d", $_GET["cmode"]);
                        }
                }
 
+               if ($subop_split[0] == "MarkAllReadGR")  {
+                       catchup_feed($link, $subop_split[1], false);
+               }
+
+
                if ($feed_id > 0) {             
                        $result = db_query($link,
                                "SELECT id FROM ttrss_feeds WHERE id = '$feed' LIMIT 1");
 
                                        if (defined('_VFEED_GROUP_BY_FEED')) {
                                                if ($line["feed_title"] != $cur_feed_title) {
+
+                                                       $cur_feed_title = $line["feed_title"];
+
 /*                                                     print "<tr class='feedTitle'><td colspan='7'>".
                                                                $line["feed_title"].
                                                                " (<a href=\"javascript:viewfeed($feed_id, '', false)\">".
                                                                "more</a>)</td></tr>"; */
 
+                                                       $vf_catchup_link = "(<a href='javascript:'>select</a>, 
+                                                               <a href='javascript:catchupFeedInGroup($feed_id, \"$cur_feed_title\")'>mark as read</a>)";
+
                                                        print "<tr class='feedTitle'><td colspan='7'>".
                                                                "<a href=\"javascript:viewfeed($feed_id, '', false)\">".
-                                                               $line["feed_title"]."</a>:</td></tr>";
-
-                                                       $cur_feed_title = $line["feed_title"];
+                                                               $line["feed_title"]."</a> $vf_catchup_link:</td></tr>";
                                                }
                                        }
                                        
index 4fe94817970917ab047bbf64e39e6ff10ef8b56d..f6d6032753737fc3dd26dfa5566f2282a84e6249 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -648,6 +648,15 @@ function catchupCurrentFeed() {
        }
 }
 
+function catchupFeedInGroup(id, title) {
+
+       var str = __("Mark all articles in %s as read?").replace("%s", title);
+
+       if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
+               return viewCurrentFeed('MarkAllReadGR:' + id)
+       }
+}
+
 function editFeedDlg(feed) {
        try {