aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-03-29 19:30:22 +0200
committerArthurHoaro <arthur@hoa.ro>2016-03-31 18:01:05 +0200
commitb0128609f4b29c55d86152f3d0ff4b4e07bbcbf8 (patch)
treefbc69bb4a5f1186ac3c324927c2266dda658b926 /index.php
parent5f143b72eaafeda533fcb997ecca73d38258546e (diff)
downloadShaarli-b0128609f4b29c55d86152f3d0ff4b4e07bbcbf8.tar.gz
Shaarli-b0128609f4b29c55d86152f3d0ff4b4e07bbcbf8.tar.zst
Shaarli-b0128609f4b29c55d86152f3d0ff4b4e07bbcbf8.zip
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.
Diffstat (limited to 'index.php')
-rw-r--r--index.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/index.php b/index.php
index dfc00fbd..735615ff 100644
--- a/index.php
+++ b/index.php
@@ -1015,11 +1015,16 @@ function renderPage()
1015 return strcasecmp($a, $b); 1015 return strcasecmp($a, $b);
1016 }); 1016 });
1017 1017
1018 $tagList=array(); 1018 $tagList = array();
1019 foreach($tags as $key=>$value) 1019 foreach($tags as $key => $value) {
1020 // Tag font size scaling: default 15 and 30 logarithm bases affect scaling, 22 and 6 are arbitrary font sizes for max and min sizes. 1020 // Tag font size scaling:
1021 { 1021 // default 15 and 30 logarithm bases affect scaling,
1022 $tagList[$key] = array('count'=>$value,'size'=>log($value, 15) / log($maxcount, 30) * (22-6) + 6); 1022 // 22 and 6 are arbitrary font sizes for max and min sizes.
1023 $size = log($value, 15) / log($maxcount, 30) * 2.2 + 0.8;
1024 $tagList[$key] = array(
1025 'count' => $value,
1026 'size' => number_format($size, 2, '.', ''),
1027 );
1023 } 1028 }
1024 1029
1025 $data = array( 1030 $data = array(