function view() { $id = db_escape_string($_REQUEST["id"]); $cids = explode(",", db_escape_string($_REQUEST["cids"])); $mode = db_escape_string($_REQUEST["mode"]); $omode = db_escape_string($_REQUEST["omode"]); // in prefetch mode we only output requested cids, main article // just gets marked as read (it already exists in client cache) $articles = array(); if ($mode == "") { array_push($articles, format_article($this->link, $id, false)); } else { if ($mode == "zoom") { array_push($articles, format_article($this->link, $id, true, true)); } else { if ($mode == "raw") { if ($_REQUEST['html']) { header("Content-Type: text/html"); print '<link rel="stylesheet" type="text/css" href="tt-rss.css"/>'; } $article = format_article($this->link, $id, false); print $article['content']; return; } } } catchupArticleById($this->link, $id, 0); if (!$_SESSION["bw_limit"]) { foreach ($cids as $cid) { if ($cid) { array_push($articles, format_article($this->link, $cid, false, false)); } } } print json_encode($articles); }
case "view": $id = db_escape_string($_REQUEST["id"]); $cids = split(",", db_escape_string($_REQUEST["cids"])); $mode = db_escape_string($_REQUEST["mode"]); $omode = db_escape_string($_REQUEST["omode"]); $csync = $_REQUEST["csync"]; print "<reply>"; // in prefetch mode we only output requested cids, main article // just gets marked as read (it already exists in client cache) if ($mode == "") { outputArticleXML($link, $id, false); } else { if ($mode == "zoom") { outputArticleXML($link, $id, false, true, true); } else { catchupArticleById($link, $id, 0); } } if (!$_SESSION["bw_limit"]) { foreach ($cids as $cid) { if ($cid) { outputArticleXML($link, $cid, false, false); } } } // if (get_pref($link, "SYNC_COUNTERS") || ($mode == "prefetch" && $csync)) { if (time() - $_SESSION["view:counters_stamp"] > 5 && $mode == "prefetch") { print "<counters>"; getAllCounters($link, $omode); print "</counters>"; $_SESSION["view:counters_stamp"] = time();