hi friends .
i create a component and i want to integrate it with kommento , i do what kommento cods say ,
it comes in backend , but in frontend , nothing is show . what can i do?
here is my code : my component name is com_nava
<?php
defined('_JEXEC') or die('Restricted access');require_once(dirname(__FILE__) . '/abstract.php');
class KomentoComNava extends KomentoExtension
{
public $_item;
public $_map = array(
'id' => 'id',
'title' => 'title',
'hits' => 'hits',
'created_by' => 'created_by',
'catid' => 'catid',
'permalink' => 'permalink'
);
public function __construct( $component )
{
$this->addFile( JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_nava' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR .'route.php' );
parent::__construct( $component );
}
public function load( $cid )
{
static $instances = array();
if( !isset( $instances[$cid] ) )
{
$db = Komento::getDBO();
$query = 'SELECT a.`id` AS `id`, a.`name` AS `title`, a.`alias`, c.`id` AS `catid` a.`hits` AS `hits` , '
. ' c.`title` AS category_title, c.`alias` AS category_alias,'
. ' FROM ' . $db->nameQuote( '#__nava_navaitems') . ' AS a'
. ' INNER JOIN ' . $db->nameQuote( '#__categories' ) . ' AS c ON b.`id` = c.`id`'
. ' LEFT JOIN ' . $db->nameQuote( '#__users') . ' AS u ON u.id = a.`user_id`'
. ' WHERE a.`link_id` = ' . $db->quote( (int) $cid );
$db->setQuery( $query );
if( !$this->_item = $db->loadObject() )
{
return $this->onLoadArticleError( $cid );
}
$link = 'index.php?option=com_nava&task=article&id=' . $this->_item->id;
$this->_item->permalink = $this->prepareLink( $link );
$instances[$cid] = $this->_item;
}
$this->_item = $instances[$cid];
return $this;
}
public function getContentIds( $categories = '' )
{
$db = Komento::getDBO();
$query = '';
if( empty( $categories ) )
{
$query = 'SELECT `id` FROM ' . $db->nameQuote( '#__content' ) . ' ORDER BY `id`';
}
else
{
if( is_array( $categories ) )
{
$categories = implode( ',', $categories );
}
$query = 'SELECT `id` FROM ' . $db->nameQuote( '#__content' ) . ' WHERE `catid` IN (' . $categories . ') ORDER BY `id`';
}
$db->setQuery( $query );
return $db->loadResultArray();
}
public function getCategories()
{
$db = Komento::getDBO();
$query = 'SELECT a.`id` AS `id`, a.`title` AS `title` , a.`parent_id` AS `parent_id`'
. ' FROM `#__categories` AS a'
. ' ORDER BY a.`lft`';
$db->setQuery( $query );
$categories = $db->loadObjectList();
$children = array();
foreach( $categories as $row )
{
if( $row->parent_id != -1 )
{
$pt = $row->parent_id;
$list = @$children[$pt] ? $children[$pt] : array();
$list[] = $row;
$children[$pt] = $list;
}
}
$res = JHTML::_( 'menu.treerecurse', 0 , '', array(), $children , 9999, 0, 0 );
return $res;
}
public function isListingView()
{
return false;
}
public function isEntryView()
{
return JRequest::getCmd('task') == 'viewlink';
}
public function onExecute( &$article, $html, $view, $options = array() )
{
if( $view == 'entry' )
{
return $html;
}
}
public function getEventTrigger()
{
$entryTrigger = ( Komento::joomlaVersion() > '1.5' ) ? 'onContentAfterDisplay' : 'onAfterDisplayContent';
return $entryTrigger;
}
public function getAuthorName()
{
return $this->_item->created_by_alias ? $this->_item->created_by_alias : $this->_item->author;
}
}
?>