Categories box not used in home page, so don't have to account for display there.
Sports are top cats, teams are first level subcats, product types are second level subcats, holding products.
On sport page, want current top cat & its subcats. [default is all top cats & current first subs][skip non-current top cats]
On team page, want current top cat, current first subcat & its second level subcats. [default is all top cats, all first subs of current top & all second subs of current first sub][skip non-current top cats & non-current first subs]
On product type (listing) page, want current top cat, current first subcat & its second level subcats, with current second level subcat highlighted. [default is all top cats, all first subs of current top & all second subs of current first sub, with current second sub highlighted][skip non-current top cats & non-current first subs]
$current_top = false;
$show_this = false;
if ((int)str_replace("cPath=","",$box_categories_array[$i]['path']) == $_GET['cPath']) { //top cat of path is active
//above line logically should look like this, but didn't work in previous test -----v
//if ((int)str_replace("cPath=","",$box_categories_array[$i]['path']) == (int)$_GET['cPath']) { //top cat of path is active
$current_top = true;
if (($box_categories_array[$i]['current']) or (substr_count($box_categories_array[$i]['path'],'_') == 2)) {
$show_this == true;
}
}
if (($current_top == false) or ($show_this == false) or zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
// skip if this is for the document box (==3)
} else {
Shelving this for tonight because I'm too tired to think about it any more. It may work as is or may want some more tweaking - I'll look at it when fresh.