Page 1 of 2

display date in file view

Posted: 04 Sep 2014, 17:18
by lacioo
is this somehow possible ? I have tried all settings, but no way... pls for complete tutorial if this possible. thanks

Re: display date in file view

Posted: 06 Sep 2014, 02:11
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

Re: display date in file view

Posted: 09 Sep 2014, 14:33
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

Re: display date in file view

Posted: 09 Sep 2014, 21:56
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

Re: display date in file view

Posted: 10 Sep 2014, 09:25
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

Re: display date in file view

Posted: 10 Sep 2014, 21:44
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

Re: display date in file view

Posted: 16 Sep 2014, 16:45
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

Re: display date in file view

Posted: 17 Sep 2014, 20:31
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

Re: display date in file view

Posted: 18 Sep 2014, 11:55
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 ?

Re: display date in file view

Posted: 19 Sep 2014, 22:35
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