Page 1 of 1

File Description in Plugin Output

Posted: 04 May 2017, 21:34
by cgniuses
I was trying to get the description of files to show when {phocadownload view=filelist|id=XX} is initiated. I tried several methods but none seem to work. in the content plugin file phocadownload.php I have the code below on line 305

Code: Select all

if ($iMime == 1) {
$description = $item->description;
$output .= '<div class="pd-filename phocadownloadfilelistitem phoca-dl-file-box-mod">'.  $imageFileName['filenamethumb']. '<div class="pd-document'.(int)$iSize.'" '. $imageFileName['filenamestyle'].'><a href="'. JRoute::_($link).'" '. $targetOutput.'>'. $textOutput.'</a><br />$description</div></div>';
I am running joomla version 3.7 and phocadownload version 3.1.2 and content plugin version 3.1.2

Re: File Description in Plugin Output

Posted: 07 May 2017, 21:09
by Jan
Hi, first of all, you need to load the description from the database.
plugins/content/phocadownload/phocadownload.php
line cca: 255

Code: Select all

$query = 'SELECT a.id, a.title, a.alias, a.filename_play, a.filename_preview, a.link_external, a.image_filename, a.filename, c.id as catid, a.confirm_license, c.title as cattitle, c.alias as catalias,'
TO:

Code: Select all

$query = 'SELECT a.id, a.title, a.alias, a.filename_play, a.filename_preview, a.link_external, a.image_filename, a.filename, c.id as catid, a.confirm_license, c.title as cattitle, c.alias as catalias, a.description,'
Then you can display the description in the code.

Jan

Re: File Description in Plugin Output

Posted: 09 May 2017, 19:21
by cgniuses
Thanks a lot. This worked like a charm for what I needed it to do

Re: File Description in Plugin Output

Posted: 12 May 2017, 15:01
by Jan
Ok, great to hear it.

Jan