Plea for suggestions on how to implement the following.

Author Message

Daniel Guerrier

Thursday 11 August 2005 10:42:36 am

This seems very simple in concept but ezpublish is making it very difficult to bring to reality.

I have a content class created to hold music files to make available for download. All I want to do is monitor how many times a file is downloaded per day in order to display a top ten list based on daily download stats. What I wanted to do is created a seperate content class for download monitoring which had a fields for relating to the specific file intances, the current day and number of downloads.

Each time a request for a certain file is requested I want to check if it was downloaded today by querying the download monitor content class for an instances that has a date equal to today and a reference to the requested file instance. If so update the count by one, if not create and record the download.

That (I'm assuming) can't be done because there is no way to update and create instances of content classes thru templates. If there is a way I would appreciate a hand on how.

Then I thought I would just create a seperate php script and have it grab all instances of the file content class, pull out the binary file attibute, get the download number from that and update an attibute I would have created to hold the info. This would run as a cron job.

Looking at the ezbinary table I noticed that several versions of a binary file may be kept, each with its on count which would make that data unreliable assuming that the binary count is not a total of all versions.

So the short version of the question is: How can I assemble this in a fashion so that I can track the daily download count of files in content class instances in a count attribute so that I can sort etc...?

Note to ezpublish developers.
Your next effort second to solid documentation should be to make the easy things easy to do. Hey, that can even be a slogan of some sort :)

Thank you in advance for any suggestion.
I understand that I have been making a lot of post about this. But there doesn't seem to be a clean and practical way of doing what I would think is basic functionality.

Gabriel Ambuehl

Thursday 11 August 2005 11:49:24 am

Writing a module or patching /extending content download to do that seems simple enough?

Also, access_log contains all that stuff anyhow.

Visit http://triligon.org

Daniel Guerrier

Thursday 11 August 2005 12:01:47 pm

Having that info in access logs doesn't help if I want to manipulate and sort in ez.

I'm not asking if it can be done - I just want to know how. How is a new user supposed to get a grip on this thing if we only give abstract answers to questions. I thank you for suggesting a module, but it does not help very much if there isn't any documentation on creating modules.

Thanks.

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 16:27:33
Script start
Timing: Jan 18 2025 16:27:33
Module start 'layout'
Timing: Jan 18 2025 16:27:33
Module start 'content'
Timing: Jan 18 2025 16:27:34
Module end 'content'
Timing: Jan 18 2025 16:27:34
Script end

Main resources:

Total runtime0.6154 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 588.1563152.6563
Module start 'layout' 0.00510.0023 740.812539.5078
Module start 'content' 0.00740.6063 780.3203499.9297
Module end 'content' 0.61370.0016 1,280.250012.1094
Script end 0.6153  1,292.3594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.4862160.0002
Check MTime0.00120.1933160.0001
Mysql Total
Database connection0.00090.145910.0009
Mysqli_queries0.573193.1269570.0101
Looping result0.00050.0732550.0000
Template Total0.589495.820.2947
Template load0.00170.271620.0008
Template processing0.587795.508120.2939
Template load and register function0.00020.024810.0002
states
state_id_array0.00080.131610.0008
state_identifier_array0.00080.126320.0004
Override
Cache load0.00140.2239210.0001
Sytem overhead
Fetch class attribute can translate value0.00060.104520.0003
Fetch class attribute name0.00120.198830.0004
XML
Image XML parsing0.00020.033320.0001
class_abstraction
Instantiating content class attribute0.00000.001530.0000
General
dbfile0.00070.1078100.0001
String conversion0.00000.001140.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs