File order

Phoca Download - download manager
heko
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 22 Sep 2017, 10:53

File order

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

Re: File order

Post 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
If you find Phoca extensions useful, please support the project
heko
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 22 Sep 2017, 10:53

Re: File order

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

Re: File order

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
housam.laham
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 07 Oct 2017, 11:04

Re: File order

Post by housam.laham »

My files are only excepting numbers hey won't except name and letters
Post Reply