1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 12:25:56 +00:00

handle counters using JSON instead of XML

This commit is contained in:
Andrew Dolgov
2010-11-04 22:38:03 +03:00
parent 5191a7ce03
commit 6a7817c1ad
4 changed files with 138 additions and 180 deletions

View File

@@ -258,9 +258,9 @@
// 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>";
print "<counters><![CDATA[";
print json_encode(getAllCounters($link, $omode));
print "]]></counters>";
$_SESSION["view:counters_stamp"] = time();
}
@@ -389,20 +389,12 @@
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("20", $timing_info);
// if (get_pref($link, "SYNC_COUNTERS") ||
// time() - $_SESSION["get_all_counters_stamp"] > $viewfeed_ctr_interval) {
// print "<counters>";
// getAllCounters($link, $omode, $feed);
// print "</counters>";
// }
if (get_pref($link, 'COMBINED_DISPLAY_MODE') || $subop ||
time() - $_SESSION["viewfeed:counters_stamp"] > 5) {
if (!$offset) {
print "<counters>";
getAllCounters($link, $omode, $feed);
print "</counters>";
print "<counters><![CDATA[";
print json_encode(getAllCounters($link, $omode, $feed));
print "]]></counters>";
$_SESSION["viewfeed:counters_stamp"] = time();
}
}