summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-02-01 13:09:43 +0400
committerAndrew Dolgov <[email protected]>2013-02-01 13:09:43 +0400
commit5b55e9e25cfca0229f1e00aee6a9aee6c1510611 (patch)
tree3a2c2ca235ae6a596cd095167a12b645c087b7f0 /include
parent1e6463fde939a8c18cc7f301b831b21ff673d1e4 (diff)
js: simplify counter updating, remove some unused stuff
Diffstat (limited to 'include')
-rw-r--r--include/functions.php43
1 files changed, 4 insertions, 39 deletions
diff --git a/include/functions.php b/include/functions.php
index 060a8a3aa..c32d31f6d 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1075,18 +1075,13 @@
}
}
- function getAllCounters($link, $omode = "flc", $active_feed = false) {
-
- if (!$omode) $omode = "flc";
-
+ function getAllCounters($link) {
$data = getGlobalCounters($link);
$data = array_merge($data, getVirtCounters($link));
-
- if (strchr($omode, "l")) $data = array_merge($data, getLabelCounters($link));
- if (strchr($omode, "f")) $data = array_merge($data, getFeedCounters($link, $active_feed));
- if (strchr($omode, "t")) $data = array_merge($data, getTagCounters($link));
- if (strchr($omode, "c")) $data = array_merge($data, getCategoryCounters($link));
+ $data = array_merge($data, getLabelCounters($link));
+ $data = array_merge($data, getFeedCounters($link, $active_feed));
+ $data = array_merge($data, getCategoryCounters($link));
return $data;
}
@@ -1374,36 +1369,6 @@
return $ret_arr;
}
- function getTagCounters($link) {
-
- $ret_arr = array();
-
- $result = db_query($link, "SELECT tag_name,SUM((SELECT COUNT(int_id)
- FROM ttrss_user_entries,ttrss_entries WHERE int_id = post_int_id
- AND ref_id = id AND unread = true)) AS count FROM ttrss_tags
- WHERE owner_uid = ".$_SESSION['uid']." GROUP BY tag_name
- ORDER BY count DESC LIMIT 55");
-
- $tags = array();
-
- while ($line = db_fetch_assoc($result)) {
- $tags[$line["tag_name"]] += $line["count"];
- }
-
- foreach (array_keys($tags) as $tag) {
- $unread = $tags[$tag];
- $tag = htmlspecialchars($tag);
-
- $cv = array("id" => $tag,
- "kind" => "tag",
- "counter" => $unread);
-
- array_push($ret_arr, $cv);
- }
-
- return $ret_arr;
- }
-
function getVirtCounters($link) {
$ret_arr = array();