]> git.wh0rd.org - tt-rss.git/commitdiff
ccache category fixes; re-enable rate limit
authorAndrew Dolgov <fox@bah.spb.su>
Fri, 16 Jan 2009 15:33:26 +0000 (16:33 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Fri, 16 Jan 2009 15:33:26 +0000 (16:33 +0100)
feedlist.js
functions.php

index c756f14436331203fd0fbb0a092b484f581ece8a..d4adacb66002c266e40d3673b860acea6dd5bbfa 100644 (file)
@@ -623,17 +623,13 @@ function request_counters() {
 //             if (getInitParam("sync_counters") == "1" || 
 //                             timestamp - counters_last_request > 10) {
 
-/*             if (timestamp - counters_last_request > 10) {
-
+               if (timestamp - counters_last_request > 5) {
                        debug("scheduling request of counters...");
                        window.setTimeout("request_counters_real()", 1000);
                        counters_last_request = timestamp;
                } else {
                        debug("request_counters: rate limit reached: " + (timestamp - counters_last_request));
-               } */
-
-               window.setTimeout("request_counters_real()", 1000);
-               counters_last_request = timestamp;
+               }
 
        } catch (e) {
                exception_error("request_counters", e);
index ce0360c89a0ff86350769396e30ba4eb0f664eb3..53ad3ce709b4ab04da55f94e7839d91b03d1744a 100644 (file)
        function printCategoryHeader($link, $cat_id, $hidden = false, $can_browse = true) {
 
                        $tmp_category = getCategoryTitle($link, $cat_id);
-                       $cat_unread = getCategoryUnread($link, $cat_id);
+                       $cat_unread = ccache_find($link, $cat_id, $_SESSION["uid"], true);
 
                        if ($hidden) {
                                $holder_style = "display:none;";
                        $table = "ttrss_cat_counters_cache";
                }
 
-               if (!$is_cat) {
-
-                       $unread = (int) getFeedArticles($link, $feed_id, $is_cat, true, $owner_uid);
-
-               } else {
-
+               if ($is_cat && $feed_id > 0) {
                        if ($feed_id != 0) {
                                $cat_qpart = "cat_id = '$feed_id'";
                        } else {
 
                        $unread = db_fetch_result($result, 0, "sv");
 
+               } else {
+                       $unread = (int) getFeedArticles($link, $feed_id, $is_cat, true, $owner_uid);
                }
 
                $result = db_query($link, "SELECT feed_id FROM $table