Page 1 of 1

File order

Posted: 22 Sep 2017, 11:19
by heko
Hello,

In a joomla installation i have a folder called "downloads" with many subfolders and hundreds of pdf files in it. I just installed the phocadownload component and changed in "options" the default folder from "phocadownload" to "downloads". Then I created categories and imported the exiting folders and files via "multiple add" .

This works fine, but the problem is that the file order got lost. In the multiple add view all files are sorted alphabetically. When I look via ftp the file order is by time (newest on top). I wish I could keep this sorting order, when the files are diplayed by the phocadownload component. Can I import files via multiple add and keep the existing file order by time?

Thank you very much for any hint.

Best regards

Henning

Re: File order

Posted: 22 Sep 2017, 14:22
by Jan
Hi, the ordering of the files is defined by the database ordering - depends on stored items in database, so there you can select which way the items will be ordered (if by name, date, etc.)
You can order the items by date. But this is a date when the items were added in your site. So then you need to customize the code, to transform the date of file into the item - instead of adding current date - detect the date of the file and save it. :idea:

administrator\components\com_phocadownload\models\phocadownloadm.php

Jan

Re: File order

Posted: 22 Sep 2017, 20:07
by heko
Thank you Jan,
as you said I saved the filenames and the date of the files. Then I updated (with phpadmin) in the table #_phocadownload the date field like this:
UPDATE `hyn7e_phocadownload` SET `date` = '2017-09-01' WHERE `filename` LIKE 'CD-Kalender/Wochenplaner-Herbst-Winter-2017-31-08.pdf';
UPDATE `hyn7e_phocadownload` SET `date` = '2017-02-26' WHERE `filename` LIKE 'CD-Kalender/stadt ohz_wopla_fs17_01_20170223.pdf';
UPDATE `hyn7e_phocadownload` SET `date` = '2016-09-15' WHERE `filename` LIKE 'CD-Kalender/cdwopla_hw2016.pdf';
UPDATE `hyn7e_phocadownload` SET `date` = '2016-01-25' WHERE `filename` LIKE 'CD-Kalender/cdwopla_fs2016.pdf';
UPDATE `hyn7e_phocadownload` SET `date` = '2015-08-29' WHERE `filename` LIKE 'CD-Kalender/cdwopla_hw2015.pdf';
UPDATE `hyn7e_phocadownload` SET `date` = '2015-01-31' WHERE `filename` LIKE 'CD-Kalender/cdwopla2015.pdf';
UPDATE `hyn7e_phocadownload` SET `date` = '2014-09-24' WHERE `filename` LIKE 'CD-Kalender/cdwochenplaner-web.pdf';

Now I can display the files by the date of the files.

Re: File order

Posted: 29 Sep 2017, 13:25
by Jan
Ok

Re: File order

Posted: 07 Oct 2017, 11:09
by housam.laham
My files are only excepting numbers hey won't except name and letters