Page 1 of 1

Feature request: Allow ordering on filelist view on Phoca Download Plugin

Posted: 05 Nov 2019, 14:28
by kokbira
Well, Phoca Download Plugin allows to show a list of files of certain category embedded on an article in Joomla, using {phocadownload view=filelist|id=XX|limit=YY}, where XX is the category ID and YY is the number of files to show, but it does not control the list ordering.

The order of files is set only on Phoca Download general settings, so you cannot set different ordering settings for different categories.

I faced with the issue to put files ordered by ascendant title in a category and to put the last 6 files added in another category where files have the following name format (title=name): CATEGORY YYYY-MM, where YYYY is the 4-digit year and MM is the 2-digit month. So, for this second category, I would ordering by descendant title and limit to view only six files.

I found that solution, to change the code, and it was very simple:

https://joomla.stackexchange.com/questi ... oca-downlo

So, I would like to have that possibility developed for filelist view on Phoca Download Plugin, because I see that it would be very simple - the developers can create at least a new case for each ordering (example, maintain filelist, create filelistdt, filelisstat etc.). Other changes would be made to allow more elegant syntax of calling Phoca Download Plugin, for example {phocadownload view=filelist|id=XX|limit=YY|ordering=ZZ}.

Re: Feature request: Allow ordering on filelist view on Phoca Download Plugin

Posted: 05 Nov 2019, 14:46
by Jan
Hi, thank you for the info.

Added to feature request list.

Jan

Re: Feature request: Allow ordering on filelist view on Phoca Download Plugin

Posted: 17 Apr 2020, 22:57
by Jan
Hi, in version 3.2.0 you can set "ordering" parameter in plugin code.
https://www.phoca.cz/documents/51-phoca ... oad-plugin
https://www.phoca.cz/news/1072-phoca-do ... 0-released

Jan

Re: Feature request: Allow ordering on filelist view on Phoca Download Plugin

Posted: 05 Oct 2022, 14:10
by kokbira
Ok... but how to use??????

Documentation says that ordering parameter exists, but which arguments can we use? I.e., ordering=???????

Re: Feature request: Allow ordering on filelist view on Phoca Download Plugin

Posted: 08 Oct 2022, 01:14
by Jan

Re: Feature request: Allow ordering on filelist view on Phoca Download Plugin

Posted: 10 Oct 2022, 14:04
by kokbira
So, 1 is for true and 0 is for false, isn't it?

But how about how ordering, like setting ordering by date or by name and ordering ascending or descending???

Re: Feature request: Allow ordering on filelist view on Phoca Download Plugin

Posted: 11 Oct 2022, 19:49
by Jan
Hi, no, there is no option in SQL to enable or disable ordering. It is just there. So the values are different ordering values:

You can see the ordering numbers and their values here:

administrator/components/com_phocadownload/libraries/phocadownload/ordering/ordering.php (public static function getOrderingText)

So if you want to oder by title ascending, it is ordering= 3, if by title descending then ordering=4, etc. etc.

Jan

Re: Feature request: Allow ordering on filelist view on Phoca Download Plugin

Posted: 11 Oct 2022, 20:18
by kokbira
Excellent! Thanks a lot.

Well, I think Phoca documentation must be updated, because this feature is mentioned there since 2020 without explaning, at least, that:

ordering=1 or other value is for ordering ASC
ordering=2 is for ordering DESC
ordering=3 is for title ASC
ordering=4 is for title DESC
ordering=5 is for date ASC
ordering=6 is for date DESC
ordering=7 is for id ASC
ordering=8 is for id DESC
ordering=9 is for hits ASC
ordering=10 is for hits DESC
ordering=11 is for filename ASC
ordering=12 is for filename DESC
ordering=13 is for average ASC
ordering=14 is for average DESC
ordering=15 is for count ASC
ordering=16 is for count DESC
ordering=17 is for publish_up ASC
ordering=18 is for publish_up DESC
ordering=19 is for publish_down ASC
ordering=20 is for publish_down DESC

Re: Feature request: Allow ordering on filelist view on Phoca Download Plugin

Posted: 11 Oct 2022, 23:57
by Jan
OK