]> git.wh0rd.org - tt-rss.git/blobdiff - backend.php
start work on showing number of unread articles in title
[tt-rss.git] / backend.php
index 6f5e2dd5962ee9fee3efc0d1b70bf5a81e7419cc..495cebe722ff0a9f66ec744804e4b54c39b2ad1c 100644 (file)
 
        /* FIXME this needs reworking */
 
+       function getGlobalCounters($link) {
+               $result = db_query($link, "SELECT count(id) as c_id FROM ttrss_entries
+                       WHERE unread = true");
+               $c_id = db_fetch_result($result, 0, "c_id");
+               print "<counter id='global-unread' counter='$c_id'/>";
+       }
+
        function getTagCounters($link) {
                $result = db_query($link, "SELECT tag_name,count(ttrss_entries.id) AS count
                        FROM ttrss_tags,ttrss_entries WHERE
                        getLabelCounters($link);
                        getFeedCounters($link);
                        getTagCounters($link);
+                       getGlobalCounters($link);
                        print "</rpc-reply>";
-
                }
 
                if ($subop == "mark") {
                        if (strchr($omode, "l")) getLabelCounters($link);
                        if (strchr($omode, "f")) getFeedCounters($link);
                        if (strchr($omode, "t")) getTagCounters($link);
+                       getGlobalCounters($link);
                        print "</rpc-reply>";
                }