Gossamer Forum
Home : Products : Links 2.0 : Customization :

Yahoo style subcategories (@) (new thread)

Quote Reply
Yahoo style subcategories (@) (new thread)
This is a continuation of the previous thread http://www.gossamer-threads.com/...um3/HTML/003110.html

Jerry or Anyone,

I'm still not getting the expected results from the Yahoo@ 'jump category' mod.

Instead of the expected Cat Name@, I get the actual reference to the category; e.g.;

Category Name = Manufacturers/Heavy_Trucks@
Category Desc = Heavy_Trucks/Manufacturers

What I get in the sub-categories of 'Manufacturers' is category listing for Manufacturers linked to the following URL /aw/Heavy_Trucks/Manufacturers

The basics work as it does add the correct 'jump to' URL, but I would like the sub-category name to read Heavy Trucks@, i.e. the last part of the category name.

I'm really keen to get this one working as its really foxing me Smile

Here's a section from my site_html.pl file:

Quote:
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~<br><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">\n~;

foreach $subcat (sort @subcat) {
if ($subcat =~ m,.*/([^/]+)$,) { $category_name = &build_clean($1); } else { $category_name = &build_clean($subcat); }
if ($subcat =~ /\@$/) { ($subcat) = @{$category{$subcat}}[2]; }
($description) = @{$category{$subcat}}[2];
$url = "$build_root_url/" . &urlencode($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~</table></td><td valign="top" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">\n~;
}
$i++;


# Then we print out the name linked, new if it's new, and popular if its popular.

$output .= qq~<tr><td valign="top" align="left"><B>&#183; </B><FONT SIZE=2 COLOR="#000000" FACE="VERDANA,ARIAL,TOHAMA"><strong><a href="$url">$description</a></strong> <small>($numlinks)</small> ~;
$output .= qq~<IMG SRC="http://www.qango.com/aw/img/new.gif" border=0><FONT SIZE=2 COLOR="#000000" FACE="VERDANA,ARIAL,TOHAMA">~ if (&days_old($mod) < $db_new_cutoff);
$output .= qq~</td></tr>~;
}

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

I'd really appreciate any assistance with this one!


All the best
Shaun

------------------
Shaun Hague
Webmaster - Qango.com
http://www.qango.com/central/