diff --git a/backend.php b/backend.php index 956ff2e46..810097a41 100644 --- a/backend.php +++ b/backend.php @@ -1,18 +1,22 @@ "; } @@ -55,9 +59,11 @@ function getTagCounters($link) { $result = db_query($link, "SELECT tag_name,count(ttrss_entries.id) AS count FROM ttrss_tags,ttrss_entries WHERE + ttrss_tags.owner_uid = ".$_SESSION["uid"]." AND post_id = ttrss_entries.id AND unread = true GROUP BY tag_name UNION - select tag_name,0 as count FROM ttrss_tags"); + select tag_name,0 as count FROM ttrss_tags + WHERE ttrss_tags.owner_uid = ".$_SESSION["uid"]); $tags = array(); @@ -76,14 +82,14 @@ function getLabelCounters($link) { $result = db_query($link, "SELECT count(id) as count FROM ttrss_entries - WHERE marked = true AND unread = true"); + WHERE marked = true AND unread = true AND owner_uid = ".$_SESSION["uid"]); $count = db_fetch_result($result, 0, "count"); print "