Forums / Setup & design / Plea for suggestions on how to implement the following.

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.

eZ debug

Timing: Jan 19 2025 03:23:22
Script start
Timing: Jan 19 2025 03:23:22
Module start 'content'
Timing: Jan 19 2025 03:23:23
Module end 'content'
Timing: Jan 19 2025 03:23:23
Script end

Main resources:

Total runtime1.3085 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 589.1953180.8125
Module start 'content' 0.00591.0047 770.0078505.0391
Module end 'content' 1.01060.2979 1,275.0469333.4531
Script end 1.3085  1,608.5000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3148210.0002
Check MTime0.00150.1155210.0001
Mysql Total
Database connection0.00050.041710.0005
Mysqli_queries1.212892.68221940.0063
Looping result0.00230.17631920.0000
Template Total1.266596.820.6332
Template load0.00230.173520.0011
Template processing1.264296.609920.6321
Template load and register function0.00020.013410.0002
states
state_id_array0.00100.077210.0010
state_identifier_array0.00100.074220.0005
Override
Cache load0.00170.1334210.0001
Sytem overhead
Fetch class attribute can translate value0.00150.115630.0005
Fetch class attribute name0.00110.082830.0004
XML
Image XML parsing0.00090.070730.0003
class_abstraction
Instantiating content class attribute0.00000.000530.0000
General
dbfile0.02361.8062210.0011
String conversion0.00000.000530.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs