Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Server
Tiny Tiny RSS
Commits
a0e580b0
Commit
a0e580b0
authored
Apr 14, 2011
by
Andrew Dolgov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api/getHeadlines: add include_attachments parameter
parent
133ab8c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
api/index.php
api/index.php
+3
-1
functions.php
functions.php
+6
-1
No files found.
api/index.php
View file @
a0e580b0
...
...
@@ -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
);
...
...
functions.php
View file @
a0e580b0
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment