Gossamer Forum
Home : Products : Links 2.0 : Customization :

Showing Search Query

Quote Reply
Showing Search Query
When links shows the results of a query, I would like to show the search query on that page, i.e. Your search for $query provided the following results. How do I print out $query?
Quote Reply
Re: Showing Search Query In reply to
For 1.11 (may work in 2b3, but I haven't tried):

in site_html.pl, in the global section, add:

$search_keywords=@search_terms;

Then in search results, you can simply do:

<font size=2 face=arial color="#000000">Found <strong>$cat_hits</strong> categories and <strong>$link_hits</strong> sites for <strong>@search_terms</strong></font>





------------------
You can reach my by ICQ at UID# 8602162

Quote Reply
Re: Showing Search Query In reply to
Another simply way is just add $in{'query'} into your site_html.pl:

You search for $in{'query'} returns....

It works for 1.1 and beta3.

But how do i show the search query in the text box?
Quote Reply
Re: Showing Search Query In reply to
Rock,

I assume you are referring to the Search Again? form that appears when a search fails. If so, go to site_html.pl, find the sub site_html_search_failure routine. Change the following line:

Quote:
<p>Search Again? <input type=text size=15 name="query"> <input type=submit value="Search!"><br>

to read:

Quote:
<p>Search Again? <input type=text size=15 name="query" value="$in{'query'}"> <input type=submit value="Search!"><br>

I think that should work. Let me know.


------------------
Bob Connors
bobsie@orphanage.com
www.orphanage.com/goodstuff/
goodstufflists.home.ml.org/


Quote Reply
Re: Showing Search Query In reply to
Thanks Bobsie but i have tried this and failed. It only returns a single word no matter how many words your search term is.

Any other suggestion?
Quote Reply
Re: Showing Search Query In reply to
Rock,

I don't know what to tell you. It works on my site perfectly fine. Try it for yourself. Go to www.orphanage.com/cgi-bin/goodstuff/search.cgi and do a search for "rapture thingy whocares" (less the quotation marks).

It will return:

Quote:
Your search for
"rapture thingy whocares"
resulted in:
Error: no matching records

Search Again? rapture thingy whocares
More Options



------------------
Bob Connors
bobsie@orphanage.com
www.orphanage.com/goodstuff/
goodstufflists.home.ml.org/




[This message has been edited by Bobsie (edited January 05, 1999).]

[This message has been edited by Bobsie (edited February 11, 1999).]