Новости Joomla

Quantum Manager нужен сообществу, а автору нужна ваша поддержка!

Quantum Manager нужен сообществу, а автору нужна ваша поддержка!Файловый менеджер Quantum — одно...

Файловый менеджер Quantum — одно из самых популярных решений для Joomla, созданное разработчиком из сообщества Joomla, Дмитрием Цымбалом (@tsymbalmitia). Он делает Quantum удобным, безопасным и современным, обновляет его, исправляет уязвимости и отвечает пользователям — всё это в свободное от основной работы время.

Теперь настал момент для следующего шага: развитие проекта требует больше времени и ресурсов.

0 Пользователей и 1 Гость просматривают эту тему.
  • 4 Ответов
  • 2556 Просмотров
*

Usman48

  • Захожу иногда
  • 177
  • 7 / 0
Добрый день (утро). На этом сайте в меню "категории" в колонке слева потребовалось убрать третий уровень вложенности меню, он есть у "женской обуви". Путем отсечения участка кода достичь ничего не удалось. Ткните носом где этот третий уровень в коде?

Код модуля меню:

Код
<?php
/**
* @version      3.0.1 20.02.2011
* @author       MAXXmarketing GmbH
* @package      Jshopping
* @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
* @license      GNU/GPL
*/

    defined('_JEXEC') or die('Restricted access');
    error_reporting(E_ALL & ~E_NOTICE);    
    if( !defined('PhpThumbFactoryLoaded') ) {
require_once dirname(__FILE__).DS.'libs'.DS.'phpthumb'.DS.'ThumbLib.inc.php';
define('PhpThumbFactoryLoaded',1);
}
    if (!file_exists(JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS.'jshopping.php')){
        JError::raiseError(500,"Please install component \"joomshopping\"");
    }
    require_once (dirname(__FILE__).DS.'helper.php');
    require_once (JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS."lib".DS."factory.php");
    require_once (JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS."lib".DS."jtableauto.php");
    require_once (JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS.'tables'.DS.'config.php');
    require_once (JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS."lib".DS."functions.php");
    require_once (JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS."lib".DS."multilangfield.php");
    $mainframe = &JFactory::getApplication();
$document =& JFactory::getDocument();
$tPath = JPATH_BASE.DS.'templates'.DS.$mainframe->getTemplate().DS.'html'.DS.$module->module.DS.'assets'.DS.'style.css';
if( file_exists($tPath) ){
JHTML::stylesheet( 'templates/'.$mainframe->getTemplate().'/html/'.$module->module.'/assets/style.css');
}else{
$document->addStyleSheet(JURI::base().'modules/mod_ice_jshopping_categories/assets/style.css');
}

    JSFactory::loadCssFiles();
JSFactory::loadJsFiles();
JSFactory::loadLanguageFile();
$jshopConfig = &JSFactory::getConfig();
    $lang = &JFactory::getLanguage();
    if(file_exists(JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS . 'lang'. DS . $lang->getTag(). '.php'))
        require_once (JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS . 'lang'. DS . $lang->getTag(). '.php');
    else
        require_once (JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS . 'lang'.DS.'en-GB.php');
    
    JTable::addIncludePath(JPATH_SITE.DS.'components'.DS.'com_jshopping'.DS.'tables');
    
    $field_sort = $params->get('sort', 'id');
    $ordering = $params->get('ordering', 'asc');
    $show_image = $params->get('show_image',0);
    $categories = jShopCategoriesHelper::getHtml($field_sort, $ordering,1, $params);
    require(JModuleHelper::getLayoutPath('mod_ice_jshopping_categories'));
?>

Код шаблона:

Код
<div class="lofmenu_jshopping">
<?php echo $categories; ?>
</div>
<script language="javascript">
if(jQuery('.lofmenu_jshopping .lofmenu .lofitem1') ){
jQuery('.lofmenu_jshopping .lofmenu .lofitem1').find('ul').css({'visibility':'hidden'});
}
jQuery(document).ready(function(){
jQuery('.lofmenu_jshopping .lofmenu .lofitem1 ul').each(function(){
jQuery(this).find('li:first').addClass('loffirst');
})
jQuery('.lofmenu_jshopping .lofmenu li').each(function(){
jQuery(this).mouseenter(function(){
jQuery(this).addClass('lofactive');
jQuery(this).find('ul').css({'visibility':'visible'});
jQuery(this).find('ul li ul').css({'visibility':'hidden'});
});
jQuery(this).mouseleave(function(){
jQuery(this).removeClass('lofactive');
jQuery(this).find('ul').css({'visibility':'hidden'});
});
});
});
</script>
« Последнее редактирование: 10.04.2013, 11:53:34 от Usman48 »
*

strannik-yura

  • Давно я тут
  • 511
  • 44 / 1
  • :)
Re: Убрать третий уровень меню
« Ответ #1 : 10.04.2013, 14:22:14 »
а в самих настройках модуля меню "категории" пробовали менять?
« Последнее редактирование: 10.04.2013, 16:17:20 от strannik-yura »
*

Usman48

  • Захожу иногда
  • 177
  • 7 / 0
Re: Убрать третий уровень меню
« Ответ #2 : 11.04.2013, 11:05:08 »
В настройках нет такого.
Файл helper.php:

Код

<?php
class jShopCategoriesHelper{

function getCategories($order = 'id', $ordering = 'asc', $publish = 0, $params) {
$db =& JFactory::getDBO();
        $lang = &JSFactory::getLang();
        $add_where = ($publish)?(" category_publish = '1' "):("");       
        if ($order=="id") $orderby = "category_id";
        if ($order=="name") $orderby = "`".$lang->get('name')."`";
        if ($order=="ordering") $orderby = "ordering";
        if (!$orderby) $orderby = "ordering";
       
        $query = "SELECT `".$lang->get('name')."` as name,`".$lang->get('description')."` as description,`".$lang->get('short_description')."` as short_description, category_id, category_publish, ordering, category_image,category_parent_id FROM `#__jshopping_categories`
                   WHERE " . $add_where . "
                   ORDER BY ".$orderby." ".$ordering;
        $db->setQuery($query);
        $categories = $db->loadObjectList();
        $imageWidth = $params->get('image_width', 20);
$imageHeight = $params->get('image_heigth', 20);

$isThumb = true;
        foreach ($categories as $key => $value){
            $categories[$key]->category_link = SEFLink('index.php?option=com_jshopping&controller=category&task=view&category_id='.$categories[$key]->category_id, 1);
if( $categories[$key]->category_image &&  $image= self::renderThumb($categories[$key]->category_image, $imageWidth, $imageHeight, $categories[$key]->name, true) ){
$categories[$key]->category_image = $image;
}
        }
if( empty($categories) ) return '';
$children = array();
if ( $categories )
{
foreach ( $categories as $v )
{
$pt = $v->category_parent_id;
$list = @$children[$pt] ? $children[$pt] : array();
array_push( $list, $v );
$children[$pt] = $list;
}
}
return $children;
    }

function getHtml($order = 'id', $ordering = 'asc', $publish = 0, $params){
$children = self::getCategories($order, $ordering, $publish, $params);
$html = '';
self::getHtmlCate($children,0,$html, 0 ,$params);
$html = "<ul class='lofmenu'>".$html."</ul>";
return $html;
}
static $_listcates = array();

function getListCates( ){
static $_listcates;
if(empty( $_listcates )){
$lang = &JSFactory::getLang();
$category_id = JRequest::getCmd('category_id', 0);
if(!empty($category_id)){
$db = &JFactory::getDBO();
$tmp[ $category_id ] = $category_id;
/*Select children category ids*/
$query = "SELECT `".$lang->get('name')."` as name, category_id, category_parent_id, category_publish FROM `#__jshopping_categories`
where category_publish = '1' ORDER BY category_parent_id, ordering";
$db->setQuery($query);
$all_cats = $db->loadObjectList();
$tmp2 = array();
if(count($all_cats)) {
foreach ($all_cats as $key => $value) {
$tmp2[ $value->category_id ] = $value->category_parent_id;
if(!empty( $value->category_id ) && in_array($value->category_id, $tmp)){
$tmp[ $value->category_parent_id ] = $value->category_parent_id;
foreach($tmp2 as $key=>$val){
if( !empty($key)  && !empty($val) && in_array($key, $tmp)){
$tmp[ $val ] = $val;
}
}
}
}
}
$_listcates = $tmp;
return $_listcates;
}
}
else{
return $_listcates;
}
}
function getHtmlCate($children, $id = 0 , & $str, $leve = 0 , $params){
$show_image = $params->get('show_image', 0);
$showcounter = $params->get('showcounter', 0);
$cates = self::getListCates();
if(empty($cates)){
$cates = array();
}
$leve ++;
if(!empty($children[$id])){
foreach($children[$id] as $item){
$class = "";
if(in_array($item->category_id, $cates)){
$class = " ice-current ";
}
$str .= "<li class='lofitem".$leve.$class."'>";
$str .= "<a href='".$item->category_link."' >".($show_image ? $item->category_image : "")."<span>".$item->name.($showcounter ? " <span class=\"counter\">(".self::getTotalItem($children,$item->category_id).") </span>" : "")."</span>";
if(!empty($children[$item->category_id])){
$str .= "<i></i></a>";
$str .= "<ul>";
self::getHtmlCate($children, $item->category_id ,$str ,$leve, $params);
$str .= "</ul>";
}else{
$str .= "</a>";
}
$str .="</li>";
}
}
return $str;
}
/*
* get Total item in  category
* return integer
*/
function getTotalItem($children, $category_id){
$arrCate = array();
$arrCate = self::getAllSubcates($category_id);
if(empty($arrCate)){
return 0;
}
if(count($arrCate) == 1){
$where = " WHERE pc.category_id = ".$arrCate[0]. " ";
}else{
$strCate = implode(',',$arrCate);
$where = " WHERE pc.category_id IN (".$strCate.") ";
}
$db =& JFactory::getDBO();
$query = "SELECT COUNT(DISTINCT pc.product_id) AS total FROM `#__jshopping_products_to_categories` pc ".$where;
$db->setQuery($query);
        $total = $db->loadObject();
return $total->total;
}
/*
* get all subcategories
* return array
*/
function getAllSubcates($category_id){
$lang = &JSFactory::getLang();
$db =& JFactory::getDBO();
$tmp[] = $category_id;
$query = "SELECT `".$lang->get('name')."` as name, category_id, category_parent_id, category_publish FROM `#__jshopping_categories`
where category_publish = '1' ORDER BY category_parent_id, ordering";
$db->setQuery($query);
$all_cats = $db->loadObjectList();

if(count($all_cats)) {
foreach ($all_cats as $key => $value) {
if(!empty( $value->category_parent_id ) && in_array($value->category_parent_id, $tmp)){
$tmp[] = $value->category_id;
}
}
}
return $tmp;
}
/**
     *  check the folder is existed, if not make a directory and set permission is 755
     *
     * @param array $path
     * @access public,
     * @return boolean.
     */
     function renderThumb( $path, $width = 100, $height = 100, $title = '', $isThumb = true ){
$jshopConfig = &JSFactory::getConfig();
      if( !preg_match("/.jpg|.png|.gif/",strtolower($path)) ) return '&nbsp;';
      if( $isThumb ){

        $path = str_replace( JURI::base(), '', $path );
        $imagSource = $jshopConfig->image_category_path.DS. str_replace( '/', DS,  $path );

        if( file_exists($imagSource)  ) {

          $path =  $width."x".$height.'/'.$path;
          $thumbPath = JPATH_SITE.DS.'images'.DS.'mod_ice_jshopping_categories'.DS. str_replace( '/', DS,  $path );
          if( !file_exists($thumbPath) ) {
            $thumb = PhpThumbFactory::create( $imagSource  ); 
            if( !self::makeDir( $path ) ) {
                return '';
            }   
            $thumb->adaptiveResize( $width, $height);
           
            $thumb->save( $thumbPath  );
          }
          $path = JURI::base().'images/mod_ice_jshopping_categories/'.$path;
        }
      }
      return '<img src="'.$path.'" title="'.$title.'" alt="'.$title.'" width="'.$width.'px" height="'.$height. 'px">';
    }
/**
     *  check the folder is existed, if not make a directory and set permission is 755
     *
     * @param array $path
     * @access public,
     * @return boolean.
     */
    function makeDir( $path ){
      $folders = explode ( '/',  ( $path ) );
      $tmppath =  JPATH_SITE.DS.'images'.DS.'mod_ice_jshopping_categories'.DS;
      if( !file_exists($tmppath) ) {
        JFolder::create( $tmppath, 0755 );
      };
      for( $i = 0; $i < count ( $folders ) - 1; $i ++) {
        if (! file_exists ( $tmppath . $folders [$i] ) && ! JFolder::create( $tmppath . $folders [$i], 0755) ) {
          return false;
        }
        $tmppath = $tmppath . $folders [$i] . DS;
      }   
      return true;
    }
}
?>
« Последнее редактирование: 11.04.2013, 11:18:55 от Usman48 »
*

CCTRRoman

  • Захожу иногда
  • 121
  • 3 / 0
Re: Убрать третий уровень меню
« Ответ #3 : 11.10.2013, 07:45:50 »
и как решили вопрос?
*

Usman48

  • Захожу иногда
  • 177
  • 7 / 0
Re: Убрать третий уровень меню
« Ответ #4 : 16.10.2013, 13:13:15 »
Тем что убедил заказчика этого не делать
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Алиас пункта меню совпадает с именем подкаталога в каталоге с сист.файлами

Автор Andrey N.

Ответов: 14
Просмотров: 4008
Последний ответ 07.10.2021, 23:57:15
от Garrr
Главное меню

Автор Анастасия87

Ответов: 7
Просмотров: 1933
Последний ответ 21.05.2021, 08:40:40
от arma
Как сократить вертикальное расстояние между меню сайта и баннером?

Автор MultiMatrix83

Ответов: 2
Просмотров: 1607
Последний ответ 16.02.2020, 19:30:25
от MultiMatrix83
Редактирование Модуля - в меню не удаляется пункт

Автор bovinkm

Ответов: 4
Просмотров: 1785
Последний ответ 16.08.2019, 15:00:22
от bovinkm
Не выбирается материал в Joomla при создании меню. Как быть?

Автор elliotos

Ответов: 8
Просмотров: 3403
Последний ответ 09.07.2019, 16:38:31
от cerxx