Forums / Setup & design / Download counter to limit user access

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

eZ debug

Timing: Jan 18 2025 15:50:43
Script start
Timing: Jan 18 2025 15:50:43
Module start 'content'
Timing: Jan 18 2025 15:50:43
Module end 'content'
Timing: Jan 18 2025 15:50:43
Script end

Main resources:

Total runtime0.2070 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 588.9453180.8281
Module start 'content' 0.00740.0058 769.773493.8984
Module end 'content' 0.01320.1937 863.6719522.3281
Script end 0.2069  1,386.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00341.6271200.0002
Check MTime0.00130.6248200.0001
Mysql Total
Database connection0.00140.678410.0014
Mysqli_queries0.161177.83671410.0011
Looping result0.00150.71371390.0000
Template Total0.193493.410.1934
Template load0.00060.290410.0006
Template processing0.192893.135910.1928
Override
Cache load0.00040.197710.0004
Sytem overhead
Fetch class attribute can translate value0.00080.391310.0008
XML
Image XML parsing0.00030.157010.0003
General
dbfile0.00261.2619200.0001
String conversion0.00000.002330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs