From: Andrew Dolgov Date: Tue, 29 Nov 2005 10:33:00 +0000 (+0100) Subject: show only 4 tags in article view, possibly improve tag detection X-Git-Tag: schema_feature_freeze_for_1.1~38 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=42918a07652da45cd474db65322692b19b35b4fa;p=tt-rss.git show only 4 tags in article view, possibly improve tag detection --- diff --git a/backend.php b/backend.php index e541c85c..30c45e11 100644 --- a/backend.php +++ b/backend.php @@ -640,13 +640,25 @@ 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 .= "$tag, "; - } + $num_tags++; + $tag = $tmp_line["tag_name"]; + $tag_str = "$tag, "; + + if ($num_tags == 5) { + $tags_str .= "..."; + } 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 " ".$line["link"]." @@ -661,7 +673,13 @@ print ""; print "
" . $feed_icon . "
"; - print "
" . $line["content"] . "
"; + print "
"; + + if (db_num_rows($tmp_result) > 5) { + print "
Tags: $f_tags_str
"; + } + + print $line["content"] . "
"; print ""; @@ -1099,7 +1117,7 @@ if ($line["feed_title"]) { print "$content_link"; print " - ".$line["feed_title"].""; + ".$line["feed_title"]." "; } else { print ""; diff --git a/functions.php b/functions.php index 8095b314..742ace4a 100644 --- a/functions.php +++ b/functions.php @@ -431,7 +431,7 @@ $entry_tags = null; - preg_match_all("/([^>]+)<\/a>/i", + preg_match_all("/]+)/i", $entry_content_unescaped, $entry_tags); // print "
$entry_title : $entry_content_unescaped
"; diff --git a/tt-rss.css b/tt-rss.css index c801e671..15f87ff2 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -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; +}