summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-12-28 18:43:16 +0300
committerAndrew Dolgov <[email protected]>2009-12-28 18:43:16 +0300
commitdbfc43651935533c07244257225926b6a120518f (patch)
tree0f941a051b9ce09f31fd199868421fdee0f6d259 /functions.php
parent16857aa0397727676a4272e4ebc050cf3a4c2275 (diff)
getFeedUnread: fix incorrect counters being returned
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/functions.php b/functions.php
index 5c285c4e2..8650ceb9c 100644
--- a/functions.php
+++ b/functions.php
@@ -2490,7 +2490,7 @@
$match_part = implode(" OR ", $linked_feeds);
- $result = db_query($link, "SELECT COUNT(int_id) AS unread
+ $tmp_result = db_query($link, "SELECT COUNT(int_id) AS unread
FROM ttrss_user_entries,ttrss_entries
WHERE $unread_qpart AND
ttrss_user_entries.ref_id = ttrss_entries.id AND
@@ -2501,7 +2501,7 @@
$unread = 0;
# this needs to be rewritten
- while ($line = db_fetch_assoc($result)) {
+ while ($line = db_fetch_assoc($tmp_result)) {
$unread += $line["unread"];
}
@@ -2532,11 +2532,14 @@
$from_qpart = "ttrss_user_entries,ttrss_entries";
}
- $result = db_query($link, "SELECT count(int_id) AS unread
+ $query = "SELECT count(int_id) AS unread
FROM $from_qpart WHERE
ttrss_user_entries.ref_id = ttrss_entries.id AND
$age_qpart AND
- $unread_qpart AND ($match_part) AND ttrss_user_entries.owner_uid = " . $owner_uid);
+ $feeds_qpart
+ $unread_qpart AND ($match_part) AND ttrss_user_entries.owner_uid = $owner_uid";
+
+ $result = db_query($link, $query);
} else {