|
||||
|
da musst du schon die funktion selbst umprogrammieren.
__________________
xt:Commerce Helpdesk xt:Commerce Blog xt:Commerce Warenwirtschaft ### ![]() Offene Stellen bei xt:Commerce! xt:Commerce stellt ein ### |
|
||||
|
jo.
schau einfach mal die funktion xtc_get_category_tree() an, die erzeugt einen kompletten baum.
__________________
xt:Commerce Helpdesk xt:Commerce Blog xt:Commerce Warenwirtschaft ### ![]() Offene Stellen bei xt:Commerce! xt:Commerce stellt ein ### |
|
|||
|
so, jetzt hab ich es wie ich es wollte. :bounce:
sch?nen dank an mario f?r den hinweis, da war ja einiges zu ?ndern in xtc_show_category.inc.php und category.php zur hilfe habe ich mir noch einige osc-contributions zu diesem thema angesehen und in einem auch noch "Bullet Images for Categories" integriert. wenn interesse besteht, kann ich das gerne auch zum download zur verf?gung stellen. brauche dann aber noch ein wenig zeit um den code etwas zu s?ubern. gute nacht p3e |
|
|||
|
so, war die letzten tage nicht mehr dazu gekommen, aber versprochen ist versprochen.
f?r die anpassung habe ich mir die osc-contributions Add Bullet Images for Categories Infobox v1.0 (12/09/2002) by Toby Adams <toby@opticalfunk.co.uk All Categories V1.7 (06/17/2003) by Christian Lescuyer <cl@goelette.net> und hw_categories.php_v0.2 (22.06.2003) FrankW <Daywalker@Hawkweb.de> als vorlage genommen und das ganze f?r xtc rc1 angepasst. es sind zwei dateien im templateordner zu ?ndern (achtung! erst neuen templateordner anlegen und template reinkopieren, damit bei nichtgefallen problemlos zur?ckgeschaltet werden kann!!): 1. categories.php den code durch folgenden ersetzen: Code:
<?php /* ----------------------------------------------------------------------------------------- ? $Id: categories.php,v 1.3 2004/03/16 14:59:01 fanta2k Exp $ ? XT-Commerce - community made shopping ? http://www.xt-commerce.com ? Copyright (c) 2003 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 (categories.php,v 1.10 2003/08/17); www.nextcommerce.org ? Released under the GNU General Public License ? ----------------------------------------------------------------------------------------- ? Third Party contributions: ? Enable_Disable_Categories 1.3 ? ? ? ? Autor: Mikel Williams | mikel@ladykatcostumes.com ? Add Bullet Images for Categories Infobox v1.0 (12/09/2002) ?by Toby Adams <toby@opticalfunk.co.uk ? All Categories V1.7 (06/17/2003) ? by Christian Lescuyer <cl@goelette.net> ? hw_categories.php_v0.2 (22.06.2003) ?FrankW <Daywalker@Hawkweb.de> ? Released under the GNU General Public License ? ---------------------------------------------------------------------------------------*/ // reset var $box_smarty = new smarty; $box_content=''; $box_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/'); ?// include needed functions ?require_once(DIR_FS_CATALOG .'templates/'.CURRENT_TEMPLATE. '/source/inc/xtc_show_category.inc.php'); ?require_once(DIR_FS_INC . 'xtc_has_category_subcategories.inc.php'); ?require_once(DIR_FS_INC . 'xtc_count_products_in_category.inc.php'); ?$categories_string = ''; ? ?if (GROUP_CHECK=='true') { ? $group_check="and c.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; ?} ?$categories_query = xtc_db_query("select c.categories_id, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cd.categories_name, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? c.parent_id from " . ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? TABLE_CATEGORIES . " c, " . ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? TABLE_CATEGORIES_DESCRIPTION . " cd ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? where c.categories_status = '1' ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ".$group_check." ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? and c.categories_id = cd.categories_id ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? and cd.language_id='" . (int)$_SESSION['languages_id'] ."' ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? order by sort_order, cd.categories_name"); ?while ($categories = xtc_db_fetch_array($categories_query)) ?{ ? ?$foo[$categories['categories_id']] = array( ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'name' => $categories['categories_name'], ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'parent' => $categories['parent_id']); ?} ?xtc_show_category(0, 0, $foo, ''); ? ?$box_smarty->assign('BOX_CONTENT', $categories_string); ?$box_smarty->assign('language', $_SESSION['language']); ? ? ? // set cache ID ?if (USE_CACHE=='false') { ?$box_smarty->caching = 0; ?$box_categories= $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_categories.html'); ?} else { ?$box_smarty->caching = 1; ?$box_smarty->cache_lifetime=CACHE_LIFETIME; ?$box_smarty->cache_modified_check=CACHE_CHECK; ?$cache_id = $_SESSION['language'].$_GET['cPath']; ?$box_categories= $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_categories.html',$cache_id); ?} ? ?$smarty->assign('box_CATEGORIES',$box_categories); ?> Code:
<?php /* ----------------------------------------------------------------------------------------- ? $Id: xtc_show_category.inc.php,v 1.2 2004/02/22 16:15:30 fanta2k Exp $ ? XT-Commerce - community made shopping ? http://www.xt-commerce.com ? Copyright (c) 2003 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 ? ----------------------------------------------------------------------------------------- ? Third Party contributions: ? Add Bullet Images for Categories Infobox v1.0 (12/09/2002) ?by Toby Adams <toby@opticalfunk.co.uk ? All Categories V1.7 (06/17/2003) ? by Christian Lescuyer <cl@goelette.net> ? hw_categories.php_v0.2 (22.06.2003) ?FrankW <Daywalker@Hawkweb.de> ? Released under the GNU General Public License ? ---------------------------------------------------------------------------------------*/ ?function xtc_show_category($cid, $level, $foo, $cpath) { ? ?global ?$categories_string, $HTTP_GET_VARS; $tpl_path='templates/'.CURRENT_TEMPLATE; if ($cid != 0) { // 1.7 Get the current path info ? $category_path = explode('_',$HTTP_GET_VARS['cPath']); ? $in_path = in_array($cid, $category_path); ? $this_category = array_pop($category_path); ? ?for ($a=0; $a<$level; $a++) ? // 1.7 only indent subcategories (top level are flush left) ? ?if ($a>0) { ? ? $categories_string .= ?''; ? ?} ? ?// 1.7 indicate the current category ? ?if ($this_category == $cid) { ? ? ? // 1.6 Are we on the "path" to selected category? If yes, use <b> ? ? ? if ($in_path) { ? ? ?$categories_string .= ?'<img src='.$tpl_path.'/img/cat_arrow_other.gif align="absmiddle"><font color="#006600"><b>'; ? ? ? } else { ? ? ?$categories_string .= ?'<img src='.$tpl_path.'/img/cat_arrow_down.gif align="absmiddle">'; ? ? } ? ? ? $categories_string .= ?$foo[$cid]['name']; ? ? ? if ($in_path) ? ? ? ?$categories_string .= ?'</b></font>'; ? ? ? // 1.7 ?don't link the current category ? ? ? if ($this_category != $cid) { ? ? ? ?$categories_string .= '</a>'; ? ? ? } ? ?} ? ?// 1.7 ?don't link the current category ? ?if ($this_category != $cid) { ? ? if (xtc_has_category_subcategories($cid)) { ? ? ? ? ?// 1.6 Are we on the "path" to selected category? If yes, use <b> ? ? ? ? ?if ($in_path) { ? ? ? ? $categories_string .= ?'<a href="' . xtc_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '"><img src='.$tpl_path.'/img/cat_arrow_active.gif align="absmiddle" border=0><font color="#006600"><b>'; ? ? ? ? ?} else { ? ? ? ? $categories_string .= ?'<a href="' . xtc_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '"><img src='.$tpl_path.'/img/cat_arrow_down.gif align="absmiddle" border=0>'; ? ? ? ?} ? ? } else { ? ? ? ? ?// 1.6 Are we on the "path" to selected category? If yes, use <b> ? ? ? ? ?if ($in_path) { ? ? ? ? $categories_string .= ?'<a href="' . xtc_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '"><img src='.$tpl_path.'/img/cat_arrow_active.gif align="absmiddle" border=0><font color="#006600"><b>'; ? ? ? ? ?} else { ? ? ? ? $categories_string .= ?'<a href="' . xtc_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '"><img src='.$tpl_path.'/img/cat_arrow_right.gif align="absmiddle" border=0>'; ? ? ? ?} ? ? } ? ? ? $categories_string .= ?$foo[$cid]['name']; ? ? ? if ($in_path) ? ? ? ?$categories_string .= ?'</b></font>'; ? ? ? // 1.7 ?don't link the current category ? ? ? if ($this_category != $cid) { ? ? ? ?$categories_string .= '</a>'; ? ? ? } ? ?} ?// 1.4 SHOW_COUNTS is 'true' or 'false', not true or false ? ? if (SHOW_COUNTS == 'true') { ? ? ?$products_in_category = xtc_count_products_in_category($cid); ? ? ?if ($products_in_category > 0) { ? ? ? $categories_string .= '(' . $products_in_category . ')'; ? ? ?} ? ? } ? ?$categories_string .= '<br>' ."\n"; ? ? } // Traverse category tree ? foreach ($foo as $key => $value) { ? ?if ($foo[$key]['parent'] == $cid) { ? ? xtc_show_category($key, $level+1, $foo, ($level != 0 ? $cpath . $cid . '_' : '')); ? ?} ? } ?} ?> dann noch geeignete gif's (cat_arrow_active.gif, cat_arrow_down.gif, cat_arrow_other.gif und cat_arrow_right.gif) in den img-ordner des templates legen und fertig :] viel spass damit p3e |
|
||||
|
Ich muss den Thread leider nochmal rauskramen :i:
Ich habe die ?nderungen wie beschrieben durchgef?hrt, allerdings zerrei?t es mir dann das komplette Layout, besonder wenn ich auf eine der Unterkategorien klicke: http://www.tweakingshop.de/xtc/ Der Header und der Navtrail werden hier quasi komplett ?ber die linke Navigationsleiste gequetscht. Kann mir jemand sagen, wo hier der Fehler liegt? Habe sonst keine Dateien ver?ndert XTC Version 3.0.1 edit: Es zerschie?t nicht nur das Layout, ich kann generell nicht mehr mit dem Shop interagieren, sprich Kontakt, Login, Newsletter usw. f?hren zu einer Fehlermeldung: Warning: Cannot modify header information - headers already sent by (output started at [...]/xtc/templates/xtc2/source/inc/xtc_show_category.inc.php:2) in [...]/xtc/inc/xtc_redirect.inc.php on line 28 Habs mal wieder rausgenommen, aber ich brauche noch eine L?sung f?r das Problem. Kann mir jemand sagen, wie ich das Skript an V3.0.1 anpassen kann? |
![]() |
| Lesezeichen |
| Stichworte |
| kategorien, sichtbar, unterkategorien |
| Themen-Optionen | |
| Ansicht | |
|
|