Skip to content
Snippets Groups Projects
Commit 03e5f9eb authored by Andrew Dolgov's avatar Andrew Dolgov
Browse files

api: add getUnread

parent 730c97c7
No related branches found
No related tags found
No related merge requests found
...@@ -73,6 +73,16 @@ ...@@ -73,6 +73,16 @@
case "isLoggedIn": case "isLoggedIn":
print json_encode(array("status" => $_SESSION["uid"] != '')); print json_encode(array("status" => $_SESSION["uid"] != ''));
break; 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": case "getFeeds":
$cat_id = db_escape_string($_REQUEST["cat_id"]); $cat_id = db_escape_string($_REQUEST["cat_id"]);
$unread_only = (bool)db_escape_string($_REQUEST["unread_only"]); $unread_only = (bool)db_escape_string($_REQUEST["unread_only"]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment