Gossamer Forum
Home : Products : DBMan : Customization :

Advanced & Simple Search

Quote Reply
Advanced & Simple Search
I am trying to add a 'simple' & 'advanced' search feature to DBMan. Simple will be for everyone and Advanced will be for Admin.

I am using the User-friendly html.pl 'mod'. A std copy of db.cgi.

In the html.pl file I use, html-imagesADV.pl, I have created the following sub routines;
sub html_search_options_adv - A copy of sub html_search_options
sub html_record_form_adv - A copy of sub html_record_form
sub html_view_search_adv - A copy of sub html_view_search

In the sub, sub html_footer, I added this;
print qq!| <A HREF="$db_script_link_url&view_search_adv=1">Adv. Search</A> ! if ($per_admin);

I can see the menu item 'Adv. Search' as appropriate but get this error;
Error: Unknown Action
The database program received a command that it did not understand.

What am I missing?

Here are links to my various files;
http://www.edward-ramos.net/...s/html-images.pl.txt
http://www.edward-ramos.net/...efaultimages.cfg.txt

At this point i'm just trying to get it to work with standard code, I will modify it after getting it past this.

Ed 8-)
Quote Reply
Re: [ewramos] Advanced & Simple Search In reply to
You need to put a line in db.cgi to tell the script where to go. Something like:

Code:
elsif ($in{'view_search_adv'}) { if ($per_admin) { &html_view_search_adv; } else { &html_unauth; } }

If you look at the beginning of db.cgi, you'll see a whole list of similar commands. Just put the above line in there somewhere.

If I understand you right, the new search subroutines are in a separate file. Be sure that you have the line

Code:
require $db_script_path . "/html-imagesADV.pl";

somewhere. Probably in your .cfg file, just after the other "require" command. Keep them tidy so you you can find them if you need to. :-)

Also, be absolutely positive that you have the exact name of the file. If you have anything off, you'll get an error when you try to run it.


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
Quote Reply
Re: [JPDeni] Advanced & Simple Search In reply to
Thanks for the pointer to db.cgi. I thought something needed to go in there just didn't know what to look fore.

I'll post as this progresses. Maby even a small 'mod' will come out of this... <GRIN>

Ed
Quote Reply
Re: [ewramos] Advanced & Simple Search In reply to
Very cool. It's always great to see someone else getting into it and trying out stuff. I'll be interested to see what you come up with. :-)


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.