]> git.wh0rd.org Git - tt-rss.git/commitdiff
add (disabled) group-by-feed for vfeeds (_VFEED_GROUP_BY_FEED)
authorAndrew Dolgov <fox@bah.spb.su>
Wed, 30 Apr 2008 00:36:00 +0000 (01:36 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Wed, 30 Apr 2008 00:36:00 +0000 (01:36 +0100)
functions.php
tt-rss.css

index 3390eca825e5adbcaa942c172c23bf34b2feb298..426566eccb6779c0a569af0888f544404bc31031 100644 (file)
                                        $offset_query_part = "OFFSET $offset";
                                }
 
+                               if ($vfeed_query_part && defined('_VFEED_GROUP_BY_FEED')) {
+                                       if (!$override_order) {
+                                               $order_by = "ttrss_feeds.id, $order_by";
+                                       }
+                               }
+
                                $query = "SELECT 
                                                guid,
                                                ttrss_entries.id,ttrss_entries.title,
                        error_reporting (DEFAULT_ERROR_LEVEL);
        
                        $num_unread = 0;
-       
+                       $cur_feed_title = '';
+
                        while ($line = db_fetch_assoc($result)) {
 
                                $class = ($lnum % 2) ? "even" : "odd";
                                }
 
                                if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) {
+
+                                       if (defined('_VFEED_GROUP_BY_FEED')) {
+                                               if ($line["feed_title"] != $cur_feed_title) {
+                                                       print "<tr class='feedTitle'><td colspan='7'>".
+                                                               "<a href=\"javascript:viewfeed($feed_id, '', false)\">".
+                                                               $line["feed_title"]."</a>:</td></tr>";
+                                                       $cur_feed_title = $line["feed_title"];
+                                               }
+                                       }
                                        
                                        print "<tr class='$class' id='RROW-$id'>";
                
 #                                                      <a href=\"javascript:viewfeed($feed_id, '', false)\">".
 #                                                      $line["feed_title"]."</a>       
 
-                                       if ($line["feed_title"]) {                      
-                                               print "<span class=\"hlFeed\">
-                                                       (<a href=\"javascript:viewfeed($feed_id, '', false)\">".
-                                                       $line["feed_title"]."</a>)
-                                               </span>";
+                                       if (!defined('_VFEED_GROUP_BY_FEED')) {
+                                               if ($line["feed_title"]) {                      
+                                                       print "<span class=\"hlFeed\">
+                                                               (<a href=\"javascript:viewfeed($feed_id, '', false)\">".
+                                                               $line["feed_title"]."</a>)
+                                                       </span>";
+                                               }
                                        }
 
 
                                        print "</tr>";
 
                                } else {
-                                       
+
+                                       if (defined('_VFEED_GROUP_BY_FEED')) {
+                                               if ($line["feed_title"] != $cur_feed_title) {
+                                                       print "<div class='cdmFeedTitle'>".
+                                                               "<a href=\"javascript:viewfeed($feed_id, '', false)\">".
+                                                               $line["feed_title"]."</a></div>";
+                                                       $cur_feed_title = $line["feed_title"];
+                                               }
+                                       }
+
                                        if ($is_unread) {
                                                $add_class = "Unread";
                                        } else {
                                        } 
 
 
-                                       if ($line["feed_title"]) {      
-                                               print "&nbsp;(<a href='javascript:viewfeed($feed_id)'>".$line["feed_title"]."</a>)";
+                                       if (!defined('_VFEED_GROUP_BY_FEED')) {
+                                               if ($line["feed_title"]) {      
+                                                       print "&nbsp;(<a href='javascript:viewfeed($feed_id)'>".$line["feed_title"]."</a>)";
+                                               }
                                        }
 
                                        print "</div>";
index 77b0df74d600af6689a2e15ec9cae6f2125f5c42..d01ac5d65978b779502e99a08979b836b1ae6ea7 100644 (file)
@@ -1742,3 +1742,20 @@ a.visibleLink {
        color : #4684ff;
 
 }
+
+table.headlinesList tr.feedTitle td a, div.cdmFeedTitle a {
+       padding-left : 5px;
+       color : #4684ff;
+}
+
+div.cdmFeedTitle {
+       border-color : #a0a0a0;
+       border-width : 0px 0px 1px 0px;
+       border-style : solid;
+       padding : 5px 5px 5px 0px;
+}
+
+table.headlinesList tr.feedTitle td {
+/*     text-align : right;
+       margin-top : 10px; */
+}