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
97e5dbb2
Commit
97e5dbb2
authored
Sep 09, 2011
by
Andrew Dolgov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api: add getHeadlines since_id
parent
9a98fd9b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
api/index.php
api/index.php
+2
-1
functions.php
functions.php
+11
-3
modules/backend-rpc.php
modules/backend-rpc.php
+1
-1
No files found.
api/index.php
View file @
97e5dbb2
...
...
@@ -196,10 +196,11 @@
/* all_articles, unread, adaptive, marked, updated */
$view_mode
=
db_escape_string
(
$_REQUEST
[
"view_mode"
]);
$include_attachments
=
(
bool
)
db_escape_string
(
$_REQUEST
[
"include_attachments"
]);
$since_id
=
(
int
)
db_escape_string
(
$_REQUEST
[
"since_id"
]);
$headlines
=
api_get_headlines
(
$link
,
$feed_id
,
$limit
,
$offset
,
$filter
,
$is_cat
,
$show_excerpt
,
$show_content
,
$view_mode
,
false
,
$include_attachments
);
$include_attachments
,
$since_id
);
print
api_wrap_reply
(
API_STATUS_OK
,
$seq
,
$headlines
);
...
...
functions.php
View file @
97e5dbb2
...
...
@@ -3432,7 +3432,7 @@
}
function
queryFeedHeadlines
(
$link
,
$feed
,
$limit
,
$view_mode
,
$cat_view
,
$search
,
$search_mode
,
$match_on
,
$override_order
=
false
,
$offset
=
0
,
$owner_uid
=
0
,
$filter
=
false
)
{
function
queryFeedHeadlines
(
$link
,
$feed
,
$limit
,
$view_mode
,
$cat_view
,
$search
,
$search_mode
,
$match_on
,
$override_order
=
false
,
$offset
=
0
,
$owner_uid
=
0
,
$filter
=
false
,
$since_id
=
0
)
{
if
(
!
$owner_uid
)
$owner_uid
=
$_SESSION
[
"uid"
];
...
...
@@ -3463,6 +3463,12 @@
$filter_query_part
=
""
;
}
if
(
$since_id
)
{
$since_id_part
=
"ttrss_entries.id >
$since_id
AND "
;
}
else
{
$since_id_part
=
""
;
}
$view_query_part
=
""
;
if
(
$view_mode
==
"adaptive"
||
$view_query_part
==
"noscores"
)
{
...
...
@@ -3694,6 +3700,7 @@
$search_query_part
$filter_query_part
$view_query_part
$since_id_part
$query_strategy_part
ORDER BY
$order_by
$limit_query_part
$offset_query_part
"
;
...
...
@@ -3718,6 +3725,7 @@
"link,"
.
"last_read,"
.
SUBSTRING_FOR_DATE
.
"(last_read,1,19) as last_read_noms,"
.
$since_id_part
.
$vfeed_query_part
.
$content_query_part
.
SUBSTRING_FOR_DATE
.
"(updated,1,19) as updated_noms,"
.
...
...
@@ -6835,7 +6843,7 @@
function
api_get_headlines
(
$link
,
$feed_id
,
$limit
,
$offset
,
$filter
,
$is_cat
,
$show_excerpt
,
$show_content
,
$view_mode
,
$order
,
$include_attachments
)
{
$include_attachments
,
$since_id
)
{
/* do not rely on params below */
...
...
@@ -6845,7 +6853,7 @@
$qfh_ret
=
queryFeedHeadlines
(
$link
,
$feed_id
,
$limit
,
$view_mode
,
$is_cat
,
$search
,
$search_mode
,
$match_on
,
$order
,
$offset
);
$order
,
$offset
,
0
,
false
,
$since_id
);
$result
=
$qfh_ret
[
0
];
$feed_title
=
$qfh_ret
[
1
];
...
...
modules/backend-rpc.php
View file @
97e5dbb2
...
...
@@ -636,7 +636,7 @@
$reply
[
'seq'
]
=
$seq
;
$headlines
=
api_get_headlines
(
$link
,
$feed_id
,
30
,
$offset
,
''
,
(
$feed_id
==
-
4
),
true
,
false
,
"unread"
,
"updated DESC"
);
''
,
(
$feed_id
==
-
4
),
true
,
false
,
"unread"
,
"updated DESC"
,
0
,
0
);
//function api_get_headlines($link, $feed_id, $limit, $offset,
// $filter, $is_cat, $show_excerpt, $show_content, $view_mode) {
...
...
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