This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » Fetch objects and sort them by...
expandshrink

Fetch objects and sort them by download_count

Fetch objects and sort them by download_count

Sunday 29 September 2013 9:42:10 pm - 1 reply

Hi,

I'm working on a project of a publishing house. I have all the magazines and books archived as objects of a class named "publication", that includes as one his attributes a file.
I need to display a list of the 5 most downloaded "publications", but without success.

I've already searched the ez forums, and found only one solution that is making an extended Attribute Filter: share.ez.no/forums/setup-design/how-fetch-list-of-element-sort-by-filesize.

Do anyone have a more simple solution?
I already had a look at the documentation regarding the extended attribute filter, but have some questions yet:

1. How should I extract information to the ezPublish mySQL database from the new created PHP class?

2. Is there any ez documentation that can help me?
Above the documentation that I found:

- http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Modules/content/Fetch-functions/list

- http://blog.nxcgroup.com/2012/ez-publish-extended-attribute-filters/#.UkSEGT-NCeQ

Thanks in addvance for any answers.

Tuesday 01 October 2013 4:28:23 pm

Hello Fátima Chapri,

The best way to sort fetches or searches by download count is the extended attribute filter.
And there is also a bit of prework necessary to be able to use the filter.
Because by default eZ Publish does not to a writing access to the database for every download.

You need to have the downloads in a module to save the downloads.
Then you can write the SQL parts into an extended attribute filter.

But if you want to have a simple solution, maybe you want to use somehing not so acurate.
I mean a sort by admin order. You can probably grep the files in the access log, and adjust the admin order once a week.

Yes, that is dirty indeed, but the other option is a lot of work, and also not good performance when downloading files.

 

Mark

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from