]> git.wh0rd.org - tt-rss.git/commitdiff
show only 4 tags in article view, possibly improve tag detection
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 29 Nov 2005 10:33:00 +0000 (11:33 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 29 Nov 2005 10:33:00 +0000 (11:33 +0100)
backend.php
functions.php
tt-rss.css

index e541c85c8ed64b89209afa74a9cdc03c63853137..30c45e1179251e4fdd9891c17e8e38e6d20e52b0 100644 (file)
                                ORDER BY tag_name");
        
                        $tags_str = "";
+                       $f_tags_str = "";
+
+                       $num_tags = 0;
 
                        while ($tmp_line = db_fetch_assoc($tmp_result)) {
-                               $tag = $tmp_line["tag_name"];
-                               $tags_str .= "<a href=\"javascript:parent.viewfeed('$tag')\">$tag</a>, "; 
-                       }               
+                               $num_tags++;
+                               $tag = $tmp_line["tag_name"];                           
+                               $tag_str = "<a href=\"javascript:parent.viewfeed('$tag')\">$tag</a>, "; 
+                               
+                               if ($num_tags == 5) {
+                                       $tags_str .= "<a href=\"javascript:showBlockElement('allEntryTags')\">...</a>";
+                               } else if ($num_tags < 5) {
+                                       $tags_str .= $tag_str;
+                               }
+                               $f_tags_str .= $tag_str;
+                       }
 
-                       $tags_str = preg_replace("/, $/", "", $tags_str);                       
+                       $tags_str = preg_replace("/, $/", "", $tags_str);
+                       $f_tags_str = preg_replace("/, $/", "", $f_tags_str);
 
                        print "<tr><td width='50%'>
                                <a href=\"" . $line["link"] . "\">".$line["link"]."</a>
                        print "</table></div>";
 
                        print "<div class=\"postIcon\">" . $feed_icon . "</div>";
-                       print "<div class=\"postContent\">" . $line["content"] . "</div>";
+                       print "<div class=\"postContent\">";
+                       
+                       if (db_num_rows($tmp_result) > 5) {
+                               print "<div id=\"allEntryTags\">Tags: $f_tags_str</div>";
+                       }
+
+                       print $line["content"] . "</div>";
                        
                        print "</div>";
 
                                        if ($line["feed_title"]) {                      
                                                print "<td class='hlContent'>$content_link</td>";
                                                print "<td class='hlFeed'>
-                                                       <a href='javascript:viewfeed($feed_id)'>".$line["feed_title"]."</a></td>";
+                                                       <a href='javascript:viewfeed($feed_id)'>".$line["feed_title"]."</a>&nbsp;</td>";
                                        } else {                        
                                                print "<td class='hlContent'>";
                
index 8095b314213c0f32258e812bcaf0bcb84d1c0532..742ace4af9aca17d28a7c11e3ff6ca847044f441 100644 (file)
 
                                $entry_tags = null;
 
-                               preg_match_all("/<a.*?rel=.tag.*?>([^>]+)<\/a>/i", 
+                               preg_match_all("/<a.*?href=.http:\/\/technorati.com\/tag\/([^\"\'>]+)/i", 
                                        $entry_content_unescaped, $entry_tags);
 
 //                             print "<br>$entry_title : $entry_content_unescaped<br>";
index c801e671dd90a2fe4643672600f6197a69aa3b72..15f87ff2952b91cfd7c9de90a56fe71f0e9d922c 100644 (file)
@@ -770,3 +770,11 @@ div.postHeader td.postDate {
        display : none;
 }
 
+#allEntryTags {
+       font-size : x-small;
+       border-width : 0px 0px 1px 0px;
+       border-style : solid;
+       border-color : #c0c0c0;
+       padding-bottom : 5px;
+       display : none;
+}