Mythbuster
26.11.2006, 15:03
Hallo zusammen
Hier verwenden ja einige bereits das yaml Template (tabellenfreies Template). Gibts eigentlich eine Möglichkeit, das die Kategorien ständig geöffnet bleiben? Ich hatte zuvor ein Modul mit welchem das geklappt hat. Da die neue xtc_show_category.inc anders aufgebaut ist, funktioniert das template leider nicht mehr.
Hier die xtc_show_category.inc des yaml templates:
Was müsste ich da ändern, damit die ständig geöffnet bleibt?
<?php
/ -----------------------------------------------------------------------------------------
** $Id: xtc_show_category.inc.php 1262 2006-10-27 10:00:32Z mz $
** YAML für xt:Commerce - Tabellenfreie Templates
** http://yaml.t3net.de
** Copyright (c) 2006 YAML für xt:Commerce
** -----------------------------------------------------------------------------------------
** based on:
** (c) 2000-2001 The Exchange Project**(earlier name of osCommerce)
** (c) 2002-2003 osCommerce(categories.php,v 1.23 2002/11/12); www.oscommerce.com
** (c) 2003**** nextcommerce (xtc_show_category.inc.php,v 1.4 2003/08/13); www.nextcommerce.org
** (c) 2003-2005 XT-Commerce
** Released under the GNU General Public License
** --------------------------------------------------------------------------------------- /
function xtc_show_category($counter, $levelNow = -1 , $getPrev = "-1" ) {
****global $foo, $categories_string, $id;
****
****// Wenn das erste Element wird als Ebene -1 zugewiesen
****if ($getPrev == '-1') {
********$foo[$getPrev]['level'] = "-1";
****}
****// Nächste ID wird als Variable definiert
****$getNext = $foo[$counter]['next_id'];
****
****// Wenn das erste Element wird die Body-Box und eine float-Box geöffnet
****if ($foo[$counter]['level']=='') {
****** ****if (strlen($categories_string)=='0') {
************$categories_string .= '"floatbox">"catListBody">';
********}
****}
****// Öffne Liste wenn Elementebene des vorherigen Elements kleiner dem aktuellen ist
****if ($foo[$getPrev]['level'] < $foo[$counter]['level']) {
********$categories_string .= '';
****}
****
****// Überprüfung ob Elemnt aktiv, sowie öffnen des Listenelements
****if ( ($id) && (in_array($counter, $id)) ) {
********$categories_string .= '<li class="activeCat">"activeCat">';
****} else {
********$categories_string .= '[ ]';
****}
****
****// Linkausgabe
****$categories_string .= '<a href="';
****$cPath_new=xtc_category_link($counter,$foo[$counter]['name']);
****$categories_string .= xtc_href_link(FILENAME_DEFAULT, $cPath_new);
****$categories_string .= '">';
****$categories_string .= $foo[$counter]['name'];
****
****// Gibt die Anzahl der Produkte in der Kategorie aus (wenn aktiviert)
****if (SHOW_COUNTS == 'true') {
********$products_in_category = xtc_count_products_in_category($counter);
********if ($products_in_category > 0) {
************$categories_string .= '(' . $products_in_category . ')';
**********}
****}
****
****// Überprüfung ob Elemnt aktiv
****if ( ($id) && (in_array($counter, $id)) ) {
****// Wenn aktuelle Elementebene kleiner als die nächste, schließe Listenelement, sowie Beenden des Links
********if ($foo[$counter]['level'] < $foo[$getNext]['level']) {
************$categories_string .= '</a></div>';
********} else {
************$categories_string .= '</a></div>';
********}
****} else {
********if ($foo[$counter]['level'] < $foo[$getNext]['level']) {
************$categories_string .= '</a>';
********} else {
************$categories_string .= '</a>';
********}
****}
****
****// Wenn nächste Elementebene kleiner ist als die aktuelle, soviele Schließtags wie Differenz ist
****if ($foo[$getNext]['level'] < $foo[$counter]['level'] ) {
********$cul = $foo[$counter]['level'] - $foo[$getNext]['level'];
********for ($iul = 1; $iul <= $cul ; $iul++ ) {
************$categories_string .= '';
********}
****}
****
****// Wenn weitere Elemente vorhanden sind, rufe Funktion mit nächstem Element auf, andernfalls schließe Ebene 1 und Boxen
****if ($foo[$counter]['next_id']) {
********xtc_show_category($foo[$counter]['next_id'], $foo[$counter]['level'], $counter );
****} else {
********$categories_string .= '[/list]</div></div>';
****}
}
?>
Hier verwenden ja einige bereits das yaml Template (tabellenfreies Template). Gibts eigentlich eine Möglichkeit, das die Kategorien ständig geöffnet bleiben? Ich hatte zuvor ein Modul mit welchem das geklappt hat. Da die neue xtc_show_category.inc anders aufgebaut ist, funktioniert das template leider nicht mehr.
Hier die xtc_show_category.inc des yaml templates:
Was müsste ich da ändern, damit die ständig geöffnet bleibt?
<?php
/ -----------------------------------------------------------------------------------------
** $Id: xtc_show_category.inc.php 1262 2006-10-27 10:00:32Z mz $
** YAML für xt:Commerce - Tabellenfreie Templates
** http://yaml.t3net.de
** Copyright (c) 2006 YAML für xt:Commerce
** -----------------------------------------------------------------------------------------
** based on:
** (c) 2000-2001 The Exchange Project**(earlier name of osCommerce)
** (c) 2002-2003 osCommerce(categories.php,v 1.23 2002/11/12); www.oscommerce.com
** (c) 2003**** nextcommerce (xtc_show_category.inc.php,v 1.4 2003/08/13); www.nextcommerce.org
** (c) 2003-2005 XT-Commerce
** Released under the GNU General Public License
** --------------------------------------------------------------------------------------- /
function xtc_show_category($counter, $levelNow = -1 , $getPrev = "-1" ) {
****global $foo, $categories_string, $id;
****
****// Wenn das erste Element wird als Ebene -1 zugewiesen
****if ($getPrev == '-1') {
********$foo[$getPrev]['level'] = "-1";
****}
****// Nächste ID wird als Variable definiert
****$getNext = $foo[$counter]['next_id'];
****
****// Wenn das erste Element wird die Body-Box und eine float-Box geöffnet
****if ($foo[$counter]['level']=='') {
****** ****if (strlen($categories_string)=='0') {
************$categories_string .= '"floatbox">"catListBody">';
********}
****}
****// Öffne Liste wenn Elementebene des vorherigen Elements kleiner dem aktuellen ist
****if ($foo[$getPrev]['level'] < $foo[$counter]['level']) {
********$categories_string .= '';
****}
****
****// Überprüfung ob Elemnt aktiv, sowie öffnen des Listenelements
****if ( ($id) && (in_array($counter, $id)) ) {
********$categories_string .= '<li class="activeCat">"activeCat">';
****} else {
********$categories_string .= '[ ]';
****}
****
****// Linkausgabe
****$categories_string .= '<a href="';
****$cPath_new=xtc_category_link($counter,$foo[$counter]['name']);
****$categories_string .= xtc_href_link(FILENAME_DEFAULT, $cPath_new);
****$categories_string .= '">';
****$categories_string .= $foo[$counter]['name'];
****
****// Gibt die Anzahl der Produkte in der Kategorie aus (wenn aktiviert)
****if (SHOW_COUNTS == 'true') {
********$products_in_category = xtc_count_products_in_category($counter);
********if ($products_in_category > 0) {
************$categories_string .= '(' . $products_in_category . ')';
**********}
****}
****
****// Überprüfung ob Elemnt aktiv
****if ( ($id) && (in_array($counter, $id)) ) {
****// Wenn aktuelle Elementebene kleiner als die nächste, schließe Listenelement, sowie Beenden des Links
********if ($foo[$counter]['level'] < $foo[$getNext]['level']) {
************$categories_string .= '</a></div>';
********} else {
************$categories_string .= '</a></div>';
********}
****} else {
********if ($foo[$counter]['level'] < $foo[$getNext]['level']) {
************$categories_string .= '</a>';
********} else {
************$categories_string .= '</a>';
********}
****}
****
****// Wenn nächste Elementebene kleiner ist als die aktuelle, soviele Schließtags wie Differenz ist
****if ($foo[$getNext]['level'] < $foo[$counter]['level'] ) {
********$cul = $foo[$counter]['level'] - $foo[$getNext]['level'];
********for ($iul = 1; $iul <= $cul ; $iul++ ) {
************$categories_string .= '';
********}
****}
****
****// Wenn weitere Elemente vorhanden sind, rufe Funktion mit nächstem Element auf, andernfalls schließe Ebene 1 und Boxen
****if ($foo[$counter]['next_id']) {
********xtc_show_category($foo[$counter]['next_id'], $foo[$counter]['level'], $counter );
****} else {
********$categories_string .= '[/list]</div></div>';
****}
}
?>