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

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
User avatar
kokbira
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 01 Nov 2019, 19:25

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

Post 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}.

Tags:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

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

Post by Jan »

Hi, thank you for the info.

Added to feature request list.

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

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

Post 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
If you find Phoca extensions useful, please support the project
User avatar
kokbira
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 01 Nov 2019, 19:25

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

Post by kokbira »

Ok... but how to use??????

Documentation says that ordering parameter exists, but which arguments can we use? I.e., ordering=???????
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

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

Post by Jan »

If you find Phoca extensions useful, please support the project
User avatar
kokbira
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 01 Nov 2019, 19:25

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

Post 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???
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

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

Post 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
If you find Phoca extensions useful, please support the project
User avatar
kokbira
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 01 Nov 2019, 19:25

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

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

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

Post by Jan »

OK
If you find Phoca extensions useful, please support the project
Post Reply