How to display a sum of clicks/download.

Post your Click counter digestion problems here
Post Reply
d-force
Posts: 2
Joined: Tue Nov 18, 2014 8:47 am

How to display a sum of clicks/download.

Post by d-force »

Hello and thank you for this useful script that works properly.

I just ask if there is a possibility to show in the page the sum of clicks/download of 2 or more files.

For example, in my page, I have 3 file to download:

file1.txt
file1.pdf
file1.kml

Of course for each file, CCount generate a different ID.

file1.txt = ID 1
file1.pdf = ID 2
file1.kml = ID 3

Now, I would like to display in the page the sum of these 3 download as follow:

<script>ccount_display('1+2+3')</script>

Is it possible?

Thank you in advance for your support!

d-force
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: How to display a sum of clicks/download.

Post by Klemen »

You could try something like this in the place you wish to show the sum:

Code: Select all

<script type="text/javascript">
var sum = ccount[1]['c'] + ccount[2]['c'] + ccount[3]['c'];
document.write(sum.formatThousands('US'));
</script>
To sum unique clicks you would change 'c' to 'u'
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
d-force
Posts: 2
Joined: Tue Nov 18, 2014 8:47 am

Re: How to display a sum of clicks/download.

Post by d-force »

Hello Klemen,
I will test again tomorrow, but it seems working.

Thank you so much! It has been very kind from you!

d-force
Post Reply