Gossamer Forum
Home : Products : DBMan : Customization :

Count link stats

Quote Reply
Count link stats
I want to count and display the number of times a URL in DBMan has been clicked. I am using ClickCount by GuzZzt at http://www.guzzzt.com/ for the tracking. Getting it to display within DBMan is a little difficult though. I searched the threads for alternatives for calling scripts through SSI and came up with this code:

in html.pl I added a new subroutine:
Code:
sub click_count {
# --------------------------------------------------------
# This is text to include. Use like an SSI.

my $file = shift;
open (FILE, "<$file") or die "Can't open $file ($!)";
print ;
close FILE;
}

then in the same file, under sub html_record, links are called with:

Code:
<A HREF="/cgi-bin/clickcount.cgi?action=jump&URL=$rec{'URL'}" TARGET="window2">$rec{'URL'}</A>

and the # of times clicked is displayed with:

Code:
|; &click_count ("../clickcount.cgi"); print qq|

This adds up the click count alright, but it doesn't display the number of times a link was clicked. It shows a number next to each record, but it just counts up. Like record 1 has a 1 next to it, record 2 a 2, etc.

Anybody have a suggestion to how to get it to show the actual count?

Thanks!