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 "