Forums / Setup & design / ezbinaryfile download_count

ezbinaryfile download_count

Author Message

Daniel Guerrier

Wednesday 27 July 2005 11:33:23 am

The table definition for the ezbinaryfile table has a column for download_count. How is this updated?
Am I expect to update this value manually or is there a machanism that is supposed to maintain this field?

Thanks,
Danny

Daniel Guerrier

Friday 29 July 2005 8:42:56 am

Anyone???

Daniel Guerrier

Friday 29 July 2005 9:14:49 am

This is all I can find in the docs, but it does not help much.

 

The number of times the file has been downloaded through the "download" view of the "content" module.

Luc Chase

Friday 29 July 2005 9:19:40 am

sh-2.05$ find * -name \*.php | xargs grep 'download_count'
kernel/classes/datatypes/ezbinaryfile/ezbinaryfile.php: 'download_count' => array( 'name' => 'DownloadCount',
kernel/classes/datatypes/ezbinaryfile/ezbinaryfiletype.php: $db->query( "UPDATE ezbinaryfile SET download_count=(download_count+1)

The Web Application Service Provider

Daniel Guerrier

Friday 29 July 2005 11:40:40 am

Maybe I'm asking the wrong question.

I would like to keep track of the number of times a file is downloaded. I saw that line of code when I inspected that file. But how exactly am I supposed to use that to perform this task?

The doc says the "download" view is provided to give an interface to download files.
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/modules/content/views/download

how exactly is this supposed to be used?

Daniel Guerrier

Sunday 31 July 2005 9:29:02 am

does anyone have an idea how to use the content/download view i.e what parameters it takes and what it is supposed do?

Łukasz Serwatka

Sunday 31 July 2005 1:15:41 pm

Hi,

Download counter is updated everytime when user click file to download, this is simple counter. To display download count of file use code

{if ne( $node.object.data_map.file.content.download_count, 0 )}
    {$node.object.data_map.file.content.download_count|wash}
{else}
    0
{/if}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Daniel Guerrier

Sunday 31 July 2005 8:03:38 pm

I got that part. The real question is how do I use the download view to create the download file links?

Is it as simple as:

$node.object.data_map.file.content.download

Łukasz Serwatka

Sunday 31 July 2005 11:16:03 pm

Then use

{def $attribute=$node.object.data_map.file}

<a href={concat( 'content/download/', $attribute.contentobject_id, '/', $attribute.id, '/file/', $attribute.content.original_filename|urlencode )|ezurl}>{$attribute.content.original_filename|wash</a>

It always good to look in design\standard\templates\content\datatype\view\ directory

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Daniele Nocentini

Thursday 03 June 2010 6:21:29 am

Ho can I update the count of download every time the page was refreshed?

Antica Bottega Digitale srl
http://www.abd.it

Gaetano Giunta

Friday 04 June 2010 4:54:51 am

use set-block for var cache_ttl (there are about a thousand posts about that var in the forums, and a concise example in the reference manual online in the page "template functions"/"set-block"

ciao

Principal Consultant International Business
Member of the Community Project Board

eZ debug

Timing: Jan 30 2025 11:18:11
Script start
Timing: Jan 30 2025 11:18:11
Module start 'content'
Timing: Jan 30 2025 11:18:11
Module end 'content'
Timing: Jan 30 2025 11:18:12
Script end

Main resources:

Total runtime0.1811 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 587.9297370.2969
Module start 'content' 0.00710.0137 958.22661,013.6406
Module end 'content' 0.02080.1602 1,971.86723,901.8125
Script end 0.1810  5,873.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00422.3389200.0002
Check MTime0.00130.7183200.0001
Mysql Total
Database connection0.00080.430110.0008
Mysqli_queries0.093051.36831410.0007
Looping result0.00120.64001390.0000
Template Total0.159988.310.1599
Template load0.00070.397610.0007
Template processing0.159287.880710.1592
Override
Cache load0.00050.283210.0005
Sytem overhead
Fetch class attribute can translate value0.00181.012110.0018
XML
Image XML parsing0.00020.128110.0002
General
dbfile0.00995.4904200.0005
String conversion0.00000.002230.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