]> git.wh0rd.org - tt-rss.git/commitdiff
assorted fixes
authorAndrew Dolgov <fox@bah.org.ru>
Mon, 28 Dec 2009 18:42:04 +0000 (21:42 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Mon, 28 Dec 2009 18:42:04 +0000 (21:42 +0300)
functions.php

index f7ce20ddac4f00af3fa74d3db4d260328715d539..7fe21ea4ea8fe34063203a04b459686414d6e0e9 100644 (file)
                $fg_content = false, $bg_content = false) {
 
                if (!$feed_title) $feed_title = getFeedTitle($link, $feed_id, false);
+               if (!$unread) $unread = getFeedUnread($link, $feed_id); 
+
+               if ($unread > 0) $class .= "Unread";
+
+               if (!$icon_file) $icon_file = getFeedIcon($feed_id);
 
                if (file_exists($icon_file) && filesize($icon_file) > 0) {
                                $feed_icon = "<img id=\"FIMG-$feed_id\" src=\"$icon_file\">";
 
        function getFeedIcon($id) {
                switch ($id) {
+               case 0:
+                       return "images/archive.png";
+                       break;
                case -1:
                        return "images/mark_set.gif";
                        break;
                        return "images/tag.png";
                        break;
                default:
-                       return ICONS_URL . "/$id.ico";
+                       if ($id < -10) {
+                               return "images/label.png";
+                       } else {
+                               return ICONS_URL . "/$id.ico";
+                       }
                        break;
                }
        }
                        printCategoryHeader($link, -1, $cat_hidden, false);
                }
 
-               $num_starred = getFeedUnread($link, -1);
-               $num_published = getFeedUnread($link, -2);
-               $num_fresh = getFeedUnread($link, -3);
-               $num_total = getFeedUnread($link, -4);
-               $num_archive = getFeedUnread($link, 0);
-
-               $class = "virt";
-
-               if ($num_total > 0) $class .= "Unread";
-
-               printFeedEntry(-4, $class, false, $num_total, 
-                       "images/tag.png", $link);
-
-               $class = "virt";
-
-               if ($num_archive > 0) $class .= "Unread";
-
-               printFeedEntry(0, $class, false, $num_archive, 
-                       "images/tag.png", $link);
-
-               $class = "virt";
-
-               if ($num_fresh > 0) $class .= "Unread";
-
-               printFeedEntry(-3, $class, false, $num_fresh, 
-                       "images/fresh.png", $link);
-
-               $class = "virt";
-
-               if ($num_starred > 0) $class .= "Unread";
-
-               printFeedEntry(-1, $class, false, $num_starred, 
-                       "images/mark_set.png", $link);
-
-               $class = "virt";
-
-               if ($num_published > 0) $class .= "Unread";
-
-               printFeedEntry(-2, $class, false, $num_published, 
-                       "images/pub_set.gif", $link);
+               foreach (array(-4, 0, -3, -1, -2) as $i) {
+                       printFeedEntry($i, "virt", false, false, 
+                               false, $link);
+               }
 
                if (get_pref($link, 'ENABLE_FEED_CATS')) {
                        print "</ul></li>";
        
                                        $label_id = -$line['id'] - 11;
                                        $count = getFeedUnread($link, $label_id);
-
-                                       $class = "label";
-       
-                                       if ($count > 0) {
-                                               $class .= "Unread";
-                                       }
        
                                        printFeedEntry($label_id, 
-                                               $class, $line["caption"], 
-                                               $count, "images/label.png", $link, 
+                                               "label", $line["caption"], 
+                                               $count, false, $link, 
                                                false, false, false,
                                                $line['fg_color'], $line['bg_color']);
                
                                        $class = "feed";
                                }
        
-                               if ($unread > 0) $class .= "Unread";
-       
                                if ($actid == $feed_id) {
                                        $class .= "Selected";
                                }
                                }
        
                                printFeedEntry($feed_id, $class, $feed, $unread, 
-                                       ICONS_URL."/$feed_id.ico", $link, $rtl_content, 
+                                       false, $link, $rtl_content, 
                                        $last_updated, $line["last_error"]);
        
                                ++$lnum;