Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Counting hits to the site,how about counting downloads?

Quote Reply
Counting hits to the site,how about counting downloads?
I know there is a mechanism in place to count the hits to a site, but how about a way of counting downloads. We allow file uploads and it's finally working, s now I'd like to be able to count the times it's been directly downloaded off of our site. Is this possible without too much fuss and muss?
Quote Reply
Re: [aph] Counting hits to the site,how about counting downloads? In reply to
Hi,

You mean something like this? =)

http://www.ultranerds.com/...ns/Admin_Rating_L86/

See the table below the "Download" area;

Code:
Range Downloads
Today 1
Today (unique) 1
Yesterday 0
Overall 1

I'm literally going to be finishing this in the next few hours (I'm hoping =)).


Please note, its not going to be free (will be around $50) .. but its got lots of features =)

"Distinct" downloads
Overall downloads
Yesterdays downloads
Todays downloads

Can be used for ANY download column

Links in on the plg_jump hook, so that you can still go through jump.cgi as you are at the moment.

It also records their IP, date, LinkID,and the field that they download it from. For example, if you have 3 download fields;

PDFDownload
DocDownload
ZIPDownload

Then you could still use this plugin, and it would work no matter what. i.e;

Code:
<%Plugins::TrackDownloads::ViewDownloadStats($ID,'PDFDownload')%>

<table border="0" style="border-collapse: collapse" width="100%" id="table1" class="text">
<tr>
<td class="text"><b>Range</b></td>
<td class="text"><font face="Tahoma" size="2"><b>Downloads</b></font></td>
</tr>
<tr>
<td class="text"><font face="Tahoma" size="2">Today</font></td>
<td class="text"><%Today_Downloads%></td>
</tr>
<tr>
<td class="text"><font face="Tahoma" size="2">Today (unique)</font></td>
<td class="text"><%Distinct_Downloads%></td>
</tr>
<tr>
<td class="text"><font face="Tahoma" size="2">Yesterday</font></td>
<td class="text"><%Yesterday_Downloads%></td>
</tr>
<tr>
<td class="text"><font face="Tahoma" size="2">Overall</font></td>
<td class="text"><%Overall_Downloads%> </td>
</tr>
</table>

..and then further down;

Code:
<%Plugins::TrackDownloads::ViewDownloadStats($ID,'DocDownload')%>

<table border="0" style="border-collapse: collapse" width="100%" id="table1" class="text">
<tr>
<td class="text"><b>Range</b></td>
<td class="text"><font face="Tahoma" size="2"><b>Downloads</b></font></td>
</tr>
<tr>
<td class="text"><font face="Tahoma" size="2">Today</font></td>
<td class="text"><%Today_Downloads%></td>
</tr>
<tr>
<td class="text"><font face="Tahoma" size="2">Today (unique)</font></td>
<td class="text"><%Distinct_Downloads%></td>
</tr>
<tr>
<td class="text"><font face="Tahoma" size="2">Yesterday</font></td>
<td class="text"><%Yesterday_Downloads%></td>
</tr>
<tr>
<td class="text"><font face="Tahoma" size="2">Overall</font></td>
<td class="text"><%Overall_Downloads%> </td>
</tr>
</table>

..and further down still;

Code:
<%Plugins::TrackDownloads::ViewDownloadStats($ID,'ZIPDownload')%>

<table border="0" style="border-collapse: collapse" width="100%" id="table1" class="text">
<tr>
<td class="text"><b>Range</b></td>
<td class="text"><font face="Tahoma" size="2"><b>Downloads</b></font></td>
</tr>
<tr>
<td class="text"><font face="Tahoma" size="2">Today</font></td>
<td class="text"><%Today_Downloads%></td>
</tr>
<tr>
<td class="text"><font face="Tahoma" size="2">Today (unique)</font></td>
<td class="text"><%Distinct_Downloads%></td>
</tr>
<tr>
<td class="text"><font face="Tahoma" size="2">Yesterday</font></td>
<td class="text"><%Yesterday_Downloads%></td>
</tr>
<tr>
<td class="text"><font face="Tahoma" size="2">Overall</font></td>
<td class="text"><%Overall_Downloads%> </td>
</tr>
</table>

I'll let you know once its finished, if your interested :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Counting hits to the site,how about counting downloads? In reply to
Im just looking for something really simple, that will count everytime someone clicks on my direct download link just like it does for the hits now. I suppose I might be able to look at what is counting the hits in the jump.cgi and copy it out to down.cgi and figure out the rest.
Quote Reply
Re: [Andy] Counting hits to the site,how about counting downloads? In reply to
Sounds interesting Andy !

I sure would like to know how you get on Wink

John
Significant Media
Quote Reply
Re: [Jag] Counting hits to the site,how about counting downloads? In reply to
Hi,

Its already done =)

http://www.ultranerds.com/...TrackDownloads_L166/

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [aph] Counting hits to the site,how about counting downloads? In reply to
If your looking for a simple download file counter that updates the hit counter only if a unique IP address is used this works with Glinks 3.

Open jump.pm in File manager.

Search for this code (Ctrl+F in Internet Explorer): return 1;

and update:

Code:
binmode $fh;
while (read($fh, my $buffer, 65536)) {
print $buffer;
}
return 1;
with:

Code:
while (read($fh, my $buffer, 65536)) {
print $buffer;
}
my $ip1 = $ENV{REMOTE_ADDR} || 'None';
my $click_db1 = $DB->table ('ClickTrack');
my $rows1 = $click_db1->count ( { LinkID => $id, IP => $ip1, ClickType => 'Hits' } );
if (! $rows1) {
$links->update ( { Hits => \"Hits + 1" }, { ID => $id }, { GT_SQL_SKIP_INDEX => 1 } );
$click_db1->insert ( { LinkID => $id, IP => $ip1, ClickType => 'Hits', Created => \"NOW()"} );
}

return 1;

Its based on Laura's free LinksSQL 2 version here:

http://gossamer-threads.com/...orum.cgi?post=248923



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile