3 years 11 months ago - 3 years 11 months ago#4037by cool410
I need away to reset all my hits every month back to zero.
I have a feeling that Affiliate windows is missing some of my hits
so I want to reset on the same day as they start the new month
can this be done easily as I seem at the moment only to be able
to reset one at a time and I have over 10,000 items.
I did a search on this subject and it seem to be not mentioned.
Sorry, was sure I did write a reply before the weekend but somewhere that one got lost.
The component does not have a reset-hits function. I wrote a small script to do the job.
Counting hits is a bit tricky in the component, hits are linked to individual items so if a item is removed from the database the hits are also. And you might get clicks from bots.
A more reliable method is using (google)analytics to count the click outs. Either using a click trigger on your affiliate links, using a clickout page or using the google measurement protocol
#goes into the root of your site, next to the configuration.php
# file name for example reset-all.php
#requires a recent version of the component ( for mysqli.php)
$db_table= $config->dbprefix .'dataitems';
$db_feeds= $config->dbprefix .'datafeeds';
db_connect($db_host, $db_user, $db_password,$db_database);
$q="UPDATE `$db_table` set hits=0 ";
echo "Hits reset - " . db_query($q);
3 years 10 months ago - 3 years 10 months ago#4040by cool410
I Tried it nothing happened just got a blank web page .
was I meant to do something else I made a new file and called it zero-hits.php
and put it in the root as per instructed
I assume to use it I just call this PHP and go with the flow.
Thanks, I didn’t mind the delay it was not a life threatening problem.
and I hope you enjoyed the weekend . which is far more important Family etc.