I had to tweak this plug in again to get rid of the extra "BR" if the category had no subcategories in it.
Code:
if ($description){
if ($cat_r->{Description}=~/.SUB[01]/s) {
$description="< br >".$description;
}
if ($cat_r->{Description}=~/SUB[01]./s) {
$description.="< br >";
}
}
Notice the extra 'if' that tests $description before doing anything to it.
I'm still working on a tag to remove the SUB1 or SUB0 from the rest of the site if you display your descriptions on the category pages, but it might be easier just to come up with a new field for the plug-in actually.
The plug-in adds itself to the <%description%> tag, but what if the plug-in used a new field in the category table "SubCatFormat". That could be either NULL/Empty, or SUB0, SUB1 .... etc. The rest of the site ignored this, but the plug-in would use it to add the subcategory listing to the description before display?
That way you have some extra control over the "subcats" and "description" formatting.
That might be a better way to go.
PUGDOG® PUGDOG® Enterprises, Inc.
FAQ: http://LinkSQL.com/FAQ