From: Andrew Dolgov Date: Mon, 2 Feb 2009 12:24:32 +0000 (+0300) Subject: update amount of subscribed feeds in runtime-info (to invalidate feedlist cache) X-Git-Tag: 1.3.1~142 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=9b7ecc0ac790c611965e6a2359a06f95b2bbc38c;p=tt-rss.git update amount of subscribed feeds in runtime-info (to invalidate feedlist cache) --- diff --git a/feedlist.js b/feedlist.js index e148337c..47542e54 100644 --- a/feedlist.js +++ b/feedlist.js @@ -36,7 +36,7 @@ function render_feedlist(data) { var f = document.getElementById("feeds-frame"); f.innerHTML = data; cache_invalidate("FEEDLIST"); - cache_inject("FEEDLIST", data); + cache_inject("FEEDLIST", data, getInitParam("num_feeds")); feedlist_init(); } catch (e) { diff --git a/functions.php b/functions.php index 523c7494..80488b09 100644 --- a/functions.php +++ b/functions.php @@ -3002,12 +3002,28 @@ print ""; + $result = db_query($link, "SELECT COUNT(*) AS cf FROM + ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]); + + $num_feeds = db_fetch_result($result, 0, "cf"); + + print ""; + print ""; } function print_runtime_info($link) { print ""; + $result = db_query($link, "SELECT COUNT(*) AS cf FROM + ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]); + + $num_feeds = db_fetch_result($result, 0, "cf"); + + print ""; + if (ENABLE_UPDATE_DAEMON) { print ""; diff --git a/tt-rss.js b/tt-rss.js index c3c21cc2..da88d3d6 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -510,7 +510,7 @@ function init_second_stage() { daemon_refresh_only = getInitParam("daemon_refresh_only") == 1; feeds_sort_by_unread = getInitParam("feeds_sort_by_unread") == 1; - var fl = cache_find("FEEDLIST"); + var fl = cache_find_param("FEEDLIST", getInitParam("num_feeds")); if (fl) { render_feedlist(fl); @@ -737,6 +737,10 @@ function parse_runtime_info(elem) { debug("RI: " + k + " => " + v); + if (k == "num_feeds") { + init_params[k] = v; + } + if (k == "new_version_available") { var icon = document.getElementById("newVersionIcon"); if (icon) {