From: Andrew Dolgov Date: Mon, 1 Apr 2013 10:08:17 +0000 (+0400) Subject: api, also hide uncategorized if empty X-Git-Tag: 1.7.6~71 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=dc5a8a21a88e1d13e3188cd4757b2c41471c70f7;p=tt-rss.git api, also hide uncategorized if empty --- diff --git a/classes/api.php b/classes/api.php index d3b61c15..ea57a61a 100644 --- a/classes/api.php +++ b/classes/api.php @@ -727,7 +727,7 @@ class API extends Handler { } - // only works for labels for the time being + // only works for labels or uncategorized for the time being private function isCategoryEmpty($id) { if ($id == -2) { @@ -736,6 +736,12 @@ class API extends Handler { return db_fetch_result($result, 0, "count") == 0; + } else if ($id == 0) { + $result = db_query($this->link, "SELECT COUNT(*) AS count FROM ttrss_feeds + WHERE cat_id IS NULL AND owner_uid = " . $_SESSION["uid"]); + + return db_fetch_result($result, 0, "count") == 0; + } return false;