From 0af33e8790287d75f404ebbbc2f3edd88b397cfd Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 14 Jun 2006 04:21:19 +0100 Subject: [PATCH] fix: feed browser entry limit is broken (closes #68) --- backend.php | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/backend.php b/backend.php index 6b999cdf..7421f781 100644 --- a/backend.php +++ b/backend.php @@ -1313,11 +1313,19 @@ print "

Showing top 25 registered feeds, sorted by popularity:

"; - $result = db_query($link, "SELECT feed_url,count(id) AS subscribers - FROM ttrss_feeds - WHERE auth_login = '' AND auth_pass = '' AND private = false - GROUP BY feed_url ORDER BY subscribers DESC LIMIT 25"); - +# $result = db_query($link, "SELECT feed_url,count(id) AS subscribers +# FROM ttrss_feeds +# WHERE auth_login = '' AND auth_pass = '' AND private = false +# GROUP BY feed_url ORDER BY subscribers DESC LIMIT 25"); + + $owner_uid = $_SESSION["uid"]; + + $result = db_query($link, "SELECT feed_url,COUNT(id) AS subscribers + FROM ttrss_feeds WHERE (SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf + WHERE tf.feed_url = ttrss_feeds.feed_url + AND owner_uid = '$owner_uid') GROUP BY feed_url + ORDER BY subscribers DESC LIMIT 25"); + print "