summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-02-20 14:14:45 +0300
committerAndrew Dolgov <[email protected]>2020-02-20 14:14:45 +0300
commit60288f02e8947282bf9226f63d0ce052f9c9ac61 (patch)
tree822078eed6f56c050f4de79a5b8a62082c58dd2f /classes
parent5b6d9cee2957c1d41288d31aada1edb826db1916 (diff)
1. feedtree: show counters for marked articles if view-mode == marked
2. hide/show relevant counter nodes using css 3. cleanup some counter-related code 4. compile default css into light theme to prevent cache-related issues
Diffstat (limited to 'classes')
-rw-r--r--classes/counters.php11
-rwxr-xr-xclasses/pref/feeds.php2
2 files changed, 9 insertions, 4 deletions
diff --git a/classes/counters.php b/classes/counters.php
index 534dfe380..63143a503 100644
--- a/classes/counters.php
+++ b/classes/counters.php
@@ -175,6 +175,9 @@ class Counters {
"auxcounter" => (int) $auxctr
];
+ if ($i == -1)
+ $cv["markedcounter"] = $auxctr;
+
array_push($ret, $cv);
}
@@ -205,7 +208,8 @@ class Counters {
$sth = $pdo->prepare("SELECT id,
caption,
- SUM(CASE WHEN u1.unread = true THEN 1 ELSE 0 END) AS unread,
+ SUM(CASE WHEN u1.unread = true THEN 1 ELSE 0 END) AS count_unread,
+ SUM(CASE WHEN u1.marked = true THEN 1 ELSE 0 END) AS count_marked,
COUNT(u1.unread) AS total
FROM ttrss_labels2 LEFT JOIN ttrss_user_labels2 ON
(ttrss_labels2.id = label_id)
@@ -220,8 +224,9 @@ class Counters {
$cv = [
"id" => $id,
- "counter" => (int) $line["unread"],
- "auxcounter" => (int) $line["total"]
+ "counter" => (int) $line["count_unread"],
+ "auxcounter" => (int) $line["total"],
+ "markedcounter" => (int) $line["count_marked"]
];
if ($descriptions)
diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php
index b3aeec086..6d7295beb 100755
--- a/classes/pref/feeds.php
+++ b/classes/pref/feeds.php
@@ -1393,7 +1393,7 @@ class Pref_Feeds extends Handler_Protected {
$obj['items'] = array();
$obj['name'] = Feeds::getCategoryTitle($cat_id);
$obj['type'] = 'category';
- $obj['unread'] = (int) Feeds::getCategoryUnread($cat_id);
+ $obj['unread'] = -1; //(int) Feeds::getCategoryUnread($cat_id);
$obj['bare_id'] = $cat_id;
return $obj;