From 6cfea5c790194e19c723d67a413df51635300342 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 30 Apr 2008 01:36:00 +0100 Subject: add (disabled) group-by-feed for vfeeds (_VFEED_GROUP_BY_FEED) --- functions.php | 47 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 9 deletions(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index 3390eca82..426566ecc 100644 --- a/functions.php +++ b/functions.php @@ -3266,6 +3266,12 @@ $offset_query_part = "OFFSET $offset"; } + if ($vfeed_query_part && defined('_VFEED_GROUP_BY_FEED')) { + if (!$override_order) { + $order_by = "ttrss_feeds.id, $order_by"; + } + } + $query = "SELECT guid, ttrss_entries.id,ttrss_entries.title, @@ -4819,7 +4825,8 @@ error_reporting (DEFAULT_ERROR_LEVEL); $num_unread = 0; - + $cur_feed_title = ''; + while ($line = db_fetch_assoc($result)) { $class = ($lnum % 2) ? "even" : "odd"; @@ -4905,6 +4912,15 @@ } if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { + + if (defined('_VFEED_GROUP_BY_FEED')) { + if ($line["feed_title"] != $cur_feed_title) { + print "". + "". + $line["feed_title"].":"; + $cur_feed_title = $line["feed_title"]; + } + } print ""; @@ -4941,11 +4957,13 @@ # ". # $line["feed_title"]." - if ($line["feed_title"]) { - print " - (". - $line["feed_title"].") - "; + if (!defined('_VFEED_GROUP_BY_FEED')) { + if ($line["feed_title"]) { + print " + (". + $line["feed_title"].") + "; + } } @@ -4958,7 +4976,16 @@ print ""; } else { - + + if (defined('_VFEED_GROUP_BY_FEED')) { + if ($line["feed_title"] != $cur_feed_title) { + print "
". + "". + $line["feed_title"]."
"; + $cur_feed_title = $line["feed_title"]; + } + } + if ($is_unread) { $add_class = "Unread"; } else { @@ -4994,8 +5021,10 @@ } - if ($line["feed_title"]) { - print " (".$line["feed_title"].")"; + if (!defined('_VFEED_GROUP_BY_FEED')) { + if ($line["feed_title"]) { + print " (".$line["feed_title"].")"; + } } print ""; -- cgit v1.2.3