Page 1 of 1

Total Clicks Per Multiple Files

Posted: Sat May 07, 2005 9:24 pm
by RFX
Hello,
My question is that I have a desktop wallpaper site, in which I have two distinct sizes for each one of my particualr wallpapers (1024x768 and 1280x1024), yet I want to display the total downloads for the two combined. I know they need to have two different ID#'s, but is there a way to show the total number of clicks combined.

Example:::
File01.jpg-1024x768
File01.jpg-1280x1024
Total Downloads :: ??

Hope my question made sense. . . Great script by the way.

Posted: Sun May 08, 2005 9:00 am
by Klemen
Hi,

Impossible without PHP knowledge as you'd have to write a script to display that. Unfortunately I don't have the time to do it for you.

Sorry I can't be of help.

Regards

Posted: Sun May 08, 2005 5:08 pm
by Guest
Hello,
Thanks for the reply, but is it possible to add the two variables together using Javascript.

Like instead of just putting ::
<script language="Javascript">ccount_display('1')</script>

You put ::
<script language="Javascript">ccount_display('1')+ccount_display('2')</script>

or something to that manner?

Thanks for your time

Posted: Mon May 09, 2005 9:59 am
by Klemen
Hi,

Hmmm, you could try this:

Add this code to somewhere in your document head (between <HEAD> and </HEAD> tags):

Code: Select all

<script language="javascript"><!--
function ccount_sum_two(ccid1,ccid2)
{
var ccount_sum=0;

ccount_sum+=ccount_link[ccid1];
ccount_sum+=ccount_link[ccid2];

document.write(ccount_sum);
}
//-->
</script>
Then use this code to sum for example counts on link ID 1 and link ID 4:

Code: Select all

<script language="javascript"><!--
ccount_sum_two(1,4);
//-->
</script>
To count other IDs just replace 1 and 4 in the code above.

Haven't tested this, please let me know if it works.

Regards

Posted: Tue May 10, 2005 10:01 am
by RFX
That code worked perfectly. I can't thank you enough. I'll be sure to place a link to your scripts on my homepage.

Once Again, Thanks
Keep Up The Amazing Work :D

-RFX