display date in file view

Phoca Download - download manager
lacioo
Phoca Member
Phoca Member
Posts: 11
Joined: 02 Jul 2014, 17:22

display date in file view

Post by lacioo »

is this somehow possible ? I have tried all settings, but no way... pls for complete tutorial if this possible. thanks
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: display date in file view

Post by Jan »

Hi, yes, date can be displayed in File view.

The date is displayed there as default, see Benno's site - File View as example:
http://www.reisefotografien.eu/download ... j25-j3-zip

Customize the output:
https://www.phoca.cz/documents/17-phoca- ... load-theme

Jan
If you find Phoca extensions useful, please support the project
lacioo
Phoca Member
Phoca Member
Posts: 11
Joined: 02 Jul 2014, 17:22

Re: display date in file view

Post by lacioo »

I dont get what is on bennos site, I cant see date displayed there. But anyway I cant speak German.
I have tried to customize output, but cant find variable for date and correct line, where to insert it.
I think default.php or default_files.php in components/com_phocadownload/views/category/tmpl should be updated.

Could you pls paste me here what and where to overwrite to see date displayed in front of file name ?

thanks a lot
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: display date in file view

Post by Jan »

Hi, I still don't understand you problem, it is not needed to speak German, I just wanted to display, that the date is set in File view as default, there is no need to customize something, the date is just displayed there :idea:

Jan
If you find Phoca extensions useful, please support the project
lacioo
Phoca Member
Phoca Member
Posts: 11
Joined: 02 Jul 2014, 17:22

Re: display date in file view

Post by lacioo »

hmm, but link heads to phoca deutche sprachpakete, I cant see any examples there... And default view is from my point of view without date, I see only pdf icon, pdf title and then details and download button
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: display date in file view

Post by Jan »

Are you using standard output of the component (not overwritten by template, not set in layout)?

In File view, there is:

Code: Select all

$pdFileDate = '';
			$fileDate = $l->getFileDate($v->filename, $v->date);
			if ($fileDate != '') {
				$pdFileDate .= '<div class="pd-date-txt">'.JText::_('COM_PHOCADOWNLOAD_DATE').':</div>';
				$pdFileDate .= '<div class="pd-fl-m">'.$fileDate.'</div>';
			}
Jan
If you find Phoca extensions useful, please support the project
lacioo
Phoca Member
Phoca Member
Posts: 11
Joined: 02 Jul 2014, 17:22

Re: display date in file view

Post by lacioo »

Great Jan,
this is correct.
And additional question ? what is the correct code to display upload date also in plugin view ({phocadownload view=filelist|id=7|target=b|limit=10}) ?
And is there possibility to set upload date via upload page in front end ? not in administration

Thanks
Laco
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: display date in file view

Post by Jan »

Hi, both features need to be customized:

- in plugin, the date needs to be loaded and set to html output
- in upload - the form with date needs to be set (maybe with calender) and the managing this form input needs to be set in controller and model :idea:

Jan
If you find Phoca extensions useful, please support the project
lacioo
Phoca Member
Phoca Member
Posts: 11
Joined: 02 Jul 2014, 17:22

Re: display date in file view

Post by lacioo »

Hi, yes in plugin I set the output, but when I use $pdFileDate, I get current date, not the upload date. Which variable is correct ?

In upload, I created calendar field - but also cant find which variable should take the date (I tried $now - as I assumed it takes current time).

Can you help on it ?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: display date in file view

Post by Jan »

Hi, just print_r the variables to get information about them.

Yes, $now is the varible which get current time and add it to database:

$row->date = $now;

There are different variables for displaying date:

date, publish up, publish down, etc.

in foreach you can get the item which is an object and you can select right value form the object :idea:

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