Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Possible Bug in sub build_linked_title???

Quote Reply
Possible Bug in sub build_linked_title???
Hi:

It seems I am getting really weird links in the linked title for sub-sub directories, for instance:

home links to home- fine

home:cat1 links to home:cat1- fine!

But!!!!

home:cat1:cat2 links to Home:cat1:cat1:cat2

I hope that makes sense... basically, it is repeating the category twice in the link...

As I have not modded sub build_linked_title, I thought I would see if anyone else had this problem....

Dave



[This message has been edited by carfac (edited November 28, 1999).]
Quote Reply
Re: Possible Bug in sub build_linked_title??? In reply to
can you show me the output.. i don't really understand your example.. as you have 3 on one side and then 4 on the other.

jerry
Quote Reply
Re: Possible Bug in sub build_linked_title??? In reply to
Where do you see this? On search results, category pages, what's new/what's cool, etc?

Cheers,

Alex
Quote Reply
Re: Possible Bug in sub build_linked_title??? In reply to
Hi!

Widgetz- that was my point! 3 on one side, 4 on the other!

Please link to:

http://www.bcdb.com/bcdb/page.cgi?g=Hanna-Barbera%2FD_to_F%2FFlintstones%2F&d=1

and notice the linked_title is:

BCDB > Hanna-Barbera > D to F > Flintstones

OK, hover over BCDB- fine link. Hover over Hanna-Barbera- again, a fine link.

But hover over D to F, and you will see it will link to:

http://www.bcdb.com/bcdb/page.cgi?g=Hanna-Barbera%2FHanna-Barbera%2FD_to_F%2F&d=1

and there should only be ONE Hanna-Barbera in the link- it is repeating cat1 twice...

Hope the link helps. I can post the build_linked_title if you need, too....

Thanks!

Dave
Quote Reply
Re: Possible Bug in sub build_linked_title??? In reply to
This was indeed a bug. Replace build_linked_title with:

Quote:
sub build_linked_title {
# --------------------------------------------------------
# Returns a string of the current category broken up
# by section, with each part linked to the respective section.

my $input = shift;
my (@dirs, $dir, $output, $path, $last);

@dirs = split (/\//, $input);
$last = pop @dirs;
$output = qq| <A HREF="$LINKS{build_root_url}/">Top</A> :|;
for (0 .. $#dirs) {
$path = "/" . &build_clean_name( join "/", @dirs[0 .. $_] );
$output .= qq| <A HREF="$LINKS{build_root_url}$path/">$dirs[$_]</A> :|;
}
$output .= " $last";
return $output;
}

and search_build_linked_title in search.cgi with:

Quote:
sub search_build_linked_title {
# --------------------------------------------------------
# Returns a string of the current category broken up
# by section, with each part linked to the respective section.
#
my $input = shift;
my (@dirs, $dir, $output, $path);

@dirs = split (/\//, $input);
$output = qq| <A HREF="$LINKS{build_root_url}/">Top</A> :|;
for (0 .. $#dirs) {
$path = "/" . &build_clean_name( join "/", @dirs[0 .. $_] );
$output .= qq| <A HREF="$LINKS{build_root_url}$path/">$dirs[$_]</A> :|;
}
chop $output;
return $output;
}

Thanks!

Alex
Quote Reply
Re: Possible Bug in sub build_linked_title??? In reply to
hehe.. that period..

i've been looking at that line since the Directory field for categories was made and I knew the way you changed it had something wrong.. but i never had enough subcategories Smile

jerry