Gossamer Forum
Home : Products : Links 2.0 : Customization :

category columns

Quote Reply
category columns
I know a great deal has been written about ways of getting category listings to appear in a particular number of columns, and I've read all I can find on the matter. For some reason, though, I just can't get my categories to appear in more than one column. Here's the code in question:

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+2) / 2);



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];



# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<tr><td><font face="Verdana, Helevtica, Arial" size=2><dl><dt><strong><a
href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;
$output .= qq|<small><font color="red">new</font></small>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq|</dt>|;
$output .= qq|<br><small>| . qq|&nbsp;| x 4;
$j=0;
for (@{$subcategories{$subcat}}) {
if (m,^\Q$subcat\E/([^/]+)$,) {
$child = ($1);
if ($hyperlink) {
$output .= qq|<a href="$build_root_url/$subcat/$child/">$child</a>,|
}
else {
$output .= qq|$child,|
}
$j++;
if ($j == $max_subs) {
last;
$j = 0;
}
}
}
chop $output;
$output .= qq|</small><br>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</dl></font></td></tr>|;
}
return $output;
}

1;

Any help would be greatly appreciated. Thanks.


Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund