add (disabled) group-by-feed for vfeeds (_VFEED_GROUP_BY_FEED)

This commit is contained in:
Andrew Dolgov 2008-04-30 01:36:00 +01:00
parent 708edafdca
commit 6cfea5c790
2 changed files with 55 additions and 9 deletions

View File

@ -3266,6 +3266,12 @@
$offset_query_part = "OFFSET $offset"; $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 $query = "SELECT
guid, guid,
ttrss_entries.id,ttrss_entries.title, ttrss_entries.id,ttrss_entries.title,
@ -4819,7 +4825,8 @@
error_reporting (DEFAULT_ERROR_LEVEL); error_reporting (DEFAULT_ERROR_LEVEL);
$num_unread = 0; $num_unread = 0;
$cur_feed_title = '';
while ($line = db_fetch_assoc($result)) { while ($line = db_fetch_assoc($result)) {
$class = ($lnum % 2) ? "even" : "odd"; $class = ($lnum % 2) ? "even" : "odd";
@ -4905,6 +4912,15 @@
} }
if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) {
if (defined('_VFEED_GROUP_BY_FEED')) {
if ($line["feed_title"] != $cur_feed_title) {
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"];
}
}
print "<tr class='$class' id='RROW-$id'>"; print "<tr class='$class' id='RROW-$id'>";
@ -4941,11 +4957,13 @@
# <a href=\"javascript:viewfeed($feed_id, '', false)\">". # <a href=\"javascript:viewfeed($feed_id, '', false)\">".
# $line["feed_title"]."</a> # $line["feed_title"]."</a>
if ($line["feed_title"]) { if (!defined('_VFEED_GROUP_BY_FEED')) {
print "<span class=\"hlFeed\"> if ($line["feed_title"]) {
(<a href=\"javascript:viewfeed($feed_id, '', false)\">". print "<span class=\"hlFeed\">
$line["feed_title"]."</a>) (<a href=\"javascript:viewfeed($feed_id, '', false)\">".
</span>"; $line["feed_title"]."</a>)
</span>";
}
} }
@ -4958,7 +4976,16 @@
print "</tr>"; print "</tr>";
} else { } else {
if (defined('_VFEED_GROUP_BY_FEED')) {
if ($line["feed_title"] != $cur_feed_title) {
print "<div class='cdmFeedTitle'>".
"<a href=\"javascript:viewfeed($feed_id, '', false)\">".
$line["feed_title"]."</a></div>";
$cur_feed_title = $line["feed_title"];
}
}
if ($is_unread) { if ($is_unread) {
$add_class = "Unread"; $add_class = "Unread";
} else { } else {
@ -4994,8 +5021,10 @@
} }
if ($line["feed_title"]) { if (!defined('_VFEED_GROUP_BY_FEED')) {
print "&nbsp;(<a href='javascript:viewfeed($feed_id)'>".$line["feed_title"]."</a>)"; if ($line["feed_title"]) {
print "&nbsp;(<a href='javascript:viewfeed($feed_id)'>".$line["feed_title"]."</a>)";
}
} }
print "</div>"; print "</div>";

View File

@ -1742,3 +1742,20 @@ a.visibleLink {
color : #4684ff; color : #4684ff;
} }
table.headlinesList tr.feedTitle td a, div.cdmFeedTitle a {
padding-left : 5px;
color : #4684ff;
}
div.cdmFeedTitle {
border-color : #a0a0a0;
border-width : 0px 0px 1px 0px;
border-style : solid;
padding : 5px 5px 5px 0px;
}
table.headlinesList tr.feedTitle td {
/* text-align : right;
margin-top : 10px; */
}