Did you put "sub2" in the category description or "SUB2" ? It has to be all CAPS.
The code I use in my site_html_tmplates.pl is as follows: (this is a slight alteration of widgetz code. I notice this version was not listed in the new posted mod.)
Code:
########################################################################################
# THE FOLLOWING DETERMINES YOUR CATEGORY LISTING, IT'S NOT TEMPLATE BASED (YET)! #
########################################################################################
sub site_html_print_cat {
# --------------------------------------------------------
# This routine determines how the list of categories will look.
# We now use a table to split the category name up into two columns.
# For each category you can use the following variables:
#
# $url : The URL to go to that category
# $category_name : The category name with _ and / removed.
# $category_descriptions{$subcat}: The category description (if any).
# $numlinks : The number of links inside that category (and subcategories).
# $mod : The newest link inside of that category.
#
my (@subcat) = @_;
my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
my ($half) = int (($#subcat+3) / 3);
# Print Header.
$output = qq|<div align="center"><table border="0" cellspacing="0" cellpadding="12" width=""><tr><td valign="top" width="">\n|;
foreach $subcat (sort @subcat) {
($description) = @{$category{$subcat}}[2];
# First let's get the name, number of links, and last modified date...
$url = "$build_root_url/" . &urlencode($subcat) . "/";
if ($subcat =~ m,.*/([^/]+)$,) { $category_name = &build_clean($1); } else { $category_name = &build_clean($subcat); }
$numlinks = $stats{"$subcat"}[0];
$mod = $stats{"$subcat"}[1];
# We check to see if we are half way through, if so we stop this table cell
# and begin a new one (this lets us have category names in two columns).
if ($i == $half) {
$output .= qq|</td><td valign="top" width="">\n|;
$i = 0;
}
$i++;
# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<font face="Verdana, Helevtica, Arial" size=3><b><a href="$url">$category_name</a></b></font>|;
my $days_old = &days_old($mod);
if ($days_old <= 2) { $output .= qq| $new_1|; }
elsif ($days_old <= 7) { $output .= qq| $new_3|; }
elsif ($days_old <= 14) { $output .= qq| $new_7|; }
$output .= qq|<br><font face="Verdana, Helevtica, Arial" size=1>(There are $numlinks links in this category)</font><BR>|;
if ($subcatsub =~ m,.*/([^/]+)$,) { $subcategory_name = &build_clean($1); } else { $subcategory_name = &build_clean($subcatsub); }
$output .= qq~$form_font <FORM name = "form"><SELECT NAME="site" SIZE=1 onChange ="formHandler(this.form)"> <option value="">--Select a Subcategory--~ if ($description =~ /3$/ && $v eq "0");
$output .= qq~<option value="$suburl">$subcategory_name~ if ($description =~ /3$/);
$output .= qq~ </select></form>~ if ($description =~ /3$/ && $v eq $#{$subcategories{$subcat}});
$v++;
}
$output .= qq~</font>~;
}
elsif ($description =~ /^SUB.*/) {
$output .= qq~$form_font <FORM name = "form"><SELECT NAME="site" SIZE=1 onChange ="formHandler(this.form)"><option value="">--Select a Subcategory--~ if ($description =~ /3$/);
$output .= qq~<option value="">None </select></form>~ if ($description =~ /3$/);
}
else {
$output .= qq~<dd>$form_font $description</font>~ if (!($description =~ /^[\s\n]*$/));
}
}
# Don't forget to end the unordered list..
$output .= "</td></tr></table></div>\n";
return $output;
}