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.
This commit is contained in:
parent
5f143b72ea
commit
b0128609f4
2 changed files with 12 additions and 7 deletions
13
index.php
13
index.php
|
@ -1016,10 +1016,15 @@ function renderPage()
|
||||||
});
|
});
|
||||||
|
|
||||||
$tagList = array();
|
$tagList = array();
|
||||||
foreach($tags as $key=>$value)
|
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.
|
// Tag font size scaling:
|
||||||
{
|
// default 15 and 30 logarithm bases affect scaling,
|
||||||
$tagList[$key] = array('count'=>$value,'size'=>log($value, 15) / log($maxcount, 30) * (22-6) + 6);
|
// 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(
|
$data = array(
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
|
|
||||||
<div id="cloudtag">
|
<div id="cloudtag">
|
||||||
{loop="tags"}
|
{loop="tags"}
|
||||||
<span class="count">{$value.count}</span>
|
<span class="count">{$value.count}</span><a
|
||||||
<a href="?searchtags={$key|urlencode}" style="font-size:{$value.size}pt;">{$key}</a>
|
href="?searchtags={$key|urlencode}" style="font-size:{$value.size}em;">{$key}</a>
|
||||||
{loop="$value.tag_plugin"}
|
{loop="$value.tag_plugin"}
|
||||||
{$value}
|
{$value}
|
||||||
{/loop}
|
{/loop}
|
||||||
|
|
Loading…
Reference in a new issue