summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-08-09 16:48:23 +0100
committerAndrew Dolgov <[email protected]>2007-08-09 16:48:23 +0100
commit22d1f3db53d40b5c05e74f46c03828b143bfb2c1 (patch)
tree2a38aca748f0ec2d6726cd1aa6c500782de70c2f /functions.php
parent49aa6de96422b2ffecf06e51e19e2ceb8cd005ec (diff)
limit the amount of tags shown in CDM
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/functions.php b/functions.php
index ff64a0a70..11d1d8c04 100644
--- a/functions.php
+++ b/functions.php
@@ -4044,13 +4044,25 @@
$tags = get_article_tags($link, $id);
$tags_str = "";
+ $full_tags_str = "";
foreach ($tags as $tag) {
$num_tags++;
- $tags_str .= "<a href=\"javascript:viewfeed('$tag')\">$tag</a>, ";
+ $full_tags_str .= "<a href=\"javascript:viewfeed('$tag')\">$tag</a>, ";
+ if ($num_tags < 5) {
+ $tags_str .= "<a href=\"javascript:viewfeed('$tag')\">$tag</a>, ";
+ } else if ($num_tags == 5) {
+ $tags_str .= "...";
+ }
}
$tags_str = preg_replace("/, $/", "", $tags_str);
+ $full_tags_str = preg_replace("/, $/", "", $full_tags_str);
+
+ $all_tags_div = "<span class='cdmAllTagsCtr'>...<div class='cdmAllTags'>All Tags: $full_tags_str</div></span>";
+
+ $tags_str = preg_replace("/\.\.\.$/", "$all_tags_div", $tags_str);
+
if ($tags_str == "") $tags_str = "no tags";