Ejemplo n.º 1
0
 function getFeeds()
 {
     $cat_id = db_escape_string($_REQUEST["cat_id"]);
     $unread_only = (bool) db_escape_string($_REQUEST["unread_only"]);
     $limit = (int) db_escape_string($_REQUEST["limit"]);
     $offset = (int) db_escape_string($_REQUEST["offset"]);
     $include_nested = (bool) db_escape_string($_REQUEST["include_nested"]);
     $feeds = api_get_feeds($this->link, $cat_id, $unread_only, $limit, $offset, $include_nested);
     print $this->wrap(self::STATUS_OK, $feeds);
 }
Ejemplo n.º 2
0
 function digestinit()
 {
     $tmp_feeds = api_get_feeds($this->link, -4, true, false, 0);
     $feeds = array();
     foreach ($tmp_feeds as $f) {
         if ($f['id'] > 0 || $f['id'] == -4) {
             array_push($feeds, $f);
         }
     }
     print json_encode(array("feeds" => $feeds));
 }
Ejemplo n.º 3
0
         print api_wrap_reply(API_STATUS_OK, $seq, array("unread" => getGlobalUnread($link)));
     }
     break;
     /* Method added for ttrss-reader for Android */
 /* Method added for ttrss-reader for Android */
 case "getCounters":
     /* flct (flc is the default) FIXME: document */
     $output_mode = db_escape_string($_REQUEST["output_mode"]);
     print api_wrap_reply(API_STATUS_OK, $seq, getAllCounters($link, $output_mode));
     break;
 case "getFeeds":
     $cat_id = db_escape_string($_REQUEST["cat_id"]);
     $unread_only = (bool) db_escape_string($_REQUEST["unread_only"]);
     $limit = (int) db_escape_string($_REQUEST["limit"]);
     $offset = (int) db_escape_string($_REQUEST["offset"]);
     $feeds = api_get_feeds($link, $cat_id, $unread_only, $limit, $offset);
     print api_wrap_reply(API_STATUS_OK, $seq, $feeds);
     break;
 case "getCategories":
     $unread_only = (bool) db_escape_string($_REQUEST["unread_only"]);
     $result = db_query($link, "SELECT\n\t\t\t\t\tid, title FROM ttrss_feed_categories\n\t\t\t\tWHERE owner_uid = " . $_SESSION["uid"]);
     $cats = array();
     while ($line = db_fetch_assoc($result)) {
         $unread = getFeedUnread($link, $line["id"], true);
         if ($unread || !$unread_only) {
             array_push($cats, array("id" => $line["id"], "title" => $line["title"], "unread" => $unread));
         }
     }
     print api_wrap_reply(API_STATUS_OK, $seq, $cats);
     break;
 case "getHeadlines":