fix getGlobalCounters re hidden feeds

This commit is contained in:
Andrew Dolgov 2006-08-16 13:53:04 +01:00
parent cfb0213179
commit 3831db41c4
1 changed files with 4 additions and 2 deletions

View File

@ -1553,10 +1553,12 @@
/* FIXME this needs reworking */
function getGlobalUnread($link) {
$result = db_query($link, "SELECT count(id) as c_id FROM ttrss_entries,ttrss_user_entries
$result = db_query($link, "SELECT count(ttrss_entries.id) as c_id FROM ttrss_entries,ttrss_user_entries,ttrss_feeds
WHERE unread = true AND
ttrss_user_entries.feed_id = ttrss_feeds.id AND
ttrss_user_entries.ref_id = ttrss_entries.id AND
owner_uid = " . $_SESSION["uid"]);
hidden = false AND
ttrss_user_entries.owner_uid = " . $_SESSION["uid"]);
$c_id = db_fetch_result($result, 0, "c_id");
return $c_id;
}