There are two ways to do it, but I think the easiest is to look at the code in the print_cat routine.
Where it's set up to do two columns, and you enter a link into each, what you want to do is make the loop to enter two ROWS of one etry each, and make the first row grey, and the second row white, then loop back.
Assuming your link.html has _NO_ open table code -- ie: either has no tables, or begins with a TABLE tag and closes with a TABLE tag:
Something like:
Code:
# Print Header.
$output = qq|<div class="margin"><table width="100%" border="0" cellspacing="0" cellpadding="0">\n|;
$i = 0;
my $bg_color_tick = 1;
foreach $cat (sort @names) {
$cat_r = $subcat->{$cat};
if (($bg_color_tick/2) != int($bg_color_tick/2)) {
$output .= qq|<TR><TD BGCOLOR=grey>|;
} else {
$output .= qq|<TR><TD BGCOLOR=white>|;
}
# Get the URL and the Category name.
$category_url = $LINKS{build_root_url} . "/" . &build_clean_name ($cat_r->{Name}) . "/";
($cat_r->{Name} =~ m,.*/([^/]+)$,) ? ($category_name = $1) : ($category_name = $cat_r->{Name});
$cat_r->{Short_Name} = $category_name;
$cat_r->{URL} = $category_url;
# If you are using the three level new, uncomment the following to have Days_Old available in the
# template.
if ($cat_r->{'Has_New_Links'}) {
$cat_r->{'Days_Old'} = &Links:
BSQL::date_diff (&Links:
BSQL::get_date, $cat_r->{'Newest_Link'});
}
# We check to see if we are half way through, if so we stop this table cell ## get rid of this code! we aren't making columns
# and begin a new one (this lets us have category names in two columns).
## ($i and ($i % $breakpoint)) or ($output .= qq|</td><td class="catlist" valign="top">\n|);
## $i++;
defined $dynamic and &load_user ($dynamic, $cat_r,);
$output .= &load_template ('subcategory.html', {%$cat_r, %GLOBALS} , undef, $template);
##_## had to pass the %GLOBALS and %$cat_r as a hash to the routine
$output .= qq|</TD></TR>|; ## Close the element, and the row.
}
# Don't forget to close the table! Each element is one complete row, so only the table and 'div' needs closed.
$output .= "</table></div>\n";
return $output;
What that will do is alternate the colors as the links are iterated, but it will deactivate the code for multiple columns.
If you can't figure it out, maybe I can hack something, since I've done similar on my site to get the categories highlighted, and the descriptions inset.
You will probably have to tweak it, since the code has probably been changed for my site, but the 3 areas you have to look at are the three assignments to the "$output" variable, and what's going on.
Also, the fact that we are _not_ making columns, so that code is removed. I left it in as a place holder to get your bearings.
------------------
POSTCARDS.COM -- Everything Postcards on the Internet
www.postcards.com LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/