Gossamer Forum
Home : Products : DBMan : Customization :

No Blank Search Results

Quote Reply
No Blank Search Results
I was wondering if you can have DBMan return
a search string based on words searched if no record has the keywords in them.

Example: I search for Ford 1958 hub cap
and no of the databases have that in them.
DBman takes you to a search page can I have it search a url and add the keywords. Like search yahoo,excites, or any other search engine for keywords they selected.

Thanks

Evan
Quote Reply
Re: No Blank Search Results In reply to
Yes, you can have DBMan redirect to an external search engine. But I'd need to have the syntax for the external search engine before I could give you the code.

What would help is if you would do a search on each of the search engines you're looking to use and copy the full URL from the first page of the search. That will help me to figure out what you need to do.

Would your users be searching by keyword only or on multiple database fields?

------------------
JPD





Quote Reply
Re: No Blank Search Results In reply to
First, you need to add the following subroutine to db.cgi:

Code:
sub urlencode {
# --------------------------------------------------------
# Escapes a string to make it suitable for printing as a URL.
#
my($toencode) = shift;
$toencode =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
return $toencode;
}

Then add the following to sub html_view_failure:

Code:
$in{'keyword'} = &urlencode($in{'keyword'});
print qq|
<a href="http://search.yahoo.com/bin/search?p=$in{'keyword'}/Keywords">Yahoo</a>|;


------------------
JPD







[This message has been edited by JPDeni (edited August 06, 1999).]
Quote Reply
Re: No Blank Search Results In reply to
I need to take the keyword/Keywords from the html search box from a page I created for users to search the databases. I need to show search engine links with the keyword/keywords on the results page.

If the keyword/keywords are found in the data base I need to show a link with example below

Example

http://search.yahoo.com/bin/search?p=Keyword/Keywords

If the databases don't have the keywords I need DBMAN to show them a link like the above example.

Quote Reply
Re: No Blank Search Results In reply to
JPDeni,

I have search string for about,hmmm...
thirty or more search engines. If you would like them to assist compu_tel, let me know.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: No Blank Search Results In reply to
I guess the best thing would be to let him tell us which ones he wants. Comput-tel?


------------------
JPD





Quote Reply
Re: No Blank Search Results In reply to
Thanks

I got it to work

[This message has been edited by compu_tel (edited August 08, 1999).]