Hit Counter

Permalink
How do you change the start number on the hit counter?
We have already had nearly 8,000 hits and it is automatically showing 2890 - where do you edit this?

Evelyn
View Replies:
tallacman replied on at Permalink Reply
tallacman
You can always modify this kind of stuff in the actual database. I'll take a look at the block to see if there is a better way.
Evelyn replied on at Permalink Reply
Evelyn
thanks for that - not sure what folder/file to look at in the concrete files on our admin site to alter it myself tho.
tallacman replied on at Permalink Reply
tallacman
Actually I cannot find where it lives. It accesses the PageStatistics table but I can't find any relevant number to correspond to the page count. #ineedtoknowmmore
Evelyn replied on at Permalink Reply
Evelyn
This is the info using firebug on the web page
<div id="blockStyle193Main20" class=" ccm-block-styles"> 0002996</div>
Is this any help, I've done a search in our admin site for different bits of this path but nothing comes up....
Steevb replied on at Permalink Reply 1 Attachment
Steevb
Put page in edit mode and trying setting your hit counter to the default settings.

See attached image.
Steevb replied on at Permalink Reply
Steevb
Are you talking about the hit counter add on?
stonereptiles replied on at Permalink Reply
You realize the C% panel shows you every page hit?
The tracker should be tracking unique visits to the page it is located on.

The numbers will not line up. The counter will be more accurate
Evelyn replied on at Permalink Reply
Evelyn
No, I didn't know that, not sure where to look for that either.
Evelyn replied on at Permalink Reply
Evelyn
Yes, thats correct.

*Evelyn McCorkell*
*www.3facesgallery.com*
*0407 624 650*



On 7 December 2011 10:24, Concrete5 Community
<[email protected]>wrote:
joseajohnson replied on at Permalink Reply
joseajohnson
Assuming the block you're using is the 'page_hit_counter' and that what you'd like displayed is cumulative site hits, as opposed to unique visits per page (as pointed out by @stonereptiles), a change to line 10 in
/packages/page_hit_counter/models/counter.php

should reflect a number closer to your expectations:
// change this
//          return $db->GetOne("select count(pstID) from PageStatistics where cID = ?", array($cID));
// to this
         return $db->GetOne("select count(pstID) from PageStatistics where cID > 0", null);

Swapping the 'cID' condition to all positive numbers aggregates all page hits per query, and the 'null' discards the passed pageID.

Like @tallacman pointed out, the block pulls from the 'PageStatistics' table, where each line item is timestamped and associated with an individual page, so modifying the table to inflate your statistics would probably skew your actual stats as reported by the dashboard. Doubtless a small script to loop an insert with dummy data would accomplish it, but to go that route simply to change the display seems a bit much.

If you really must massage your displayed numbers after making the change, find the difference between your target number and the displayed number (ie. actual hits = 3000, desired = 8000; difference = 5000), and plug into the following modification of the file
/packages/page_hit_counter/blocks/page_hit_counter/view.php

after line 3, where the value of $count is assigned:
$count = ($count + 5000);

This ought to pad your number to a value closer to what you expect, without tampering with the actual stats available to you via the dashboard.

Good Luck!
csebe replied on at Permalink Reply
Hi Jose,

excellent post, thank you.

However the second part
$count = ($count + 5000);

is silently ignored in my case...
Maybe there is another copy of view.php (and not /packages/page_hit_counter/blocks/page_hit_counter/view.php) that needs to be altered ?!?

Anyway, I solved it by altering the same file as in part one (i.e. /packages/page_hit_counter/models/counter.php ) and add the "bonus" here, as follows:

return ($db->GetOne("select count(pstID) from PageStatistics where cID > 0", null) + 5000);


Can you see any problems with that?

Cheers,
Lian
Evelyn replied on at Permalink Reply
Evelyn
That seems to have worked well, thanks.


*Evelyn McCorkell*
*www.3facesgallery.com*
*0407 624 650


**Be the change - how do YOU want it to be?*
Create or upgrade your website -
We use *www.accessall.com.au* - *keeping up with change**
**
*



On 25 May 2012 00:12, concrete5 Community <[email protected]>wrote:
Studio8 replied on at Permalink Reply
Hi, does anyone know, why Page Hit Counter only counts when someone is logged in. When I logout, counter does not count anymore. It only posts new hits when I put page in edit mode and then exit and save edits.
Evelyn replied on at Permalink Reply
Evelyn
I don't know the answer to that but my hit counter is registering hits to pages without being logged in to edit.