diff options
author | Andrew Dolgov <[email protected]> | 2009-12-16 13:07:02 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2009-12-16 13:07:02 +0300 |
commit | 03e5f9eb02d7f4f7144a0829968a7e087269ee05 (patch) | |
tree | b99127452fb2acdc5f2c25df481b5d9cdaf3d8ad /api | |
parent | 730c97c7f32b135223c06d12fef3c3f054d48200 (diff) |
api: add getUnread
Diffstat (limited to 'api')
-rw-r--r-- | api/index.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/api/index.php b/api/index.php index 3bb83e1b5..b0a084ce1 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"]); |