summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-12-30 10:07:00 +0300
committerAndrew Dolgov <[email protected]>2009-12-30 10:07:00 +0300
commit0a6e5382cfd59f2cbfeefd0bfd7d9af1408236df (patch)
tree5a59932b24b96ebd11941a960adeab9b5ff9662a
parent2aa709f7ef51c0922e9729f1b4ab70413b5a4e60 (diff)
move virt feeds counter display to getVirtCounters()
-rw-r--r--api/index.php2
-rw-r--r--functions.php27
-rw-r--r--modules/backend-rpc.php31
3 files changed, 24 insertions, 36 deletions
diff --git a/api/index.php b/api/index.php
index 0e07abb4b..5d7493402 100644
--- a/api/index.php
+++ b/api/index.php
@@ -172,7 +172,7 @@
/* Virtual feeds */
if (!$cat_id || $cat_id == -1) {
- foreach (array(-1, -2, -3, -4) as $i) {
+ foreach (array(-1, -2, -3, -4, 0) as $i) {
$unread = getFeedUnread($link, $i);
if ($unread || !$unread_only) {
diff --git a/functions.php b/functions.php
index 2e735e7b9..3d71566c6 100644
--- a/functions.php
+++ b/functions.php
@@ -2313,7 +2313,8 @@
if (!$omode) $omode = "flc";
getGlobalCounters($link);
-
+ getVirtCounters($link);
+
if (strchr($omode, "l")) getLabelCounters($link);
if (strchr($omode, "f")) getFeedCounters($link, SMART_RPC_COUNTERS, $active_feed);
if (strchr($omode, "t")) getTagCounters($link);
@@ -2656,15 +2657,7 @@
}
- function getLabelCounters($link, $smart_mode = SMART_RPC_COUNTERS, $ret_mode = false) {
-
- $age_qpart = getMaxAgeSubquery();
-
- if ($smart_mode) {
- if (!$_SESSION["lctr_last_value"]) {
- $_SESSION["lctr_last_value"] = array();
- }
- }
+ function getVirtCounters($link, $smart_mode = SMART_RPC_COUNTERS, $ret_mode = false) {
$ret_arr = array();
@@ -2685,7 +2678,19 @@
$ret_arr[$i]["counter"] = $count;
$ret_arr[$i]["description"] = getFeedTitle($link, $i);
}
-
+ }
+
+ return $ret_arr;
+ }
+
+ function getLabelCounters($link, $smart_mode = SMART_RPC_COUNTERS, $ret_mode = false) {
+
+ $age_qpart = getMaxAgeSubquery();
+
+ if ($smart_mode) {
+ if (!$_SESSION["lctr_last_value"]) {
+ $_SESSION["lctr_last_value"] = array();
+ }
}
$old_counters = $_SESSION["lctr_last_value"];
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index c9c367165..8b1252127 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -22,30 +22,6 @@
return;
}
- if ($subop == "getLabelCounters") {
- $aid = $_REQUEST["aid"];
- print "<rpc-reply>";
- print "<counters>";
- getLabelCounters($link);
- if ($aid) {
- getFeedCounter($link, $aid);
- }
- print "</counters>";
- print "</rpc-reply>";
-
- return;
- }
-
- if ($subop == "getFeedCounters") {
- print "<rpc-reply>";
- print "<counters>";
- getFeedCounters($link);
- print "</counters>";
- print "</rpc-reply>";
-
- return;
- }
-
if ($subop == "getAllCounters") {
print "<rpc-reply>";
print "<counters>";
@@ -77,6 +53,7 @@
print "<rpc-reply><counters>";
getGlobalCounters($link);
+ getVirtCounters($link);
getLabelCounters($link);
if (get_pref($link, 'ENABLE_FEED_CATS')) {
getCategoryCounters($link);
@@ -94,6 +71,7 @@
print "<rpc-reply><counters>";
getGlobalCounters($link);
+ getVirtCounters($link);
if (get_pref($link, 'ENABLE_FEED_CATS')) {
getCategoryCounters($link);
}
@@ -111,6 +89,7 @@
print "<rpc-reply><counters>";
getGlobalCounters($link);
+ getVirtCounters($link);
if (get_pref($link, 'ENABLE_FEED_CATS')) {
getCategoryCounters($link);
}
@@ -128,6 +107,7 @@
print "<rpc-reply><counters>";
getGlobalCounters($link);
+ getVirtCounters($link);
if (get_pref($link, 'ENABLE_FEED_CATS')) {
getCategoryCounters($link);
}
@@ -164,6 +144,7 @@
print "<counters>";
getGlobalCounters($link);
+ getVirtCounters($link);
getLabelCounters($link);
if (get_pref($link, 'ENABLE_FEED_CATS')) {
getCategoryCounters($link);
@@ -218,6 +199,8 @@
if (!$omode) $omode = "tflc";
+ getVirtCounters($link);
+
if (strchr($omode, "l")) getLabelCounters($link);
if (strchr($omode, "c")) {