Okay...
Here is my de-bugging report for your files.
Code:
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, $subcatstyle, @subcatsub, $length, $s);
my ($half) = int (($#subcat+2) / 2);
# Print Header.
$output = qq|<div class="margin"><table width="80%" border="0" cellspacing="0" cellpadding="0"><tr><td class="catlist" valign="top">\n|;
foreach $subcat (sort @subcat) {
($description) = @{$category{$subcat}}[2];
($subcatstyle) = @{$category{$subcat}}[8];
# 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);
}
$mod = $stats{"$subcat"}[3];
$new_add = $stats{"$subcat"}[4];
$numlinks = $stats{"$subcat"}[0];
# 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 class="catlist" valign="top">\n|;
}
$i++;
# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<a class="catlist" href="$url">$category_name</a>
<font class="catlist">($numlinks)</font> |;
if ($new_add eq "Yes") {
$days_old = &days_old($stats{"$subcat"}[2]);
if ($days_old <= 2) {
$output .= qq| $new_1|;
}
elsif ($days_old <= 7) {
$output .= qq| $new_3|;
}
elsif ($days_old <= 14) {
$output .= qq| $new_7|;
}
}
if ($mod eq "Yes") {
$output .= qq| $updated|;
}
$output .= qq|<BR>|;
if ($subcatstyle =~ m,^\(([^\)]+)\)(\d)$, && $#{$subcategories{$subcat}} >= 0) {
($subcatstyle, $style) = ($1, $2);
$s = 0;
@subcatsub = split (/\|/, $subcatstyle);
$output .= qq|  |;
if ($style eq "1") {
foreach $category_name (@subcatsub) {
foreach (sort @{$subcategories{$subcat}}) {
($subcatstyle eq "ALL" && $#subcatsub == 0) ?
($_ =~ m,.*/([^/]+)$, and $category_name = &build_clean($1)) :
($_ eq "$subcat/$category_name" or next);
}
if ($style eq "1") {
$length += length($category_name);
($length > $subcat_length) and last;
}
if ($s > 0) {
$output .= qq~, ~ and $length += 2 if ($style eq "1");
$output .= qq~ ~ if ($style eq "2");
}
$url = "$build_root_url/" . &urlencode($_) . "/";
$output .= qq~<LI>~ if ($style eq "2");
$output .= qq~<a class="subcat" href="$url">$category_name</a>~;
$s++;
last if ($subcatstyle ne "ALL" && $#subcatsub > 0);
}
}
undef $length;
if ($s < $#{$subcategories{$subcat}}) {
$output .= qq~...~ if ($style eq "1");
}
$output .= qq~<BR>~;
}
else {
}
}
# Don't forget to end the table..
$output .= "</td></tr></table></div>\n";
return $output;
}
}
I won't even go into the number of syntax errors I found...I lost count at 10.
Although I would add more sub-categories to see the full effect of the Subcategories Mod.
Eliot Lee....
* Thinking out of the box (codes) is not only fun, but effective.