Gossamer Forum
Home : Products : Links 2.0 : Customization :

Line between category

Quote Reply
Line between category
this is my sub sit_html_print_cat section of my site_html_template.pl.

I have made the changes descripted in many posts in this forum but the result is no good.

In this moment I have this display:

Category Category

Category Category

Category Category


I want to display in this mod:

Category Category
Category Category
Category Category

Please Help me!

If this is not a problem foy you, modify for me the section.

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);
$columns = '2'; #number of columns
my ($half) = int (($#subcat+2) / $columns);

# Print Header.
$output = qq|<div class="margin"><table width="100%" border="0" cellspacing="0" cellpadding="0"></tr><td class="catlist" valign="top">\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 class="catlist" valign="top">\n|;

# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<dl><dt><font size="1" face="Arial"><a class="link" href="$url"><B>$category_name</B></a></font> <small class="numlinks">($numlinks)</small> |;

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|</dt>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</dl>|;

# Don't forget to end the unordered list..
$output .= "</td></tr></table></div>\n";
return $output;



Quote Reply
Re: Line between category In reply to
Looks to me like you HAVE not followed all the advice provided in this forum!

Delete all <dl><dt></dl></dt> codes in the sub!


Eliot Lee Wink
Quote Reply
Re: Line between category In reply to
Tanks for your help,

this is the result: http://www.melitonline.com/webdir/

I don't like this category list!

Please help me for 1 category for 1 line in 2 columns.

Thanks again!