X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;ds=sidebyside;f=functions.php;h=737423913d6c7c17c8d58495e84e7450834a9ee1;hb=d00f22ac59dc01f55e3cc2ccad390705537bd88e;hp=a8cb09fe40a33882c0eeba002d37401125441c59;hpb=ec92c9d1461b860856a14bb7df6668a6eea60ba5;p=tt-rss.git diff --git a/functions.php b/functions.php index a8cb09fe..73742391 100644 --- a/functions.php +++ b/functions.php @@ -1156,7 +1156,7 @@ _debug("update_rss_feed: user record not found, creating..."); } - if (!find_article_filter($article_filters, 'catchup')) { + if ($score >= -500 && !find_article_filter($article_filters, 'catchup')) { $unread = 'true'; $last_read_qpart = 'NULL'; } else { @@ -3267,7 +3267,7 @@ $offset_query_part = "OFFSET $offset"; } - if ($vfeed_query_part && defined('_VFEED_GROUP_BY_FEED')) { + if ($vfeed_query_part && get_pref($link, 'VFEED_GROUP_BY_FEED', $owner_uid)) { if (!$override_order) { $order_by = "ttrss_feeds.title, $order_by"; } @@ -4680,7 +4680,7 @@ } function outputHeadlinesList($link, $feed, $subop, $view_mode, $limit, $cat_view, - $next_unread_feed, $offset) { + $next_unread_feed, $offset, $vgr_last_feed = false) { $disable_cache = false; @@ -4694,6 +4694,8 @@ if ($subop == "undefined") $subop = ""; + $subop_split = split(":", $subop); + if ($subop == "CatchupSelected") { $ids = split(",", db_escape_string($_GET["ids"])); $cmode = sprintf("%d", $_GET["cmode"]); @@ -4715,6 +4717,11 @@ } } + 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"); @@ -4777,6 +4784,8 @@ $feed_site_url = $qfh_ret[2]; $last_error = $qfh_ret[3]; + $vgroup_last_feed = $vgr_last_feed; + if ($feed == -2) { $feed_site_url = article_publish_url($link); } @@ -4919,18 +4928,18 @@ if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { - if (defined('_VFEED_GROUP_BY_FEED')) { - if ($line["feed_title"] != $cur_feed_title) { -/* print "". - $line["feed_title"]. - " (". - "more)"; */ + if (get_pref($link, 'VFEED_GROUP_BY_FEED')) { + if ($feed_id != $vgroup_last_feed) { + + $cur_feed_title = $line["feed_title"]; + $vgroup_last_feed = $feed_id; + + + $vf_catchup_link = "(mark as read)"; print "". "". - $line["feed_title"].":"; - - $cur_feed_title = $line["feed_title"]; + $line["feed_title"]." $vf_catchup_link:"; } } @@ -4953,7 +4962,7 @@ # truncate_string($line["feed_title"],30)." "; # } else { - print ""; + print ""; print "" . $line["title"]; @@ -4969,7 +4978,7 @@ # ". # $line["feed_title"]." - if (!defined('_VFEED_GROUP_BY_FEED')) { + if (!get_pref($link, 'VFEED_GROUP_BY_FEED')) { if ($line["feed_title"]) { print " (". @@ -4983,7 +4992,7 @@ # } - print "$updated_fmt "; + print "$updated_fmt "; print "$score_pic"; @@ -4991,12 +5000,17 @@ } else { - if (defined('_VFEED_GROUP_BY_FEED')) { - if ($line["feed_title"] != $cur_feed_title) { + if (get_pref($link, 'VFEED_GROUP_BY_FEED')) { + if ($feed_id != $vgroup_last_feed) { + + $cur_feed_title = $line["feed_title"]; + $vgroup_last_feed = $feed_id; + + $vf_catchup_link = "(mark as read)"; + print "
". "". - $line["feed_title"]."
"; - $cur_feed_title = $line["feed_title"]; + $line["feed_title"]." $vf_catchup_link"; } } @@ -5037,7 +5051,7 @@ } - if (!defined('_VFEED_GROUP_BY_FEED')) { + if (!get_pref($link, 'VFEED_GROUP_BY_FEED')) { if ($line["feed_title"]) { print " (".$line["feed_title"].")"; } @@ -5188,7 +5202,7 @@ print ""; } - return array($topmost_article_ids, $headlines_count, $feed, $disable_cache); + return array($topmost_article_ids, $headlines_count, $feed, $disable_cache, $vgroup_last_feed); } // from here: http://www.roscripts.com/Create_tag_cloud-71.html @@ -5517,15 +5531,15 @@ } } - function rounded_table_start($classname) { + function rounded_table_start($classname, $header = " ") { print ""; - print ""; + print ""; print ""; - print ""; + print ""; print "
   
 $header 
 "; } - function rounded_table_end() { + function rounded_table_end($footer = " ") { print " 
   
 $footer 
"; }