From e097e8be75440dd03e7f36ff8a1d0e01725295c3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 15 May 2007 06:03:35 +0100 Subject: add article prefetching, remove history tracking --- backend.php | 45 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-) (limited to 'backend.php') diff --git a/backend.php b/backend.php index a71b649e4..393246732 100644 --- a/backend.php +++ b/backend.php @@ -43,7 +43,7 @@ $print_exec_time = false; - if ((!$op || $op == "rpc" || $op == "rss" || $op == "digestSend" || + if ((!$op || $op == "rpc" || $op == "rss" || $op == "view" || $op == "digestSend" || $op == "globalUpdateFeeds") && !$_REQUEST["noxml"]) { header("Content-Type: application/xml; charset=utf-8"); } else { @@ -141,10 +141,9 @@ } - if ($op == "view") { + function outputArticleXML($link, $id, $feed_id, $mark_as_read = true) { - $id = db_escape_string($_GET["id"]); - $feed_id = db_escape_string($_GET["feed"]); + print "
"; } + + print "]]>
"; + + } + + if ($op == "view") { + + $id = db_escape_string($_GET["id"]); + $feed_id = db_escape_string($_GET["feed"]); + $cids = split(",", db_escape_string($_GET["cids"])); + $mode = db_escape_string($_GET["mode"]); + + print ""; + + // in prefetch mode we only output requested cids, main article + // just gets marked as read (it already exists in client cache) + + if ($mode != "prefetch") { + outputArticleXML($link, $id, $feed_id); + } else { + catchupArticleById($link, $id, 0); + } + + foreach ($cids as $cid) { + if ($cid) { + outputArticleXML($link, $cid, $feed_id, false); + } + } + + print ""; } if ($op == "viewfeed") { -- cgit v1.2.3-54-g00ecf