Hi,
Due the size of my files, I upload them via FTP, updating them every several weeks. However, PhocaDownload does not automatically update the File Date when a new version of an existing file is uploaded. I would like to have PhocaDownload check the File Date at display time, similar to what it does with the file size. Does anyone have example/sample code of how this would be done?
Thanks for your help!
JMiller
Code to get File Date Info at Display Time
-
- Phoca Newbie
- Posts: 5
- Joined: 13 Nov 2009, 22:34
- Jan
- Phoca Hero
- Posts: 48739
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Code to get File Date Info at Display Time
Hi, there is no such feature, added into a feature request list. 

If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 5
- Joined: 13 Nov 2009, 22:34
Re: Code to get File Date Info at Display Time
Hi Jan,
Thanks for the reply...
I've sort of found a way to do what I want it to do using the filemtime function...
In the /components/com_phocadownload/views/category/tmpl/default.php file, I changed the lines that say this:
to this:
It works for me, hopefully this code will be somewhat helpful to others...
Regards,
JMiller
Thanks for the reply...
I've sort of found a way to do what I want it to do using the filemtime function...
In the /components/com_phocadownload/views/category/tmpl/default.php file, I changed the lines that say this:
Code: Select all
if ($valueDoc->date != '') {
$details .= '<div>'.JText::_('File Date').': '.JHTML::Date($valueDoc->date, "%B %d, %Y").'</div>';
}
Code: Select all
if ($valueDoc->filename !='') {
$absFile = str_replace('/', DS, JPath::clean($this->absfilepath . $valueDoc->filename));
if (JFile::exists($absFile))
{
$details .= '<div>'.JText::_('Last Updated').': '.JHTML::Date(filemtime($absFile), "%B %d, %Y").'</div>';
} else {
$details .= '<div>'.JText::_('File Date').': '.JHTML::Date($valueDoc->date, "%B %d, %Y").'</div>';
}
}
It works for me, hopefully this code will be somewhat helpful to others...
Regards,
JMiller
- Jan
- Phoca Hero
- Posts: 48739
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Code to get File Date Info at Display Time
Thank you for this info.
Jan
Jan
If you find Phoca extensions useful, please support the project