summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-10-02 06:02:01 +0100
committerAndrew Dolgov <[email protected]>2006-10-02 06:02:01 +0100
commite8b8485f560d581126490b25be3a052d0d4fd516 (patch)
treec6f818d007956d9f85b82e891440e4dfc1dc2e1d /functions.php
parent525b61a237b49e03280f2167f355752ae5dc8628 (diff)
getFeedUnread: add parent feed id when calculating counts for linked feeds
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/functions.php b/functions.php
index f6a516423..3eaa5925b 100644
--- a/functions.php
+++ b/functions.php
@@ -1542,7 +1542,8 @@
$match_part = "marked = true";
} else if ($n_feed > 0) {
- $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE parent_feed = '$n_feed'
+ $result = db_query($link, "SELECT id FROM ttrss_feeds
+ WHERE parent_feed = '$n_feed'
AND hidden = false
AND owner_uid = " . $_SESSION["uid"]);
@@ -1552,12 +1553,15 @@
while ($line = db_fetch_assoc($result)) {
array_push($linked_feeds, "feed_id = " . $line["id"]);
}
+
+ array_push($linked_feeds, "feed_id = $n_feed");
$match_part = implode(" OR ", $linked_feeds);
$result = db_query($link, "SELECT COUNT(int_id) AS unread
FROM ttrss_user_entries
- WHERE unread = true AND ($match_part) AND owner_uid = " . $_SESSION["uid"]);
+ WHERE unread = true AND ($match_part)
+ AND owner_uid = " . $_SESSION["uid"]);
$unread = 0;