У меня тоже вопрос по модулю аккордион, только от JoomlaVision
Почему не работают ссылки в выводимых модулем материалах? если открывать ссылки через выпадающее меню (нажав по ссылке правой кнопкой мыши) и выбирать "открыть в новой вкладке" то они открываются в новой вкладке а если просто щелкать левой кнопкой мыши по ссылке - то тишина - ничего вообще не открывается(((( что делать?
код файла mod_jv_accordion.php
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
require_once (dirname(__FILE__).DS.'helper.php');
$params->set('intro_only', 1);
$params->set('hide_author', 1);
$params->set('hide_createdate', 0);
$params->set('hide_modifydate', 1);
// Disable edit ability icon
$access = new stdClass();
$access->canEdit = 0;
$access->canEditOwn = 0;
$access->canPublish = 0;
$list = modJvAccordion::getList($params,$access);
$items = count($list);
if (!$items) {
return;
}
$path = JModuleHelper::getLayoutPath('mod_jv_accordion','default');
if(file_exists($path)){
require($path);
}
Код файла helper.php
<?php
// no direct access
defined ( '_JEXEC' ) or die ( 'Restricted access' );
require_once (JPATH_SITE . DS . 'components' . DS . 'com_content' . DS . 'helpers' . DS . 'route.php');
class modJvAccordion {
function getList(&$params, &$access) {
global $mainframe;
$db = & JFactory::getDBO ();
$user = & JFactory::getUser ();
$aid = $user->get ( 'aid', 0 );
$catid = ( int ) $params->get ( 'catid', 0 );
$items = ( int ) $params->get ( 'no_items', 5 );
$contentConfig = &JComponentHelper::getParams ( 'com_content' );
$noauth = ! $contentConfig->get ( 'show_noauth' );
$date = & JFactory::getDate ();
$now = $date->toMySQL ();
$orderding = $params->get ( 'ordering', '' );
$nullDate = $db->getNullDate ();
// query to determine article count
$query = 'SELECT a.*,' .
' 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' .
' INNER JOIN #__categories AS cc
ON cc.id = a.catid' .
' INNER JOIN #__sections AS s
ON s.id = a.sectionid' .
' WHERE a.state = 1 ' . ($noauth ? ' AND a.access <= ' . ( int ) $aid . ' AND cc.access <= ' . ( int ) $aid . ' AND s.access <= ' . ( int ) $aid : '').
' AND (a.publish_up = ' . $db->Quote ( $nullDate ). ' OR a.publish_up <= ' . $db->Quote ( $now ). ' ) ' .
' AND (a.publish_down = ' . $db->Quote ( $nullDate ). ' OR a.publish_down >= ' . $db->Quote ( $now ). ' )' .
' AND cc.id = ' . ( int ) $catid .
' AND cc.section = s.id' .
' AND cc.published = 1' .
' AND s.published = 1';
if ($orderding == 'order_article') {
$query .= ' ORDER BY a.ordering DESC';
}
if ($orderding == 'order_article_created') {
$query .= ' ORDER BY a.created DESC';
}
if ($orderding == 'order_article_modified') {
$query .= ' ORDER BY a.modified DESC';
}
if ($orderding == 'order_article_popular') {
$query .= ' ORDER BY a.hits DESC';
}
if($orderding == 'order_article_random'){
$query .=' ORDER BY RAND()';
}
if ($items != 0) {
$query .= ' LIMIT 0, ' . $items;
}
$db->setQuery ( $query );
$rows = $db->loadObjectList ();
return $rows;
}
/*
* Function create article
* Created by chiennd
*/
function renderArticle($item, $param, $access) {
$_html = '';
$_html .= '<div class="jv_accordion_item"><a href="#" class="toggler atStart"><span>' . $item->title . '</span></a></div>';
$_html .= modJvAccordion::renderContentArticle($item,$param,$access);
return $_html;
}
//End function create article
/*
* Function create content of article
* Created by chiennd
*/
function renderContentArticle($item, $param, $access){
$html = '';
$noWord = $param->get('no_words',25);
$noCountWord = modJvAccordion::count_words($item->introtext);
if($noCountWord >= $noWord){
$contentArticle = modJvAccordion::implodeWord($item->introtext,$noWord)."...";
} else {
$contentArticle = $item->introtext;
}
$isReadMore = $param->get('readmore',0);
$readMore = '';
if($isReadMore == 1){
$onLink = JRoute::_(JURI::base().ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid));
$readMore = "<div class='readmore' onclick =location.href='".$onLink."'><a href='#'>Read more</a></div>";
}
$html .='<div class="element atStart"><div class="answer_text"></div><div class="answer_content">'.$contentArticle.'</div>'.$readMore.'</div>';
return $html;
}
//End function create
/*
* Function count word in string
* Created by chiennd
*/
function count_words($str) {
$words = 0;
$str = eregi_replace(" +", " ", $str);
$array = explode(" ", $str);
for($i=0;$i < count($array);$i++){
if (eregi("[0-9A-Za-z-ט--]", $array[$i]))
$words++;
}
return $words;
}
//End function
function implodeWord($str,$noWord){
$str = eregi_replace(" +", " ", $str);
$array = explode(" ", $str);
for($i=0;$i<$noWord;$i++){
if (eregi("[0-9A-Za-z-ט--]", $array[$i])) $aryContent[] = $array[$i];
}
$strContent = implode(" ",$aryContent);
return $strContent;
}
}
Посмотрите кто в этом понимает пожалуйстазз