Gossamer Forum
Home : Products : DBMan : Customization :

Custom Searching

Quote Reply
Custom Searching
I have quite an extensive database or movie reviews that I'm working on with 44 fields. The search option that is standard with this script doesn't work that well with so many fields. All I need is for when someone wants to search, they are presented with a search box that searches all fields of all records and then all that is displayed for a search result is the title of the film with a link to the individual record.

Is it possible to modify the script to have someone search this way and then a certain number (10 would be best) of titles are displayed all linking to their respective review in the database? It sounds like the "Short and long display of records" modification in the Resource section would work, but I'm having problems using this because I'm using the 'friendly' html.pl rather than the standard html.pl. If there is an easy way to implement this search, please let me know, if not, any help would be appreciated.

Thanks,
Blake Kunisch
blake@outermost.net
www.outermost.net
ICQ: 7703534

My html.pl:
http://www.outermost.net/html_pl.txt

[This message has been edited by blakex (edited July 28, 1999).]
Quote Reply
Re: Custom Searching In reply to
The easiest way for you to implement this is to include the "keyword" search field in your search form. This is the form that is below the other field search fields. This keyword search does search through ALL fields.

Then you could use the short and long view mod to show the results in whatever fashion you want.

To set the number of hits per page, set $db_max_hits to 10 in the default.cfg file.

Hope this helps.

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: Custom Searching In reply to
Hello Blakex,

I have done what you are trying to do if I am understanding your question correctly.

What I did is create additional html_record_form subroutines named:

html_record_form_add
html_record_form_modify

You can make copies the original html_record_form and rename them to the above names. The reason I have separate add and modify forms is because I use double select fields in my add record form that don't work for the modify record subroutine. As long as you don't double entry fields you can get away with only creating one additional subroutine.

I then modified the original html_record_form to display only what you want the visitors to see. Here is an example:

http://www.makeitsimple.com/...lt&view_search=1

You need to change the add and modify subroutines to call the new subroutines.

This is the new call in my add record sub
&html_record_form_add(&get_defaults);

This is the new call in my modify record sub
&html_record_form_modify (%rec);

This is just a quick example there are more things that need to be changed but lets first see if you are up to this mod before I get carried away.


------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com



[This message has been edited by NgtCrwlr (edited July 28, 1999).]
Quote Reply
Re: Custom Searching In reply to
One note on the short/long display. Use the html.pl file you can pick up at http://www.jpdeni.com/dbman/short.txt

It's set up the same as the "user-friendly" html.pl file, but includes the short/long display modification.


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





Quote Reply
Re: Custom Searching In reply to
JPDeni - the script you provided works perfectly for the searching function. My problem is now when someone searches, they are bombarded with all 44 of the fields. How do I eliminate these fields and only have 1 for them to search through all fields of the record? Eliot mentioned a "keyword" search, but I'm not sure how to implement that.

Also, when the results are displayed, and the user clicks on one, at the top of the result is says: "Previous, Next, Back to Record List, and Record x of x." How do I move this to the bottom of the record?

That's about it for now - thanks to everyone who has helped me through customizing this database to be exactly what I need.
-Blake Kunisch
blake@outermost.net
ICQ: 7703534

[This message has been edited by blakex (edited July 29, 1999).]
Quote Reply
Re: Custom Searching In reply to
If you just want to have a keyword search on your search form, go to sub html_view_search and delete the line

&html_record_form();

To move the "Previous, Next, etc" links to the bottom of the record, just move

Code:
# print out the links
print qq|
<table width=100%>
<tr><td width=50%>$previous</td>
<td width=50% align=right>$next</td></tr>
<tr><td colspan=2 align=center>$list</td></tr>
<tr><td colspan=2 align=center><$font>Record $nh of $db_total_hits</font></table>
|;

to after

Code:
</TABLE>
|;
# <-- End of record display -->


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