]> git.wh0rd.org Git - tt-rss.git/commitdiff
getFeedArticles/getFeedUnread: add support for tag feeds
authorAndrew Dolgov <fox@bah.org.ru>
Tue, 29 Dec 2009 19:57:52 +0000 (22:57 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Tue, 29 Dec 2009 19:57:52 +0000 (22:57 +0300)
functions.php
modules/popup-dialog.php

index 5657e04c95fbba3a49d25d05ae1be6880bde693a..a0f41210b6bfe41d853412ad83829a9bb5f93d2e 100644 (file)
 
                if ($is_cat) {
                        return getCategoryUnread($link, $n_feed, $owner_uid);           
+               } if ($feed != "0" && $n_feed == 0) {
+
+                       $result = db_query($link, "SELECT SUM((SELECT COUNT(int_id)
+                               FROM ttrss_user_entries,ttrss_entries WHERE int_id = post_int_id 
+                                       AND ref_id = id AND $age_qpart
+                                       AND $unread_qpart)) AS count FROM ttrss_tags 
+                               WHERE owner_uid = $owner_uid AND tag_name = '$feed'");
+                       return db_fetch_result($result, 0, "count");
+
                } else if ($n_feed == -1) {
                        $match_part = "marked = true";
                } else if ($n_feed == -2) {
                        foreach (array_keys($tags) as $tag) {
        
                                $unread = $tags[$tag];
-       
                                $class = "tag";
-       
-                               if ($unread > 0) {
-                                       $class .= "Unread";
-                               }
-       
+
                                printFeedEntry($tag, $class, $tag, $unread, "images/tag.png", $link);
        
                        } 
index 57237823e21ab0ceadfc7ea3630535217a7a5e0b..bfc1f248378e2748e83a9b7c5eccba3a3ff936e6 100644 (file)
                        print "<div class=\"infoBoxContents\">";
 
                        print __("Showing most popular tags ")." (<a 
-                       href='javascript:toggleTags(true)'>".__('browse more')."</a>):<br/>"; 
+                       href='javascript:toggleTags(true)'>".__('more tags')."</a>):<br/>"; 
 
                        print "<div class=\"tagCloudContainer\">";