Counter block

Permalink
Installed counter block and it will not start at 0000 it currently says 1620 have tried deleting and reinstalling but same result. How can you set it to zero?

 
mnakalay replied on at Permalink Reply
mnakalay
Hi,
If you mean the page hit counter, it gets its results from C5 own page statistics which means data that predates the installation of the add-on. The number you see represents the count since you installed C5
harrychristopher replied on at Permalink Reply
Ok I can see that now ,but is it possible to reset it to zero?
mnakalay replied on at Permalink Best Answer Reply
mnakalay
I don't think there is any way to reset the statistics build in C5.

As far as I know you could do what you want in 2 ways:
1- the brutal way is to delete the statistics manually from the datatabse table PageStatistics. I wouldn't recommend that though
2- You can slightly modify the code in the add-on models/counter.php file. Change this
return $db->GetOne("select count(pstID) from PageStatistics where date = ? and cID = ?", array($date,$cID));

To this
return $db->GetOne("select count(pstID) from PageStatistics where date >= ? and cID = ?", array($date,$cID));


It might work or not as dealing with dates can still be a mysterious things and I'm not totally sure of this one. But if it works what it should do is only show you the statistics starting from the date you selected. a date in the future will return 0.