DJ-Catalog2 - nowa przebudowana wersja katalogu. Zapraszam do testowania
Wyniki 1 do 10 z 64

Temat: DJ-Catalog2 - nowa przebudowana wersja katalogu. Zapraszam do testowania

Hybrid View

Poprzednia wiadomość Poprzednia wiadomość   Następna wiadomość Następna wiadomość
  1. #1

    Domyślny

    @Amadeuss-linux: Musisz w adminie otworzyć konfigurację pluginu DJ Catalog AddThis i ją zapisać

    @piotrkduraj: Ciężko tak strzelać w ciemno, ale mieliśmy podobny problem, który zostanie w poprawiony w kolejnej aktualizacji. Otwórz plik /administrator/components/com_djcatalog/lib/cattree.php i podmień funkcję buildTree() na następującą:
    Kod:
    function buildTree( $categoryList)
        {
            if (is_null($categoryList)) return;
            foreach ($categoryList as $category)
            {
                if ($this->node->id == $category->parent_id)
                {
                    $newCategory = new Category();
                     $newCategory->setCategory($category->id,  $category->name, $category->alias, $category->parent_id,  $category->published);
                    $newNode = new CatTree();
                    $newNode->setCatTree($newCategory);
                    $newNode->buildTree($categoryList);
                    $this->addChild($newNode->node);
                }
            }
        }
    Jeśli to nie pomoże, prześlij PM'kę z dostępami (FTP/Joomla Administrator), a pomożemy.
    Ostanio edytowane przez michalo : 28-08-2010 10:36

  2. #2
    Przeglądacz
    Dołączył
    13-06-2010
    Skąd
    Podhale
    Wpisy
    37
    Punkty
    10

    Domyślny DJ Catalog2

    Cytat Wysłane przez michalo Zobacz wiadomość
    @piotrkduraj: Ciężko tak strzelać w ciemno, ale mieliśmy podobny problem, który zostanie w poprawiony w kolejnej aktualizacji. Otwórz plik /administrator/components/com_djcatalog/lib/cattree.php i podmień funkcję buildTree() na następującą:
    Niestety nie ma tam funkcji bulidTree(). Poniżej przesyłam zawartość pliku cattree.php

    Kod:
    <?php
    /**
    * @version 2.0
    * @package DJ Catalog
    * @subpackage DJ Catalog Component
    * @copyright Copyright (C) 2010 Blue Constant Media LTD, All rights reserved.
    * @license http://www.gnu.org/licenses GNU/GPL
    * @author url: http://design-joomla.eu
    * @author email contact@design-joomla.eu
    * @developer Michal Olczyk - michal.olczyk@design-joomla.eu
    *
    *
    * DJ Catalog is free software: you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation, either version 3 of the License, or
    * (at your option) any later version.
    *
    * DJ Catalog is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    * GNU General Public License for more details.
    *
    * You should have received a copy of the GNU General Public License
    * along with DJ Catalog. If not, see <http://www.gnu.org/licenses/>.
    *
    */
    
    class Category
    {
        var $id;
        var $name;
    	var $alias;
        var $parent_id;
        var $published;
        var $children;
    
        function __construct()
        {
            $this->id = 0;
            $this->name = '';
    		$this->alias = '';
            $this->parent_id = null;
            $this->published = 1;
            $this->children = array ();
        }
        function Category()
        {
            $this->__construct();
        }
    
        function setCategory($id, $name, $alias, $parent_id, $published = 0)
        {
            $this->id = $id;
            $this->name = $name;
    		$this->alias = $alias;
            $this->parent_id = $parent_id;
            $this->published = $published;
        }
        function getChildren()
        {
            return $this->children;
        }
    }
    
    class CatTree
    {
        var $node;
    
        function __construct()
        {
            $this->node = new Category();
        }
    
        function CatTree()
        {
            $this->__construct();
        }
    
        function setCatTree( & $category)
        {
            $this->node = $category;
        }
    
        function addChild($child)
        {
            $this->node->children[$child->id] = $child;
        }
    
        function getRoot()
        {
            return $this->node;
        }
    
        function buildTree( $categoryList)
        {
            if (is_null($categoryList)) return;
            foreach ($categoryList as $category)
            {
                if ($this->node->id == $category->parent_id)
                {
                    $newCategory = new Category();
                    $newCategory->setCategory($category->id, $category->name, $category->alias, $category->parent_id, $category->published);
                    $newNode = new CatTree();
                    $newNode->setCatTree($newCategory);
                    $this->addChild($newCategory);
                    $newNode->buildTree($categoryList);
                }
            }
        }
    }
    
    class DjOptionCategory
    {
        var $text;
        var $value;
        var $disable;
    
        function __construct()
        {
            $text = null;
            $value = null;
            $disable = null;
        }
        function DjOptionCategory()
        {
            $this->__construct();
        }
    }
    
    function getCategoryList( & $root,&$categoryList, $level = 0, $position = 0)
    {
        $children = $root->getChildren();
        foreach ($children as $category)
        {
            $catprefix = '';
            for ($i = 0; $i < $level; $i++)
            $catprefix .= ' - ';
    		
    		$newcategory = new stdClass();
    		$newcategory->id = $category->id;
    		$newcategory->parent_id = $category->parent_id;
    		$newcategory->name = $catprefix.$category->name;
    		$newcategory->published = $category->published;
    		
    		$categoryList[] = $newcategory;
    		$position++;
    		getCategoryList($category, $categoryList, $level+1, $position);
    	}
    	return true;
    }
    function renderOptionList( & $root)
    {
        $optionList[0] = JHTML::_('select.option', '0', JText::_('COM_DJCATALOG_SELECT_ROOT_CAT'));
        getOptionList($root, $optionList);
        return $optionList;
    }
    function getOptionList( & $root, & $optionList, $level = 0)
    {
        $children = $root->getChildren();
        foreach ($children as $category)
        {
            $catprefix = '';
            for ($i = 0; $i < $level; $i++)
            $catprefix .= ' - ';
            $category->name = $catprefix.$category->name;
            $option = new DjOptionCategory();
            $option->value = $category->id;
            $option->text = $category->name;
            $option->disable = null;
            $optionList[] = $option;
            getOptionList($category, $optionList, $level+1);
        }
    }
    function renderCategoryFilter( & $root)
    {
        $optionList[0] = JHTML::_('select.option', '0', '- '.JText::_('COM_DJCATALOG_SELECT_CATEGORY').' -');
        getOptionList($root, $optionList);
        return $optionList;
    }
    
    function getChildrenList( & $root, $catid)
    {
        $children = $root->getChildren();
    	$childrenList = array();
    	$found = false;
        if ( isset ($children[$catid]))
        {
    		$childrenList[] = $catid;
            buildChildrenList($children[$catid], $childrenList);
    		return $childrenList;
        }
        else
        {
            foreach ($children as $category)
            {
    			$childrenList = getChildrenList($category, $catid);
    			if (isset($childrenList)) {
    				$found = true;
    				break;
    			}
            }
        }
    	if ($found) return $childrenList;
    }
    
    function buildChildrenList(&$root, &$childrenList) {
    	$children = $root->getChildren(); 
    	
    	foreach ($children as $id => $category) {
    		$childrenList[] = $id;
    		buildChildrenList($category, $childrenList);
    	}
    }
    
    function treerecurse( $id, $indent, $list, &$children, $maxlevel=9999, $level=0, $type=1 )
    	{
    		if (@$children[$id] && $level <= $maxlevel)
    		{
    			foreach ($children[$id] as $v)
    			{
    				$id = $v->id;
    
    				if ( $type ) {
    					$pre 	= '<sup>|_</sup>&nbsp;';
    					$spacer = '.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
    				} else {
    					$pre 	= '- ';
    					$spacer = '&nbsp;&nbsp;';
    				}
    
    				if ( $v->parent_id == 0 ) {
    					$txt 	= $v->name;
    				} else {
    					$txt 	= $pre . $v->name;
    				}
    				$pt = $v->parent_id;
    				$list[$id] = $v;
    				$list[$id]->treename = "$indent$txt";
    				$list[$id]->children = count( @$children[$id] );
    				$list = treerecurse( $id, $indent . $spacer, $list, $children, $maxlevel, $level+1, $type );
    			}
    		}
    		return $list;
    	}
    Dzięki za zainteresowanie.

  3. #3

    Domyślny

    Przejrzyj jeszcze raz - 6 funkcja klasy CatTree, linia ~94
    Ostanio edytowane przez michalo : 28-08-2010 10:45

  4. #4
    Przeglądacz
    Dołączył
    13-06-2010
    Skąd
    Podhale
    Wpisy
    37
    Punkty
    10

    Domyślny

    Cytat Wysłane przez michalo Zobacz wiadomość
    Przejrzyj jeszcze raz - 6 funkcja klasy CatTree, linia ~94
    Przepraszam. Nie zauważyłem.

    Bardzo Ci dziękuję za pomoc. Wszystko jest już OK. Działa bez zarzutów.

    ---------- Post dodany o 10:18 ---------- Poprzedni post był o 09:07 ----------

    Mam jeszcze jedno pytanko. Czy da się zrobić, żeby produkty przypisane do podkategorii wyświetlały się nie tylko w danej podkategorii, ale też w kategrii?

    Np.
    Kategoria: Internet
    Podkategorie: - Tworzenie www
    - Grafika

    Chciałbym, żeby wyświetlały się zbiorczo produkty z podkategorii Tworzenie www i Grafika w kategorii Internet.

Podobne tematy

  1. Szukam strony do testowania wyglądu witryny
    przez arekk na forum Szablony, wygląd, formatowanie
    Odpowiedzi: 1
    Ostatni post/autor: 11-04-2010, 20:54
  2. seyret nowa wersja
    przez kargulo na forum Różne
    Odpowiedzi: 3
    Ostatni post/autor: 29-05-2008, 11:38
  3. Nowa wersja SOBI2 (RC 2.8.5) została wydana
    przez neo_fox na forum Ogłoszenia i komunikaty
    Odpowiedzi: 0
    Ostatni post/autor: 19-03-2008, 13:47
  4. Nowa wersja?
    przez tom na forum Joomla Power Edition
    Odpowiedzi: 3
    Ostatni post/autor: 23-01-2007, 23:00

Reguły pisania

  • Nie możesz zakładać nowych tematów
  • Nie możesz dodawać wypowiedzi
  • Nie możesz dodawać załączników
  • Nie możesz poprawiać swoich postów
  •