diff options
author | Andrew Dolgov <[email protected]> | 2005-11-29 11:33:00 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-11-29 11:33:00 +0100 |
commit | 42918a07652da45cd474db65322692b19b35b4fa (patch) | |
tree | a7e772d1513564d8e0f4d718d6eeca4d2124bca1 | |
parent | 36aab70f080d7ab50a754b522e62a2f03ccc167a (diff) |
show only 4 tags in article view, possibly improve tag detection
-rw-r--r-- | backend.php | 30 | ||||
-rw-r--r-- | functions.php | 2 | ||||
-rw-r--r-- | tt-rss.css | 8 |
3 files changed, 33 insertions, 7 deletions
diff --git a/backend.php b/backend.php index e541c85c8..30c45e117 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 .= "<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> @@ -661,7 +673,13 @@ 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>"; @@ -1099,7 +1117,7 @@ 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> </td>"; } else { print "<td class='hlContent'>"; diff --git a/functions.php b/functions.php index 8095b3142..742ace4af 100644 --- a/functions.php +++ b/functions.php @@ -431,7 +431,7 @@ $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>"; diff --git a/tt-rss.css b/tt-rss.css index c801e671d..15f87ff29 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; +} |