News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

Control Panel Status is incorrect for large numbers - [Fixed in 3.2.45]

Started by ColinM, 20.06.2016 18:59:28

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ColinM

There is also a small problem with the number of Downloads reported in a status panel when there are a high number of downloads.  For example if there are say 26,143 it reports just 26.  The (int) cast, which is used in the code, will terminate at the comma so 26,143 will be returned as 26.  The intval() function gives the same problem.

See http://www.jdownloads.com/forum/index.php?topic=8953.0 for example

File \com_jdownloads\admin\views\jdownloads\tmpl\default.php has code in lines 161 to 183 such as
  <?php echo (int)$stats_data['files_public'];?>
This could be replaced with code such as
<?php $temp str_replace',''',$stats_data['files_public']);
  echo (int)
$temp;?>

If there is a possibility of multiple characters due to language differences then
  <?php $temp str_replace(array('.'','), '',$stats_data['files_public']);
  echo (int)
$temp;?>

 
  Each of the above could be combined into a one line statement.
I have not tested the above as I have insufficient downloads!!
Colin M
  •  

Arno

Colin,
thanks for this info. Maybe could help also floatval(). I will check and fix it.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

ColinM

Arno
Just discovered a php function numfmt_parse which might also be worth checking out. See
http://man.hubwiz.com/docset/PHP.docset/Contents/Resources/Documents/php.net/manual/en/numberformatter.parse.html
Useage is to set up format using the language code and then it sorts it out.
Colin
PS there is also a currency based one numfmt_parse_currency
Colin M
  •  

Arno

Hi Colin,
thanks for the link but i have this bug already fixed.
I have removed the compute parts in the default.php and also the (int).  ;)
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •