From 4356293a66c5723da19fc42a7714f7c9d720470f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 17 Nov 2005 19:04:38 +0100 Subject: [PATCH] backend.php uid-awareness work --- backend.php | 69 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 27 deletions(-) diff --git a/backend.php b/backend.php index 956ff2e4..810097a4 100644 --- a/backend.php +++ b/backend.php @@ -1,11 +1,7 @@ "; } @@ -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 "