diff options
author | Andrew Dolgov <[email protected]> | 2010-11-11 09:56:03 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2010-11-11 09:56:07 +0300 |
commit | d36f560740ee03a7a224058578a88182cb0d3a71 (patch) | |
tree | 4d6195b430348e00bcaf146e94c4c39bfa3e532d | |
parent | 96811a55e61ec9360782b24c9e630a61666618db (diff) |
viewfeed: return counters when subop is present or when in CDM
-rw-r--r-- | backend.php | 4 | ||||
-rw-r--r-- | functions.php | 2 | ||||
-rw-r--r-- | viewfeed.js | 7 |
3 files changed, 8 insertions, 5 deletions
diff --git a/backend.php b/backend.php index 5e963f1eb..d9b44aefa 100644 --- a/backend.php +++ b/backend.php @@ -387,11 +387,11 @@ if ($_REQUEST["debug"]) $timing_info = print_checkpoint("20", $timing_info); - /* if (get_pref($link, 'COMBINED_DISPLAY_MODE') || $subop || !$offset) { + if (get_pref($link, 'COMBINED_DISPLAY_MODE') || $subop) { print "<counters><![CDATA["; print json_encode(getAllCounters($link, $omode, $feed)); print "]]></counters>"; - } */ + } if ($_REQUEST["debug"]) $timing_info = print_checkpoint("30", $timing_info); diff --git a/functions.php b/functions.php index d5852bde1..a9a7cea51 100644 --- a/functions.php +++ b/functions.php @@ -2321,7 +2321,7 @@ } } - function catchup_feed($link, $feed, $cat_view, $owner_uid) { + function catchup_feed($link, $feed, $cat_view, $owner_uid = false) { if (!$owner_uid) $owner_uid = $_SESSION['uid']; diff --git a/viewfeed.js b/viewfeed.js index 92564da6c..f46b97863 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -201,8 +201,11 @@ function headlines_callback2(transport, feed_cur_page) { } else { console.log("no cached articles received"); } - - request_counters(); + + if (counters) + parse_counters(counters); + else + request_counters(); if (runtime_info) { parse_runtime_info(runtime_info[0]); |