Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Need some help with the search.cgi

Quote Reply
Need some help with the search.cgi
Hi there.

I would like to change the - in the categories of the search results.
Take a look

from:
REISE-und-URLAUB LASTMINUTE
to
REISE & URLAUB LASTMINUTE

I also want to display the related categories as same as in
the main categories (Take a look).

THX for your help

Regards from Düsseldorf
Quote Reply
Re: [Jogi] Need some help with the search.cgi In reply to
Change your catagory names to use an underscore _ instead of a hyphen -. The underscore will automatically be removed, and will be replaced by a space. Note that when you change catgory names, you will have to edit all links in that category, and put them in the corrected category name. This is easy to do using the 'Check Cats' link on your admin page.

Not clear about your other question... Do you want them the same color, or what?

------
Oops, ignore that...

Just looked at your site again, and see that the problem is only with the search results. Are you using the nonenglish mod?


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Nov 12, 2004, 3:25 PM
Quote Reply
Re: [PerlFlunkie] Need some help with the search.cgi In reply to
THX for quick response (thumb upSmile),

I would like to display the related links right beside each other -
not listed with <li> - as same as the related categories in the
main categories.

Regards

Jogi
Quote Reply
Re: [Jogi] Need some help with the search.cgi In reply to
You would need to look in search.cgi for the code to change. LEt me know if you are using the nonenglish mod, I'll see what I can find. Gotta run now, can help later...


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Need some help with the search.cgi In reply to
Thx - first problem is fixed. CU
Quote Reply
Re: [Jogi] Need some help with the search.cgi In reply to
Here is the code where I have to change something:


foreach $category (@category_results) {
if ($nh == 1) {

$cat_clean = &build_clean($cat);
$linked_title = &build_linked_title_mb ($category);
$category_results .= qq|$linked_title\n|;
}
$cat_hits++;

I would like to display the main categories not the hole string.

Must be something like that:

$category_clean = &build_clean_category ($cat);

Quote Reply
Re: [Jogi] Need some help with the search.cgi In reply to
Try replacing the 'sub build_linked_title_mb' in the search.cgi with the one from nph-build.cgi, and comment out the line as shown (in red):


sub build_linked_title_mb {
# --------------------------------------------------------
# Returns a string of the current category broken up
# by section, with each part linked to the respective section.
my ($input) = $_[0];
my ($description) = $_[1];
my (@dirs, $dir, $output, $path, $last, @descs, $desc);
@dirs = split (/\//, $input);
@descs = split (/\\/, $description);
$last = pop (@dirs);
$last = pop (@descs);
$output = qq| <A HREF="$build_root_url/">Top</A> :|;
foreach $dir (@dirs) {
$path .= "/$dir";
$desc = shift (@descs);
$output .= qq| <A HREF="$build_root_url$path/">$desc</A> :|;
}
#$output .= " $last";
return $output;
}

This will remove the last category name, I think. What you are trying to change is the category list that is called in the template with this, right?

<ul><%category_results%></ul>


Leonard
aka PerlFlunkie