jDownloads Support Forum

Older Versions => jDownloads 3.2 (Support ended) => Bugs => Topic started by: Nyx on 15.10.2015 12:27:43

Title: jD 3.2.39 Content Plugin BUG1 - {sum_jcomments} bad
Post by: Nyx on 15.10.2015 12:27:43
Hi,

i think the "jDownloads Content Plugin" have 2 Bugs or missing options.
EDIT As there were two bugs reported, this post has been split in two posts one per bug
see http://www.jdownloads.com/forum/index.php?topic=8516  for the second one
First one:

the jDownloads Content Plugin use the Layouts from "Downloads" right?
In the Layout from "Downloads" the Placeholder "{sum_jcomments}" working perfect.

But in the jDownloads Content Plugin is this missing.
It's replace - but with nothing.

in the /plugins/content/jdownloads/jdownloads.php is the code
                // view sum comments
             if ($jlistConfig['view.sum.jcomments'] && $jlistConfig['jcomments.active']){
                 // check that comments table exist - get DB prefix string
                 $prefix = $db->getPrefix();
                 // sometimes wrong uppercase prefix result string - so we fix it
                 $prefix2 = strtolower($prefix);
                 $tablelist = $db->getTableList();
                 if (in_array($prefix.'jcomments', $tablelist ) || in_array($prefix2.'jcomments', $tablelist )){
                     $db->setQuery('SELECT COUNT(*) from #__jcomments WHERE object_group = \'com_jdownloads\' AND object_id = '.$files[$i]->file_id);
                     $sum_comments = $db->loadResult();
                     if ($sum_comments >= 0){
                         $comments = sprintf(JText::_('COM_JDOWNLOADS_FRONTEND_JCOMMENTS_VIEW_SUM_TEXT'), $sum_comments);
                         $l_Template = str_replace('{sum_jcomments}', $comments, $l_Template);
                     } else {
                        $l_Template = str_replace('{sum_jcomments}', '', $l_Template);
                     }
                 } else {
                     $l_Template = str_replace('{sum_jcomments}', '', $l_Template);
                 }   
             } else {   
                 $l_Template = str_replace('{sum_jcomments}', '', $l_Template);
             }   


missing.

But the Code not really work  :(

Nyx
Title: Re: jD 3.2.39 Content Plugin BUGs
Post by: ColinM on 16.10.2015 00:26:48
Hi Nyx
First query:{sum_jcomments} not appearing when using Content Plugin
Just to Clarify
The {sum_jcomments} placeholder needs to appear in the Files Layout used by the Content plugin.  The default Files layout that the Content plugin uses is specified in Config - Plugin tab or by using {jd_file onlinelayout==layout name} in the article.  That is in general it is not the Activated one in the Layouts -Files Layout section.

But you are correct the number of comments appears when using the regular listings but it fails to appear when using the Content Plugin.  {sum_jcomments}placeholder was present in the Files layout in both cases.

Colin