summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-09-09 02:21:30 +0100
committerAndrew Dolgov <[email protected]>2005-09-09 02:21:30 +0100
commit392d45635b488073e247f179cdbc8f94d9aa5d04 (patch)
tree437a4ab8e4c216f7f5e21c9bd65f556ff4e28dd8
parent90cd2ea5a15ed9750e4439097120d42c20a74976 (diff)
rework label counter behaviour
-rw-r--r--backend.php12
-rw-r--r--functions.js7
-rw-r--r--tt-rss.js2
3 files changed, 16 insertions, 5 deletions
diff --git a/backend.php b/backend.php
index 8c566cee4..572fb092a 100644
--- a/backend.php
+++ b/backend.php
@@ -37,7 +37,7 @@
error_reporting (0);
$tmp_result = db_query($link, "SELECT count(id) as count FROM ttrss_entries
- WHERE " . $line["sql_exp"]);
+ WHERE (" . $line["sql_exp"] . ") AND unread = true");
$count = db_fetch_result($tmp_result, 0, "count");
@@ -98,14 +98,20 @@
error_reporting (0);
$tmp_result = db_query($link, "SELECT count(id) as count FROM ttrss_entries
- WHERE " . $line["sql_exp"]);
+ WHERE (" . $line["sql_exp"] . ") AND unread = true");
$count = db_fetch_result($tmp_result, 0, "count");
+
+ $class = "odd";
+
+ if ($count > 0) {
+ $class .= "Unread";
+ }
error_reporting (E_ERROR | E_WARNING | E_PARSE);
printFeedEntry(-$line["id"]-11,
- "odd", $line["description"], $count, "images/label.png");
+ $class, $line["description"], $count, "images/label.png");
}
}
diff --git a/functions.js b/functions.js
index 0db4ea307..8e7b99957 100644
--- a/functions.js
+++ b/functions.js
@@ -312,14 +312,19 @@ function label_counters_callback() {
var feedctr = f_document.getElementById("FEEDCTR-" + id);
var feedu = f_document.getElementById("FEEDU-" + id);
+ var feedr = f_document.getElementById("FEEDR-" + id);
feedu.innerHTML = ctr;
if (ctr > 0) {
feedctr.className = "odd";
+ if (!feedr.className.match("Unread") && id != -1) {
+ feedr.className = feedr.className + "Unread";
+ }
} else {
feedctr.className = "invisible";
- }
+ feedr.className = feedr.className.replace("Unread", "");
+ }
}
}
}
diff --git a/tt-rss.js b/tt-rss.js
index d1bcad692..ae16052cb 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -70,7 +70,7 @@ function refetch_callback() {
if (ctr > 0) {
feedctr.className = "odd";
- if (id > 0 && !feedr.className.match("Unread")) {
+ if (id != -1 && !feedr.className.match("Unread")) {
feedr.className = feedr.className + "Unread";
}
} else {