From 6a1cd59192bf4319b90319f7d623fae9011728ff Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 3 Feb 2009 16:11:44 +0300 Subject: implement dumb article downloader --- modules/backend-rpc.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'modules/backend-rpc.php') diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index 55ab73a20..53635f966 100644 --- a/modules/backend-rpc.php +++ b/modules/backend-rpc.php @@ -516,6 +516,10 @@ if ($subop == "download") { $stage = (int) $_REQUEST["stage"]; + $amount = (int) $_REQUEST["amount"]; + $unread_only = db_escape_string($_REQUEST["unread_only"]); + + if (!$amount) $amount = 50; print ""; @@ -537,6 +541,43 @@ } + if ($stage > 0) { + + print ""; + + $limit = 50; + $skip = $limit*($stage-1); + + if ($amount > 0) $amount -= $skip; + + if ($amount > 0) { + + $limit = min($limit, $amount); + + if ($unread_only) { + $unread_qpart = "unread = true 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 + ref_id = id AND owner_uid = ".$_SESSION["uid"]." + ORDER BY updated DESC LIMIT $limit OFFSET $skip"); + + while ($line = db_fetch_assoc($result)) { + print "
"; + } + + } + + print "
"; + + } + print "
"; return; -- cgit v1.2.3