Gossamer Forum
Home : Products : Links 2.0 : Customization :

Yet another question about yahoo subcategory

Quote Reply
Yet another question about yahoo subcategory
Hello

I have a problem about the yahoo subcategory mod by widgetz.
Look at my site to see the problem
http:// www.jmarzo.f2s.com/directory/

Here's the code I inserted to my site_html_templates.pl under sub site_html_print_cat.

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

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

# 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|;
}
$i++;

# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<b><font face="verdana" size="2"><a href="$url">$category_name</a></font></b> <i><font face="verdana" size="2">($numlinks)</font></i> |;
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|
|;
if ($#{$subcategories{$subcat}} >= 0 && $description =~ /^SUB.*/) {
$v = 0;
$sub_length = "";
$output .= qq|<font face="verdana" size="2">|;
foreach $subcatsub (sort @{$subcategories{$subcat}}) {
$suburl = "$build_root_url/" . &urlencode($subcatsub) . "/";
if ($subcatsub =~ m,.*/([^/]+)$,) { $subcategory_name = &build_clean($1); }
else { $subcategory_name = &build_clean($subcatsub); }

$sub_length .= qq|, | if ($description =~ /1$/ && $v ne "0");
$sub_length .= qq|$subcategory_name| if ($description =~ /1$/);

if ($description =~ /1$/ && length($sub_length) > $subcat_length) {
$output .= qq|...|;
last;
}
else {
$output .= qq|, | if ($description =~ /1$/ && $v ne "0");
$output .= qq|
| if ($description =~ /2$/ || $v eq "0");
$output .= qq| | if ($description =~ /2$/);
$output .= qq|<a href="$suburl">$subcategory_name</a>|;
$v++;
}
}
$output .= qq|</font>|;
}
else { $output .= qq|<dd><span class="descript">$description</span></dd>| if (!($description =~ /^[\s\n]*$/));
}
$output .= qq||;
}

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

1;

I don't know why my subcategories are like that. Please help, Thanks

Joey Marzo © 2000
JM-Online Directory
Quote Reply
Re: Yet another question about yahoo subcategory In reply to
Change the following codes:

Code:

$output .= qq||;


to the following:

Code:

$output .= qq|<BR>|;


Regards.

Eliot Lee
Quote Reply
Re: Yet another question about yahoo subcategory In reply to
Thanks Eliot.
I got the script working now. Thanks to you!! Hope you can help me again later Smile

Joey Marzo © 2000
JM-Online Directory
Quote Reply
Re: Yet another question about yahoo subcategory In reply to
You're welcome.

Regards,

Eliot Lee
Quote Reply
Re: Yet another question about yahoo subcategory In reply to
Another Question:

How can I make my category like this site:

http://www.magicdirectory.com

One more thing. I do not know how to change the font on my categories. Can you please tell me how to change it. Thanks

Help is very much appreciated. VJM

Joey Marzo © 2000
JM-Online Directory