]> git.wh0rd.org - tt-rss.git/blobdiff - backend.php
rework label counter behaviour
[tt-rss.git] / backend.php
index 8c566cee4a32305ed81b9caf9d628dac6b789e9c..572fb092ade7845854bf9ac77b36f3af2ad2d38f 100644 (file)
@@ -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");
 
                                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");
        
                        }
                }