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

Re: removing category names from search results

Quote Reply
Re: removing category names from search results In reply to
This is one that I keep changing, and then having to re-do. I've removed them from my NEW and COOL pages, but here is the clue for doing it with search.

I can't guarantee my search has not already been modified, so the lines may not be _exactly_ like yours, but the idea is what's important.

Code:
# Build the list of link results.
if ($link_hits) {
my (%link_results, %displayed, $name);
foreach my $hit (@$link_hits) {
$hit = $linkdb->array_to_hash ($hit);
$link_results{$hit->{CategoryID}} .= &site_html_link ($hit, $dynamic);
}
foreach my $hit (@$link_hits) {
next if ($displayed{$hit->{CategoryID}}++);
$name = &get_category_name ($hit->{CategoryID});
$link_results .= "<p>" . &search_build_linked_title ($name) . "</p>";
$link_results .= $link_results{$hit->{CategoryID}};
}
}

replace it with:

Code:
# Build the list of link results.
if ($link_hits) {
my (%link_results, %displayed, $name);
foreach my $hit (@$link_hits) {
$hit = $linkdb->array_to_hash ($hit);
$link_results .= &site_html_link ($hit, $dynamic);
}
# foreach my $hit (@$link_hits) {
# next if ($displayed{$hit->{CategoryID}}++);
# $name = &get_category_name ($hit->{CategoryID});
# $link_results .= "<p>" . &search_build_linked_title ($name) . "</p>";
# $link_results .= $link_results{$hit->{CategoryID}};
# }
}

It works on my test site.



------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/








Subject Author Views Date
Thread removing category names from search results Robert_B 22676 Apr 16, 2000, 12:42 PM
Post Re: removing category names from search results
pugdog 22427 Apr 16, 2000, 7:56 PM
Post Re: removing category names from search results
Robert_B 22387 Apr 17, 2000, 3:09 AM
Thread Re: removing category names from search results
pugdog 22382 Apr 17, 2000, 8:18 AM
Thread Re: removing category names from search results
jwm 22349 Jul 12, 2000, 5:40 PM
Thread Re: removing category names from search results
pugdog 22391 Jul 12, 2000, 7:39 PM
Post Re: removing category names from search results
jwm 22338 Jul 13, 2000, 9:45 AM
Thread Re: removing category names from search results
jeffb 22326 Jul 25, 2000, 8:26 AM
Thread Re: removing category names from search results
pugdog 22326 Jul 25, 2000, 10:12 AM
Thread Re: removing category names from search results
jeffb 22325 Jul 25, 2000, 12:52 PM
Thread Re: removing category names from search results
Stealth 22319 Jul 25, 2000, 1:09 PM
Thread Re: removing category names from search results
jeffb 22320 Jul 25, 2000, 3:14 PM
Thread Re: removing category names from search results
Stealth 22291 Jul 25, 2000, 3:48 PM
Thread Re: removing category names from search results
jeffb 22291 Jul 25, 2000, 4:11 PM
Thread Re: removing category names from search results
pugdog 22375 Jul 25, 2000, 6:29 PM
Thread Re: removing category names from search results
jeffb 22308 Jul 26, 2000, 1:32 AM
Thread Re: removing category names from search results
pugdog 22293 Jul 26, 2000, 9:45 PM
Thread Re: [pugdog] removing category names from search results
rgbworld 21967 Apr 30, 2006, 5:54 PM
Post Re: [rgbworld] removing category names from search results
phuketkit 21782 Jul 18, 2006, 3:15 AM