News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

jD 3.2.39 Content Plugin BUG1 - {sum_jcomments} bad

Started by Nyx, 15.10.2015 12:27:43

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nyx

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
  •  

ColinM

#1
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
Colin M
  •