Page 1 of 1
Access to file properties
Posted: 23 Feb 2017, 10:21
by yurkir
Is it possible to have access from the front-end page to the file properties?
I mean those from General Options, like Title, Author and Version, as well as Downloads from Publishing Options.
Too lazy to modify the page each time file's version changes...
Re: Access to file properties
Posted: 23 Feb 2017, 15:17
by Jan
Hi, for now there is no such option so this needs to be customized for the frontend (add specific form inputs, etc.)
Jan
Re: Access to file properties
Posted: 24 Feb 2017, 13:51
by yurkir
Come on, Jan. Even something as quick and dirty as that will do:
Code: Select all
<?php
$db = JFactory::getDBO();
...
$query = 'SELECT description, version, hits FROM #__phocadownload WHERE id=2';
$db->setQuery($query);
$std = $db->loadObject();
?>
...
<div style="margin-bottom: 1em; overflow: auto; color: #5573BC;">
<div style="width: 25%; float: left;"><?php echo $std->description; ?></div>
<div style="width: 18%; float: left;"><?php echo $std->version; ?></div>
<div style="width: 15%; float: left;"><?php echo $std->hits; ?></div>
<div style="width: 18%; float: left;">
<?php if($giveStd) { ?>
<a href="/index.php?option=com_phocadownload&view=category&download=2"><span style="color: #80B284;"><strong>Download</strong></span></a>
<?php } else { ?>
<span style="color: red;"><strong>Please <a href="/buy-now">buy</a> a license</strong></span>
<?php } ?>
</div>
</div>
But I thought something more 'elegant' was possible, not relying on table and column names etc.
By the way: have I mentioned already that your product is really great?
Best regards,
Yuri
Re: Access to file properties
Posted: 27 Feb 2017, 16:33
by Jan
Hi, sorry for misunderstanding, I thought, you mean a form in fronten upload view to add such data to system when uploading file in frontend.
It depends on which view you want to display the information. If e.g. in file view, then you don't need to load specific SQL query as the data (description, version, hits) are there:
https://www.phoca.cz/documents/17-phoca- ... load-theme
Jan
Re: Access to file properties
Posted: 01 Mar 2017, 08:20
by yurkir
Thanks! That's exactly what I was looking for.
Re: Access to file properties
Posted: 02 Mar 2017, 18:09
by Jan
Ok