PDA

View Full Version : Suggestions needed for pdf tracking mod


chris33
04-06-2005, 12:31 PM
I have a directory full of pdfs that are now indexed and searchable by PhpDig.

I am looking to add a feature whereby when the user clicks on a search result (and consequently downloads a pdf file) a record is kept that that specific file was downloaded.

Then I'll make a separate app (or add it to the PhpDig admin page) that can display stats for all the pdfs (how many times each one was downloaded)

I'm new to PhpDig so I though that I would ask if anyone had a suggestion as to best go about this.

One idea i had :

I can manually edit the database: change the spider.path field for a all the pdf's from "pdf/" to "download.php?file="

download.php would handle the hand-off, writing a row to the DB and sending the user the file.

Is this the way to go about his or is there a better way?

chris33
04-06-2005, 12:32 PM
I have a directory full of pdfs that are now indexed and searchable by PhpDig.

I am looking to add a feature whereby when the user clicks on a search result (and consequently downloads a pdf file) a record is kept that that specific file was downloaded.

Then I'll make a separate app (or add it to the PhpDig admin page) that can display stats for all the pdfs (how many times each one was downloaded)

I'm new to PhpDig so I though that I would ask if anyone had a suggestion as to best go about this.

One idea i had :

I can manually edit the database: change the spider.path field for a all the pdf's from "pdf/" to "download.php?file="

download.php would handle the hand-off, writing a row to the DB and sending the user the file.

Is this the way to go about his or is there a better way?

Charter
04-06-2005, 12:58 PM
Why not just go to the admin panel, click the "Statistics" link and then click the "Last search clicks" link?

chris33
04-06-2005, 01:08 PM
Hi, Charter

Well I need to keep a total of how many times each pdf was downloaded. Later I will also need to tag the downloads to specific users and throttle how many they can download.

Charter
04-06-2005, 02:51 PM
PhpDig doesn't keep track of specific users, but you can get totals by running the following query:

SELECT count(*),c_url FROM clicks GROUP BY c_url;

GunMuse
04-22-2005, 01:20 PM
Use your server stats this is not a front side application issue. Awstats will tell you exactly how many downloaded the file. It should be on your server anyway.