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

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 18 2025 15:08:14
Script start
Timing: Jan 18 2025 15:08:14
Module start 'layout'
Timing: Jan 18 2025 15:08:14
Module start 'content'
Timing: Jan 18 2025 15:08:16
Module end 'content'
Timing: Jan 18 2025 15:08:16
Script end

Main resources:

Total runtime1.1625 sec
Peak memory usage4,096.0000 KB
Database Queries87

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 587.9141152.6250
Module start 'layout' 0.00460.0023 740.539139.4453
Module start 'content' 0.00691.1542 779.9844744.2422
Module end 'content' 1.16110.0013 1,524.226620.1641
Script end 1.1624  1,544.3906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.2513160.0002
Check MTime0.00120.1049160.0001
Mysql Total
Database connection0.00080.064910.0008
Mysqli_queries1.097894.4383870.0126
Looping result0.00080.0722850.0000
Template Total1.131897.420.5659
Template load0.00190.164120.0010
Template processing1.129997.192420.5649
Template load and register function0.00020.021210.0002
states
state_id_array0.00180.152910.0018
state_identifier_array0.00170.142920.0008
Override
Cache load0.00170.1454460.0000
Sytem overhead
Fetch class attribute can translate value0.00050.040550.0001
Fetch class attribute name0.00110.0977140.0001
XML
Image XML parsing0.00190.164150.0004
class_abstraction
Instantiating content class attribute0.00000.0020150.0000
General
dbfile0.00180.1569300.0001
String conversion0.00000.000340.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
11content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
14content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 38
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs