summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-02-03 18:21:39 +0300
committerAndrew Dolgov <[email protected]>2009-02-03 18:21:39 +0300
commit95f0c2c5b3c1739faf45e21d19795471d10b67ae (patch)
tree20af97f67afc86533bb81a3baf591cbe8dc0f13d /modules
parent1ea930cbea6e66a76a8ef89129a41923102b9292 (diff)
only download articles which are newer than the last stored in local db
Diffstat (limited to 'modules')
-rw-r--r--modules/backend-rpc.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index 64e7df2f0..4212c1b8c 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -516,6 +516,7 @@
if ($subop == "download") {
$stage = (int) $_REQUEST["stage"];
+ $cid = db_escape_string($_REQUEST["cid"]);
$amount = (int) $_REQUEST["amount"];
$unread_only = db_escape_string($_REQUEST["unread_only"]);
@@ -561,11 +562,15 @@
$unread_qpart = "unread = true AND ";
}
+ if ($cid) {
+ $cid_qpart = "id > $cid AND ";
+ }
+
$result = db_query($link,
"SELECT DISTINCT id,title,guid,link,
feed_id,content,updated,unread,marked FROM
ttrss_user_entries,ttrss_entries
- WHERE $unread_qpart
+ WHERE $unread_qpart $cid_qpart
ref_id = id AND owner_uid = ".$_SESSION["uid"]."
ORDER BY updated DESC LIMIT $limit OFFSET $skip");