sure,
here is how to get JComments in weblink, for J1.5x
1, create new PHP file from the following code;
<?php
/**
* JComments plugin for Joomla com_weblinks component
*
* @version 1.4, based on the one for com_poll by Sergey M. Litvinov
* @package JComments
* @author Sergey M. Litvinov (smart@joomlatune.ru), Tommy Nilsson, tommy@architechtsoftomorrow.com
* @copyright (C) 2006-2008 by Sergey M. Litvinov (http://www.joomlatune.ru), 2009 Tommy Nilsson www.architechtsoftomorrow.com
* @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
**/
(defined('_VALID_MOS') OR defined('_JEXEC')) or die('Direct Access to this location is not allowed.');
class jc_com_weblinks extends JCommentsPlugin
{
function getObjectTitle($id)
{
$db = & JCommentsFactory::getDBO();
$db->setQuery( 'SELECT title FROM #__categories WHERE section = "com_weblinks" and id = ' . $id );
return $db->loadResult();
}
function getObjectLink($id)
{
if (JCOMMENTS_JVERSION == '1.5') {
$db = & JCommentsFactory::getDBO();
$db->setQuery( 'SELECT alias FROM #__categories WHERE section = "com_weblinks" and id = ' . $id );
$alias = $db->loadResult();
$link = 'index.php?option=com_weblinks&view=category&id='. $id.':'.$alias;
require_once(JPATH_SITE.DS.'includes'.DS.'application.php');
$component = & JComponentHelper::getComponent('com_weblinks');
$menus = & JSite::getMenu();
$items = $menus->getItems('componentid', $component->id);
if (count($items)) {
$link .= "&Itemid=" . $items[0]->id;
}
$link = JRoute::_($link);
} else {
$_Itemid = JCommentsPlugin::getItemid( 'com_weblinks' );
$link = sefRelToAbs( 'index.php?option=com_weblinks&view=category&id=' . $id . '&Itemid=' . $_Itemid );
}
return $link;
}
}
?>
2. save, name it: com_weblinks.plugin.php
upload to components -> com_jcomments -> plugins.
3, find the com_weblinks ->category -> default.php, it should be in your template dir, if not copy from the components -> com_weblinks -> views -> category -> tmpl folder, to yourtemplate -> com_weblinks ->category folder.
4, open the file that you copied/located in step 3
5, add the following code to the end of the file, the very bottom.
<?php
//Code for JComments, by Tommy Nilsson, architechtsoftomorrow.com
$comments = 'components/com_jcomments/jcomments.php';
if (file_exists($comments)) {
require_once($comments);
echo JComments::showComments($this->category->id, 'com_weblinks', $this->category->title);
}
?>
Now you got comments inside each category of the default weblink component.