parasit55 Posted January 25, 2011 Share Posted January 25, 2011 I have instal http://addons.oscommerce.com/info/7230 contributions. I have a problem in displaying some of the subcategories, are do not want to show it. The code is below. Can enyone help me? <link rel="stylesheet" type="text/css" href="inc/home.css?v=3.0" media="all" /> <tr><td><div id="page" class="categories"> <div id="page-inner"> <div id="search-bar" class="search-bar"> <div id="categories-title"><a id="cats_link" class="" href="javascript:void(0);"><?php echo BOX_HEADING_CATEGORIES;?></a></div> </div> <div class="col-main"></div><?php /* $Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ function PrintMenus( $parentID, $languageID, $start_path ){ $returnval = ''; if (($start_path == '') && ($parentID > 0)) { $start_path = $parentID; } else { if ($parentID > 0) $start_path .= "_" . $parentID; } if ($parentID != 0) { $returnval .= "<div id='categories-subs'><ul>"; } else { $returnval .= "<ul class='after-load-subs after-show-sub' id='categories'>"; // $returnval .= "<ul id='suckertree1'>"; } $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '".$parentID."' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languageID ."' order by sort_order, cd.categories_name"); $returnval .= '<li class="top-corner"></li>'; while ($categories = tep_db_fetch_array($categories_query)) { if ($start_path == "") { $grouppath = $categories['categories_id']; } else { $grouppath = $start_path . "_" . $categories['categories_id']; } $cPath_new = 'cPath=' . $grouppath; $categories_string = tep_href_link(FILENAME_DEFAULT, $cPath_new); $returnval .= "<li><a href='".$categories_string."'>".$categories['categories_name']."</a>"; if ( tep_has_category_subcategories($categories['categories_id'] ) ) { // $returnval .= PrintMenus( $categories['categories_id'], $languageID, $start_path ); } $returnval .= "</li>"; } $returnval .= '<li class="box-bottom"></li>'; $returnval .= "</ul>"; if ($parentID == 0) $returnval .= ""; return $returnval; } function PrintSubMenus( $parentID, $languageID, $start_path, $categories_name ){ $returnval = ''; if (($start_path == '') && ($parentID > 0)) { $start_path = $parentID; } else { if ($parentID > 0) $start_path .= "_" . $parentID; } if ($parentID != 0) { $returnval .= "<div class='sec-categories' rel='".$categories_name."'>"; } else { // $returnval .= "<ul id='categories'>"; // $returnval .= "<ul id='suckertree1'>"; } $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '".$parentID."' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languageID ."' order by sort_order, cd.categories_name"); while ($categories = tep_db_fetch_array($categories_query)) { if ($start_path == "") { $grouppath = $categories['categories_id']; } else { $grouppath = $start_path . "_" . $categories['categories_id']; } $cPath_new = 'cPath=' . $grouppath; $categories_string = tep_href_link(FILENAME_DEFAULT, $cPath_new); // if ($parentID != 0) {$returnval .= "<dl><dt><img src='images/".$categories['categories_image']."/>";} if ($parentID != 0) {$returnval .= "<dl><dt><a href='".$categories_string."'>".$categories['categories_name']."</a>";} if ( tep_has_category_subcategories($categories['categories_id'] ) ) { $returnval .= PrintSubMenus( $categories['categories_id'], $languageID, $start_path, $categories['categories_name'] ); } if ($parentID != 0) $returnval .= "</dt></dl>"; } $returnval .= "</div>"; //if ($parentID != 0) $returnval .= "</ul>"; return $returnval; } echo PrintMenus( 0, $languages_id, '' ).'<div id="categories-subs">'.PrintSubMenus( 0, $languages_id, '','' ).'</div>'; if (count($_GET)== 0 && strpos($_SERVER['SCRIPT_FILENAME'],'index.php')) { $collapse=''; } else { $collapse='';//$collapse='window.categoriesAPP.rootCollapse();'; } ?> </td></tr> <script id="home-js" type="text/javascript" src="inc/home.js"></script> <script id="home-js" type="text/javascript" src="inc/categories.js"></script> <script type="text/javascript"> //<![CDATA[ if(typeof(window.categoriesAPP) == "undefined"){ window.categoriesAPP = (new OSI.app.categories()).init(); } //alert(window.categoriesAPP); //alert(OSI.app.categories().config.isCollapse); //window.categoriesAPP.rootCollapse(); <?php echo $collapse; ?> //YUD.addClass("page","categories-collapse"); if(OSI.app.categories().config.isCollapse){ YUE.on([OSI.app.categories().config.handleItem,OSI.app.categories().config.rootTarget,OSI.app.categories().config.subTarget], "mouseover", function(){ clearTimeout(window.categoriesAPP.temp.collapseTimeoutId); window.categoriesAPP.rootExpand(); }) YUE.on([OSI.app.categories().config.handleItem,OSI.app.categories().config.rootTarget,OSI.app.categories().config.subTarget], "mouseout", function(){ window.categoriesAPP.temp.collapseTimeoutId = setTimeout(function(){window.categoriesAPP.rootCollapse();},500); }) } //]]> </script> Link to comment Share on other sites More sharing options...
parasit55 Posted January 25, 2011 Author Share Posted January 25, 2011 Guys i fix problem. Problem was in subcategory name, they was "Komponents " whit free string, now i rename to "Komponents" and work. Thanks I have instal http://addons.oscommerce.com/info/7230 contributions. I have a problem in displaying some of the subcategories, are do not want to show it. The code is below. Can enyone help me? <link rel="stylesheet" type="text/css" href="inc/home.css?v=3.0" media="all" /> <tr><td><div id="page" class="categories"> <div id="page-inner"> <div id="search-bar" class="search-bar"> <div id="categories-title"><a id="cats_link" class="" href="javascript:void(0);"><?php echo BOX_HEADING_CATEGORIES;?></a></div> </div> <div class="col-main"></div><?php /* $Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ function PrintMenus( $parentID, $languageID, $start_path ){ $returnval = ''; if (($start_path == '') && ($parentID > 0)) { $start_path = $parentID; } else { if ($parentID > 0) $start_path .= "_" . $parentID; } if ($parentID != 0) { $returnval .= "<div id='categories-subs'><ul>"; } else { $returnval .= "<ul class='after-load-subs after-show-sub' id='categories'>"; // $returnval .= "<ul id='suckertree1'>"; } $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '".$parentID."' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languageID ."' order by sort_order, cd.categories_name"); $returnval .= '<li class="top-corner"></li>'; while ($categories = tep_db_fetch_array($categories_query)) { if ($start_path == "") { $grouppath = $categories['categories_id']; } else { $grouppath = $start_path . "_" . $categories['categories_id']; } $cPath_new = 'cPath=' . $grouppath; $categories_string = tep_href_link(FILENAME_DEFAULT, $cPath_new); $returnval .= "<li><a href='".$categories_string."'>".$categories['categories_name']."</a>"; if ( tep_has_category_subcategories($categories['categories_id'] ) ) { // $returnval .= PrintMenus( $categories['categories_id'], $languageID, $start_path ); } $returnval .= "</li>"; } $returnval .= '<li class="box-bottom"></li>'; $returnval .= "</ul>"; if ($parentID == 0) $returnval .= ""; return $returnval; } function PrintSubMenus( $parentID, $languageID, $start_path, $categories_name ){ $returnval = ''; if (($start_path == '') && ($parentID > 0)) { $start_path = $parentID; } else { if ($parentID > 0) $start_path .= "_" . $parentID; } if ($parentID != 0) { $returnval .= "<div class='sec-categories' rel='".$categories_name."'>"; } else { // $returnval .= "<ul id='categories'>"; // $returnval .= "<ul id='suckertree1'>"; } $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '".$parentID."' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languageID ."' order by sort_order, cd.categories_name"); while ($categories = tep_db_fetch_array($categories_query)) { if ($start_path == "") { $grouppath = $categories['categories_id']; } else { $grouppath = $start_path . "_" . $categories['categories_id']; } $cPath_new = 'cPath=' . $grouppath; $categories_string = tep_href_link(FILENAME_DEFAULT, $cPath_new); // if ($parentID != 0) {$returnval .= "<dl><dt><img src='images/".$categories['categories_image']."/>";} if ($parentID != 0) {$returnval .= "<dl><dt><a href='".$categories_string."'>".$categories['categories_name']."</a>";} if ( tep_has_category_subcategories($categories['categories_id'] ) ) { $returnval .= PrintSubMenus( $categories['categories_id'], $languageID, $start_path, $categories['categories_name'] ); } if ($parentID != 0) $returnval .= "</dt></dl>"; } $returnval .= "</div>"; //if ($parentID != 0) $returnval .= "</ul>"; return $returnval; } echo PrintMenus( 0, $languages_id, '' ).'<div id="categories-subs">'.PrintSubMenus( 0, $languages_id, '','' ).'</div>'; if (count($_GET)== 0 && strpos($_SERVER['SCRIPT_FILENAME'],'index.php')) { $collapse=''; } else { $collapse='';//$collapse='window.categoriesAPP.rootCollapse();'; } ?> </td></tr> <script id="home-js" type="text/javascript" src="inc/home.js"></script> <script id="home-js" type="text/javascript" src="inc/categories.js"></script> <script type="text/javascript"> //<![CDATA[ if(typeof(window.categoriesAPP) == "undefined"){ window.categoriesAPP = (new OSI.app.categories()).init(); } //alert(window.categoriesAPP); //alert(OSI.app.categories().config.isCollapse); //window.categoriesAPP.rootCollapse(); <?php echo $collapse; ?> //YUD.addClass("page","categories-collapse"); if(OSI.app.categories().config.isCollapse){ YUE.on([OSI.app.categories().config.handleItem,OSI.app.categories().config.rootTarget,OSI.app.categories().config.subTarget], "mouseover", function(){ clearTimeout(window.categoriesAPP.temp.collapseTimeoutId); window.categoriesAPP.rootExpand(); }) YUE.on([OSI.app.categories().config.handleItem,OSI.app.categories().config.rootTarget,OSI.app.categories().config.subTarget], "mouseout", function(){ window.categoriesAPP.temp.collapseTimeoutId = setTimeout(function(){window.categoriesAPP.rootCollapse();},500); }) } //]]> </script> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.