From 03e5f9eb02d7f4f7144a0829968a7e087269ee05 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 16 Dec 2009 13:07:02 +0300 Subject: [PATCH] api: add getUnread --- api/index.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/index.php b/api/index.php index 3bb83e1b..b0a084ce 100644 --- a/api/index.php +++ b/api/index.php @@ -73,6 +73,16 @@ case "isLoggedIn": print json_encode(array("status" => $_SESSION["uid"] != '')); break; + case "getUnread": + $feed_id = db_escape_string($_REQUEST["feed_id"]); + $is_cat = db_escape_string($_REQUEST["is_cat"]); + + if ($feed_id) { + print json_encode(array("unread" => getFeedUnread($link, $feed_id, $is_cat))); + } else { + print json_encode(array("unread" => getGlobalUnread($link))); + } + break; case "getFeeds": $cat_id = db_escape_string($_REQUEST["cat_id"]); $unread_only = (bool)db_escape_string($_REQUEST["unread_only"]); -- 2.39.5