Willkommen Gast. Bitte Einloggen oder Registrieren
 
Sprache wählen:
 
 
Statistik Version 25 online.

  ÜbersichtHilfeSuchenEinloggenRegistrieren  
 
Seitenindex umschalten Seiten: 1
Thema versenden Drucken
How can I change the delimiter in counter.php (Gelesen: 333 mal)
John Motyer
Junior Member
**
Offline



Beiträge: 75
Burlington (Toronto), Canada
Geschlecht: male
How can I change the delimiter in counter.php
10.12.25 um 03:58:45
 
Hello, Holger,

Last year I had asked in
THIS
post about changing the delimiter (thousands separator) from a "." (dot) to a "," (comma), and you replied with the code for me to change in order to accomplish that.  Thank you again, it worked great.

With your new v25, we can set the separator ourselves now, thank you.

I am inquiring at this time what file/code I would need to modify, in order to change the delimiter (thousands separator) for the counter.php file, from a dot to a comma.

Thank you in advance, and thank you for v25.

Tschüss,
John
Zum Seitenanfang
 

My phpWebStats:
| AuroraWings | FusionWings | FusionWings Galleries | +7 more
Homepage  
IP gespeichert
 
Holger
Administrator
*****
Offline



Beiträge: 2324
Germany NRW
Geschlecht: male
Re: How can I change the delimiter in counter.php
Antwort #1 - 14.12.25 um 14:52:21
 
Hi John,

We probably should have included the counter in that 😉
Open counter.php in an editor and find lines 134-141.

search for:

Code (PHP):
number_format ( $module1 , 0 , "," , "." ) 


replace with:

Code (PHP):
number_format ( $module1 , 0 , "," , "," ) 



In the next update, we could also link this to the Admin Center.

Holger
Zum Seitenanfang
 

... ... ...
Homepage  
IP gespeichert
 
Holger
Administrator
*****
Offline



Beiträge: 2324
Germany NRW
Geschlecht: male
Re: How can I change the delimiter in counter.php
Antwort #2 - 14.12.25 um 15:14:16
 
Option 2

search line 127
Code (PHP):
include ( 'config/config.php' ); // include path to logfile 


add new line 128
Code (PHP):
if ( isset ( $delimiters ) && ( $delimiters == 1 ) ) { $delimiter = ","; } else { $delimiter = "."; } 



edit lines 135 – 142
Code (PHP):
number_format ( $moduleX , 0 , "," , "," )  


replace with:
Code (PHP):
number_format ( $moduleX , 0 , "," , $delimiter )  



The counter is set according to the settings in the Admin Center.

Holger
Zum Seitenanfang
 

... ... ...
Homepage  
IP gespeichert
 
John Motyer
Junior Member
**
Offline



Beiträge: 75
Burlington (Toronto), Canada
Geschlecht: male
SOLVED: How can I change the delimiter in counter.
Antwort #3 - 15.12.25 um 11:42:42
 
Hello again, Holger, that worked perfectly, thank you.  Although at first I used a hard-coded comma (
,
), I changed all my sites to instead use
$delimiter
.

If anyone else wishes to change their own Counters to use commas,
in addition to
Holger's option 2 above, you can change the Page Impressions value on your ticker to also use commas, with this code change in that same counter.php file:

search for:
Code (PHP):
{ $pageimpression = number_format ( file_row_size_big ( $logfile ) , 0 , "," , "." ); } 



replace with:
Code (PHP):
{ $pageimpression = number_format ( file_row_size_big ( $logfile ) , 0 , "," , $delimiter ); } 



Thanks again, Holger, and have a great day.

Regards,
John
Zum Seitenanfang
 

My phpWebStats:
| AuroraWings | FusionWings | FusionWings Galleries | +7 more
Homepage  
IP gespeichert
 
Seitenindex umschalten Seiten: 1
Thema versenden Drucken