From 081e527d3a9473fb1468f86b25c854e912fd775b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 17 May 2008 05:42:20 +0100 Subject: vfeed grouping: prevent duplicate group headings --- functions.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index e9134328c..693b3ddc1 100644 --- a/functions.php +++ b/functions.php @@ -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; @@ -4784,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); } @@ -4927,17 +4929,13 @@ if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { if (defined('_VFEED_GROUP_BY_FEED')) { - if ($line["feed_title"] != $cur_feed_title) { + if ($feed_id != $vgroup_last_feed) { $cur_feed_title = $line["feed_title"]; + $vgroup_last_feed = $feed_id; -/* print "". - $line["feed_title"]. - " (". - "more)"; */ - $vf_catchup_link = "(select, - mark as read)"; + $vf_catchup_link = "(mark as read)"; print "". "". @@ -5003,11 +5001,16 @@ } else { if (defined('_VFEED_GROUP_BY_FEED')) { - if ($line["feed_title"] != $cur_feed_title) { + 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"; } } @@ -5199,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 -- cgit v1.2.3