From b0128609f4b29c55d86152f3d0ff4b4e07bbcbf8 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 29 Mar 2016 19:30:22 +0200 Subject: [PATCH] Fixes #526: bad font size separator in tagcloud with some locale * Force the number format with number_format(). * Reduce the size deciment number to 2. --- index.php | 15 ++++++++++----- tpl/tagcloud.html | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/index.php b/index.php index dfc00fb..735615f 100644 --- a/index.php +++ b/index.php @@ -1015,11 +1015,16 @@ function renderPage() return strcasecmp($a, $b); }); - $tagList=array(); - foreach($tags as $key=>$value) - // Tag font size scaling: default 15 and 30 logarithm bases affect scaling, 22 and 6 are arbitrary font sizes for max and min sizes. - { - $tagList[$key] = array('count'=>$value,'size'=>log($value, 15) / log($maxcount, 30) * (22-6) + 6); + $tagList = array(); + foreach($tags as $key => $value) { + // Tag font size scaling: + // default 15 and 30 logarithm bases affect scaling, + // 22 and 6 are arbitrary font sizes for max and min sizes. + $size = log($value, 15) / log($maxcount, 30) * 2.2 + 0.8; + $tagList[$key] = array( + 'count' => $value, + 'size' => number_format($size, 2, '.', ''), + ); } $data = array( diff --git a/tpl/tagcloud.html b/tpl/tagcloud.html index 5891cd2..e449f29 100644 --- a/tpl/tagcloud.html +++ b/tpl/tagcloud.html @@ -12,8 +12,8 @@
{loop="tags"} - {$value.count} - {$key} + {$value.count}{$key} {loop="$value.tag_plugin"} {$value} {/loop}