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.

eZ debug

Timing: Jan 31 2025 04:29:43
Script start
Timing: Jan 31 2025 04:29:43
Module start 'layout'
Timing: Jan 31 2025 04:29:43
Module start 'content'
Timing: Jan 31 2025 04:29:44
Module end 'content'
Timing: Jan 31 2025 04:29:44
Script end

Main resources:

Total runtime1.1841 sec
Peak memory usage4,096.0000 KB
Database Queries64

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 588.2500151.2266
Module start 'layout' 0.00460.0022 739.476636.6797
Module start 'content' 0.00681.1762 776.15631,003.3516
Module end 'content' 1.18300.0011 1,779.507811.8281
Script end 1.1841  1,791.3359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2703160.0002
Check MTime0.00150.1283160.0001
Mysql Total
Database connection0.00070.056510.0007
Mysqli_queries1.137096.0209640.0178
Looping result0.00050.0415620.0000
Template Total1.156397.720.5782
Template load0.00200.165820.0010
Template processing1.154397.485920.5772
Template load and register function0.00160.134410.0016
states
state_id_array0.00080.065310.0008
state_identifier_array0.00110.091220.0005
Override
Cache load0.00160.1349240.0001
Sytem overhead
Fetch class attribute can translate value0.00060.053340.0002
Fetch class attribute name0.00180.153650.0004
XML
Image XML parsing0.00090.072440.0002
class_abstraction
Instantiating content class attribute0.00000.000750.0000
General
dbfile0.00150.1238170.0001
String conversion0.00000.000440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs