Download counter to limit user access

Author Message

Anna Torelli

Thursday 06 May 2004 8:25:56 am

I am setting up a site where there is a collection of PDF.
To download/open these PDF the user has to sign up and then login.
We would like to limit the number of downloaded files per day (let's say 5 per day max).
How can I count the number of documents that a single user download from a specific section???
Thanks for any kind of idea.

Paul Forsyth

Thursday 06 May 2004 9:34:54 am

You can't do this with present version of eZ publish.

It may be possible to add code to count the views a particular element has received or count the number of times some piece of code that serves the pdf file has run.

However I think the best approach may be to look at your web server and find if there is something that can be done there. At the end of the day it is the server that delivers the file. Ez publish will in general just provide a link to it, which the web server has access to.

paul

--
http://www.visionwt.com

Hugo Siles

Thursday 06 May 2004 10:22:56 am

hi paul

how it is posible to count the number of times an item has been visited.. for example an article???

Jan Borsodi

Friday 07 May 2004 4:23:05 am

If you are using the content/download functionality then you could create your own binaryfile handler.
Take a look at <i>kernel/classes/binaryhandlers/ezfilepasstrough/ezfilepasstroughhandler.php</i> which is the default handler.
Here you could check a custom database table based on the user ID to figure out how many times it has been downloaded.

Ofcourse this requires that you know how to program PHP.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.