added decimal dots to start page statistics

This commit is contained in:
following
2013-08-04 16:00:37 +02:00
parent 4ba33b9156
commit 229c14071c
4 changed files with 22 additions and 4 deletions

View File

@ -101,6 +101,7 @@
$opt['locale']['EN']['format']['time'] = '%I:%M %p';
$opt['locale']['EN']['format']['timesec'] = '%X';
$opt['locale']['EN']['format']['phpdate'] = 'm/d/Y';
$opt['locale']['EN']['format']['dot1000'] = ',';
$opt['locale']['EN']['country'] = 'UK';
$opt['locale']['EN']['page']['subtitle1'] = 'Geocaching with Opencaching';
$opt['locale']['EN']['page']['subtitle2'] = '';

View File

@ -91,9 +91,9 @@
$tpl->assign('phpbb_link', $opt['cron']['phpbbtopics']['link']);
// current cache and log-counters
$tpl->assign('count_hiddens', sql_value_slave('SELECT COUNT(*) AS `hiddens` FROM `caches` WHERE `status`=1', 0));
$tpl->assign('count_founds', sql_value_slave('SELECT COUNT(*) AS `founds` FROM `cache_logs` WHERE `type`=1', 0));
$tpl->assign('count_users', sql_value_slave('SELECT COUNT(*) AS `users` FROM (SELECT DISTINCT `user_id` FROM `cache_logs` UNION DISTINCT SELECT DISTINCT `user_id` FROM `caches`) AS `t`', 0));
$tpl->assign('count_hiddens', number1000(sql_value_slave('SELECT COUNT(*) AS `hiddens` FROM `caches` WHERE `status`=1', 0)));
$tpl->assign('count_founds', number1000(sql_value_slave('SELECT COUNT(*) AS `founds` FROM `cache_logs` WHERE `type`=1', 0)));
$tpl->assign('count_users', number1000(sql_value_slave('SELECT COUNT(*) AS `users` FROM (SELECT DISTINCT `user_id` FROM `cache_logs` UNION DISTINCT SELECT DISTINCT `user_id` FROM `caches`) AS `t`', 0)));
// get newest events
$tpl->assign_rs('events', $getNew->rsForSmarty('event'));

View File

@ -388,4 +388,18 @@ function helppagelink($ocpage, $title='Instructions')
return "";
}
// format number with 1000er dots
function number1000($n)
{
global $opt;
if (isset($opt['locale'][$opt['template']['locale']]['format']['dot1000']) &&
$opt['locale'][$opt['template']['locale']]['format']['dot1000'] == ',')
return number_format($n);
else
return str_replace(',', '.', number_format($n));
}
?>

View File

@ -88,7 +88,10 @@
</p>
</div>
<p style="line-height: 1.6em;">{t 1=$usercountry|escape}Geocaches with most ratings in the last 30 days in %1.{/t}</p>
{include file="res_newratings.tpl" topratings=$topratings}
<div style="margin-bottom:16px">
{include file="res_newratings.tpl" topratings=$topratings}
</div>
{* forum news *}
{if $phpbb_enabled==true}