Hi,
I tried to modify the original plugin posted at the beginning of this topic.
Here is the new code :
<?php
/**
* JComments plugin for Remository objects support
*
* @version 1.4
* @package JComments
* @filename com_jdownloads.plugin.php
* @author Sergey M. Litvinov (smart@joomlatune.ru)
* @copyright (C) 2006-2008 by Sergey M. Litvinov (http://www.joomlatune.ru)
* @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
*
* If you fork this to create your own project,
* please make a reference to JComments someplace in your code
* and provide a link to http://www.joomlatune.ru
**/
(defined('_VALID_MOS') OR defined('_JEXEC')) or die('Direct Access to this location is not allowed.');
class jc_com_jdownloads extends JCommentsPlugin {
function getObjectTitle($id) {
$db = & JCommentsFactory::getDBO();
$db->setQuery( 'SELECT file_title FROM #__jdownloads_files WHERE file_id = ' . $id );
return $db->loadResult();
}
function getObjectLink($id) {
$_Itemid = JCommentsPlugin::getItemid( 'com_jdownloads' );
$link = JoomlaTuneRoute::_( 'index.php?option=com_jdownloads&task=view.download&cid=' . $id . '&Itemid=' . $_Itemid
);
return $link;
}
}
?>
Actually, I had to replace
$_Itemid = JCommentsPlugin::getItemid( 'com_jdownloads' );
with
$_Itemid = 54;
because it get 0 instead of 54.
Any idea why and how to get the right value ?
Thanks for your help.