adi - Here is a new case 7 that should give the fourth level subcats only when at the fourth level.
PHP Code:
case 7:// active subtree, active branches only, only 1st & 4th level - treat first subcat like top - customized 20100205 for madijelovi
if($cPath_top != $path_top){//only 1 top cat's subs
$skip_cat = 1;
break;
}
if($cat_depth == 1){//show all first level subs
break;
}
if($cat_depth == 4 and substr_count($_GET['cPath'],'_') == 4){//check 4th level for active parent, only for $cPath depth 4
$path_ids = explode('_',$path);
$path_parent = $path_ids[count($path_ids)-2];
if (in_array($path_parent,explode('_',$_GET['cPath']))) break;//show only subcats w parent in $cPath
}
$skip_cat = 1;//skip all others
break;
Bookmarks