Gossamer Forum
Home : Products : Links 2.0 : Customization :

Search_results mod?

Quote Reply
Search_results mod?
I'm trying to modify the search_results.html template as I would like to use the link.html template, to list all results.

Can you please refer me to any old post to help me in this, or suggest new?

Thanks!

Walter
Quote Reply
Re: [musictus] Search_results mod? In reply to
Not sure what you mean...

I'm guessing you want the search results to show only links, no categories? If that's what you want, search the forums using those terms (search results no categories) or similar. It's here somewhere, 'cause I read about it and now have mine set up that way (second one in my signature), but don't recall exactly what I did...

...I went looking, out of curiosity, and using those search terms will keep you reading awhile. But eventually I found this one:

http://www.gossamer-threads.com/...%20categories;#31822

then looked in my search.cgi, and sure enough, I did what the link above says to do. Hope this helps...


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Search_results mod? In reply to
Thanks for the reply, but it's not exactly what I need.

To print links in each "normal" category, I use a customized link.html template.

I would like to use the same link.html template to print each link found after a search.

I hope I've been more clear... English is not my main language...
Quote Reply
Re: [musictus] Search_results mod? In reply to
Okay then, look in your search.cgi for this:
Code:
# Go through each category of links returned, and build the HTML. Store in hash %link_output.
SETOFLINKS: foreach $setoflinks (sort keys %link_results) {
my $hits = ($#{$link_results{$setoflinks}} + 1) / ($#db_cols+1);
LINK: for ($i = 0; $i < $hits; $i++) {
$link_hits++;
if (($link_hits <= $highrange) && ($link_hits >= $lowrange)) {
%tmp = &array_to_hash ($i, @{$link_results{$setoflinks}});
$link_output{$setoflinks} .= &site_html_link (%tmp) . "\n";




GRRR... LOSING HALF OF POST...

Here it is again: Change &site_html_link in the above code to whatever you named the new sub in your site_html(_templates).pl.


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Dec 16, 2002, 10:11 AM
Quote Reply
Re: [PerlFlunkie] Search_results mod? In reply to
Thank you! I found a bug in the code I had previously modified!!

Happy holidays!
Walter Aresca
http://www.gratis.it