diff options
author | Andrew Dolgov <[email protected]> | 2011-04-14 21:00:36 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-04-14 21:00:36 +0400 |
commit | a0e580b0ca6e42362e692240cd1193907b8b230b (patch) | |
tree | 15899699e39f1038ccf0df36fcdac36403d6dbd5 | |
parent | 133ab8c713b28e41c2628f02f176ef8b5a0b524d (diff) |
api/getHeadlines: add include_attachments parameter
-rw-r--r-- | api/index.php | 4 | ||||
-rw-r--r-- | functions.php | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/api/index.php b/api/index.php index ea267ca8e..01328b9a7 100644 --- a/api/index.php +++ b/api/index.php @@ -184,9 +184,11 @@ $show_content = (bool)db_escape_string($_REQUEST["show_content"]); /* all_articles, unread, adaptive, marked, updated */ $view_mode = db_escape_string($_REQUEST["view_mode"]); + $include_attachments = (bool)db_escape_string($_REQUEST["include_attachments"]); $headlines = api_get_headlines($link, $feed_id, $limit, $offset, - $filter, $is_cat, $show_excerpt, $show_content, $view_mode, false); + $filter, $is_cat, $show_excerpt, $show_content, $view_mode, false, + $include_attachments); print api_wrap_reply(API_STATUS_OK, $seq, $headlines); diff --git a/functions.php b/functions.php index e427339e5..0a2345ff6 100644 --- a/functions.php +++ b/functions.php @@ -6694,7 +6694,8 @@ } function api_get_headlines($link, $feed_id, $limit, $offset, - $filter, $is_cat, $show_excerpt, $show_content, $view_mode, $order) { + $filter, $is_cat, $show_excerpt, $show_content, $view_mode, $order, + $include_attachments) { /* do not rely on params below */ @@ -6728,6 +6729,10 @@ "tags" => get_article_tags($link, $line["id"]), ); + if ($include_attachments) + $headline_row['attachments'] = get_article_enclosures($link, + $line['id']); + if ($show_excerpt) { $excerpt = truncate_string(strip_tags($line["content_preview"]), 100); $headline_row["excerpt"] = $excerpt; |