Gossamer Forum
Home : Products : Links 2.0 : Customization :

Changing : to >

Quote Reply
Changing : to >
On my search results pages my Categories currently show as:

Music:SubCatMusic:SubSubCatMusic

How do I change this to:

Music>SubCatMusic>SubSubCatMusic

I know I have asked this before but the answer I got was not correct!

Sorry.


From Paul Wilson.
http://www.audio-grabber.com
Music Directory
Quote Reply
Re: Changing : to > In reply to
I assume this is for a linked title? In nph-build.cgi, look for the subroutine

sub build_linked_title

in the code string

$output .= qq| <A HREF="$build_root_url$path/">$dir</A> :|;

the colon before the | defines your seperator. You should be able to change this to what ever you want. If this is for an unlinked title, look for the equivalent string in

sub build_unlinked_title

Good luck

Ron Charest

http://rcmtravelsite.com

Quote Reply
Re: Changing : to > In reply to
Ive tried that but it does not seem to work - even after re-building the seperator is the same ( : )

This is my current code

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 = &build_clean(pop @dirs);

$output = qq| <A HREF="$build_root_url/">Top</A> > |;
foreach $dir (@dirs) {
$path .= "/$dir";
$dir = &build_clean ($dir);
$output .= qq| <A HREF="$build_root_url$path/">$dir</A> > |;
}
$output .= " $last";

return $output;
}

sub build_unlinked_title {
# --------------------------------------------------------
# Returns a string of the current category broken up by section.
# Useful for printing in the title.

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

@dirs = split (/\//, $input);

foreach $dir (@dirs) {
$dir = &build_clean ($dir);
$output .= " $dir > ";
}
chop ($output);
return $output;
}



From Paul Wilson.
http://www.audio-grabber.com
Music Directory
Quote Reply
Re: Changing : to > In reply to
OK I solved the problem..

The code I needed to change was in search.cgi


sub build_linked_title {
# --------------------------------------------------------
# A little different then the one found in nph-build.cgi as it also
# links up the last field as well.

my ($input) = shift;

my ($dir, $output, $path, $last);
foreach $dir ((split m!/!, $input)) {
$path .= "/$dir";
$dir = &build_clean ($dir);
$output .= qq|<A HREF="$build_root_url$path/">$dir</A> > |;
}
chop ($output);
return $output;
}


However this has presented me with a new problem!

The categories with sub-categories show up great...like...

Main Cat > Sub Cat

but Top Level Categories show up as....

Main Cat >

I don't want that trailing >

How can I get rid of it?

See it here....

http://www.audio-grabber.com/...search.cgi?query=mp3

From Paul Wilson.
http://www.audio-grabber.com
Music Directory
Quote Reply
Re: Changing : to > In reply to
Paul,

I'm afraid you're rapidly exceeding my grasp of Perl ;-((( Let me think about this, se if I can figure it out. I've already modded my categories listings with a different seperator, but never did anything with the seach results.

What mod are you using to get your display? It's completely different than mine.

Ron

http://rcmtravelsite.com

Quote Reply
Re: Changing : to > In reply to
The code above in red is what I am using to get...

Cat > SubCat > SubCat

...on my results pages

From Paul Wilson.
http://www.audio-grabber.com
Music Directory
Quote Reply
Re: Changing : to > In reply to
Paul,

The answer to the question " How do I get rid of the trailing >
" is to remove the space between the > and the |. Instead of doing this:

$output .= qq|<A HREF="$build_root_url$path/">$dir</A> > |;

do this

$output .= qq|<A HREF="$build_root_url$path/">$dir</A> >|;

I don't know why, but it works....Crazy

Technology is a wonderful thing

Ron

Quote Reply
Re: Changing : to > In reply to
It works 'cause chop only removes the last character of a string. Because there's a space there, it only removes the space, not the trailing >.

--Drew
Quote Reply
Re: Changing : to > In reply to
Thanks Drew

Ron

Quote Reply
Re: Changing : to > In reply to
Oh right -Thanks very much!

From Paul Wilson.
http://www.audio-grabber.com
Music Directory
Quote Reply
Re: Changing : to > In reply to
You'd be surprised how much Perl you can learn in less than 200 pages of a GOOD Perl tutorial, even with no prior programming experience.

--Drew
Quote Reply
Re: Changing : to > In reply to
Umm...oooooooo

I did what you said and look how my results showed up!

Categories:
General MP3 Information >MP3 Downloads General >MP3 Hardware >Burners >MP3 Hardware >Players >MP3 Hardware >Players >Car >MP3 Search Engines >MP3 Search Engines >Ftp >MP3 Search Engines >Http >MP3 Software >MP3 Software >Encoders >MP3 Software >Players >MP3 Software >Rippers >MP3 Software >Skins >

From Paul Wilson.
http://www.audio-grabber.com
Music Directory