Здравствуйте.
подскажите пожалуйста, использую JComments 2.2.0.0 - gmapfp и mod_jcomments 2.5.6
Модуль выводит ссылку на комментарии так:
http://www.мойсайт.ru/component/gmapfp/72.html#comment-175
А нужно так:
http://www.мойсайт.ru/tattoo-salon/article/72.html#comment-175
com_gmapfp.plugin.php
<?php
/**
* JComments plugin for GMapFP objects support
*
* @version 2.1
* @package JComments
* @author Sergey M. Litvinov (smart@joomlatune.ru)
* @copyright (C) 2006-2009 by Sergey M. Litvinov (http://www.joomlatune.ru)
* @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
**/
class jc_com_gmapfp extends JCommentsPlugin
{
var $component = 'com_gmapfp';
var $tableName = '#__gmapfp';
var $keyField = 'id';
var $titleField = 'nom';
function getTitles($ids)
{
$db = & JCommentsFactory::getDBO();
$db->setQuery( 'SELECT nom, id FROM #__gmapfp WHERE id IN (' . implode(',', $ids). ')' );
return $db->loadObjectList('id');
}
function getObjectTitle($id)
{
$db = & JCommentsFactory::getDBO();
// we need select primary key for JoomFish support
$db->setQuery( 'SELECT nom, id FROM #__gmapfp WHERE id = ' . $id );
return $db->loadResult();
}
function getObjectLink($id)
{
/* if (JCOMMENTS_JVERSION == '1.5') {
require_once(JPATH_ROOT.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
$query = 'SELECT a.id, a.sectionid, a.access,' .
' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'.
' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug'.
' FROM #__content AS a' .
' LEFT JOIN #__categories AS cc ON cc.id = a.catid' .
' WHERE a.id = ' . intval($id);
$db = & JCommentsFactory::getDBO();
$db->setQuery( $query );
$row = $db->loadObject();
$user =& JFactory::getUser();
if ($row->access <= $user->get('aid', 0)) {
$link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
} else {
$link = JRoute::_("index.php?option=com_user&task=register");
}
} else {
*/ global $mainframe, $Itemid;
$compatibilityMode = $mainframe->getCfg('itemid_compat');
if ( $compatibilityMode == null ) {
// Joomla 1.0.12 or below
if ( $Itemid && $Itemid != 99999999 ) {
$_Itemid = $Itemid;
} else {
$_Itemid = $mainframe->getItemid( $id );
}
} else if ( (int) $compatibilityMode > 0 && (int) $compatibilityMode <= 11) {
// Joomla 1.0.13 or higher and Joomla 1.0.11 compatibility
$_Itemid = $mainframe->getItemid( $id, 0, 0 );
} else {
// Joomla 1.0.13 or higher and new Itemid algorithm
$_Itemid = $Itemid;
}
$link = JoomlaTuneRoute::_('index.php?option=com_gmapfp&task=view&id='. $id .'&Itemid='. $_Itemid);
// }
return $link;
}
function getObjectOwner($id)
{
$db = & JCommentsFactory::getDBO();
$db->setQuery( 'SELECT userid, id FROM #__gmapfp WHERE id = ' . $id );
$userid = $db->loadResult();
return $userid;
}
function getCategories($filter = '')
{
$db = & JCommentsFactory::getDBO();
$query = "SELECT c.id AS `value`, c.title AS `text`"
. "\n FROM #__categories AS c"
. (($filter != '')? "\n WHERE c.id IN ( ".$filter." )" : '')
. "\n AND c.section='com_gmapfp'"
. "\n ORDER BY c.name"
;
$db->setQuery( $query );
$rows = $db->loadObjectList();
return $rows;
}
}
?>
Как статично задать такой URL, что поправить?