Uh...it should work...because I have the following codes in my
sub site_html_print_cat (don't be concerned about the name) and guess what? I have one column of categories....
Here is my
sub site_html_print_cat (published for the fifth time now in this forum)....
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 align="center"><center><table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td valign="top" width="50%">\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); }
$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="50%">\n|;
# }
$i++;
# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<font face="Verdana" size="2"><b><a href="$url">$category_name</a></font></b> <font face="Verdana" size="1">($numlinks)</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>|;
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~<font face="Verdana" size="1"><a href="$url">$category_name</a></font>~;
$s++;
last if ($subcatstyle ne "ALL" && $#subcatsub > 0);
}
}
undef $length;
if ($s < $#{$subcategories{$subcat}}) {
$output .= qq~...~ if ($style eq "1");
}
$output .= qq~<BR><BR>~;
}
else { }}
# Don't forget to end the table..
$output .= "</td></tr></table></div></center>\n";
return $output;
} Notice that I have remmed out
# all the
$half codes...
I betcha that you inadvertantly deleted the
$i++; codes AFTER the following codes:
Code:
if ($i == $half) {
$output .= qq|</td><td valign="top" width="50%">\n|;
} You need to keep the
$i++; codes in order for the categories to print.
Look at the following web page (if you don't believe me):
http://anthrotech.com/pc/ Then you can look at my Category pages, and you will see that I have categories in two columns...I have basically switched the codes I've given in this Thread and other Threads.
Regards,
Eliot Lee