if I understud your question correctly, you may look for a way only display categories, if they contain active items for sale. If so, you may test one of the below options.Option 1 would display all cats, but empty cats cannot be accessed because hyperlink to such section is not enabled.
Option 2 would display Category Names only, if the Cat contains at least 1 active item for sale.
Quote this line with a "#" like:
#print "<TR><TD>$config{'categoryfont'}<A HREF=\"$ENV{'SCRIPT_NAME'}?category=$key&listtype=current\">$mycategory{$key}</A> \($numfiles{$key}\)</FONT></TD></TR></B>";
and paste one of the 2 sections below after the quoted line.
Good luck
Homer
--------------
Option 1
--------------
# Option activate Hyperlink
if ($numfiles{$key} > 0){
print "<TR><TD>$config{'categoryfont'}<A HREF=\"$ENV{'SCRIPT_NAME'}?category=$key&listtype=current\">$mycategory{$key}</A> \($numfiles{$key}\)</FONT></TD></TR></B>";
}
if ($numfiles{$key} < 1){
print "<TR><TD>$config{'categoryfont'}<A HREF=\"$ENV{'SCRIPT_NAME'}?category=$key&listtype=current\">$mycategory{$key}</A> \($numfiles{$key}\)</FONT></TD></TR></B>";
}
--------------
Option 2
--------------
# Hide empty cat display
if ($numfiles{$key} > 0){
print "<TR><TD>$config{'categoryfont'}<A HREF=\"$ENV{'SCRIPT_NAME'}?category=$key&listtype=current\">$mycategory{$key}</A> \($numfiles{$key}\)</FONT></TD></TR></B>";
}
if ($numfiles{$key} < 1){
# no content here
}
--------------
If you don't know where you're going, any road will get you there.