]> git.wh0rd.org Git - tt-rss.git/commitdiff
piggy-back counters to view reply
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 15 May 2007 05:41:48 +0000 (06:41 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 15 May 2007 05:41:48 +0000 (06:41 +0100)
backend.php
viewfeed.js

index 39324673239cb34d9c1b30f19f690f086d05d813..634d5ae3416b59da6f8227934cde912d4b2bce76 100644 (file)
                $feed_id = db_escape_string($_GET["feed"]);
                $cids = split(",", db_escape_string($_GET["cids"]));
                $mode = db_escape_string($_GET["mode"]);
+               $omode = db_escape_string($_GET["omode"]);
 
                print "<reply>";
 
                        }
                }
 
+               print "<counters>";
+               getAllCounters($link, $omode);
+               print "</counters>";
+
                print "</reply>";
        }
 
index 4cba45ef8d3cbb7b28419dda60cd78652a417e8e..88448f31880b918f56db945df011205213c4c8a6 100644 (file)
@@ -123,7 +123,14 @@ function article_callback() {
                        setTimeout('updateFeedList(false, false)', 50);                 
                        _reload_feedlist_after_view = false;
                } else {
-                       update_all_counters();
+                       var counters = xmlhttp.responseXML.getElementsByTagName("counters")[0];
+
+                       if (counters) {
+                               debug("parsing piggybacked counters: " + counters);
+                               parse_counters(counters, false);
+                       } else {
+                               update_all_counters();
+                       }
                }
 
                notify("");
@@ -194,6 +201,14 @@ function view(id, feed_id, skip_history) {
 
                        debug("additional ids: " + cids_to_request.toString());                 
 
+                       /* additional info for piggyback counters */
+
+                       if (tagsAreDisplayed()) {
+                               query = query + "&omode=lt";
+                       } else {
+                               query = query + "&omode=flc";
+                       }
+
                        var date = new Date();
                        var timestamp = Math.round(date.getTime() / 1000);
                        query = query + "&ts=" + timestamp;