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.