Gossamer Forum
Home : Products : DBMan : Customization :

Customizing "Sort By" drop-down boxes in search

Quote Reply
Customizing "Sort By" drop-down boxes in search
Hi everyone,

I'm working on a database that will have several fields that will contain confidential information collected from registered users. These fields need to be filled in by these registered users when they add a record, but then viewable only by the admin (and not by user searches). I've managed to customize the search results so that they don't display these fields. However, I can't figure out how to edit these same fields out of the "Sort by" drop-down box in the "View" form for searches.

Although it seems unlikely, I'm concerned that if someone set the "sort by" selection to one of the confidential fields and accurately guessed a user's name, the records for that user would appear (which is what happens when I test this hypothesis).

So how do I edit the drop-down list to exclude the fields I want hidden from searches? I'm sure there's a simple way to do this.

Any help on this matter would be greatly appreciated.

Rich

Quote Reply
Re: Customizing "Sort By" drop-down boxes in search In reply to
In your default.cfg file, change the 'form-length' value for each field you want hidden from the search to -1, if you want those same fields hidden from a keyword search change it to -2.

ie.
Code:
Field1 => [1, 'alpha', -2, 255,
Trev


Quote Reply
Re: Customizing "Sort By" drop-down boxes in search In reply to
Thanks!

That has eliminated those fields from the drop-down menu. But when I do a keyword search on a name from an unlisted field, it still returns a record. Any ideas?

Thanks again,

Rich

Quote Reply
Re: Customizing "Sort By" drop-down boxes in search In reply to
HI, I got this problem too!


Love you all,and thank fo rthis great forum.
Act.
Quote Reply
Re: Customizing "Sort By" drop-down boxes in search In reply to
Quoting a thread reference from the FAQ noted below under the section "Searching":

Keyword searches hidden fields

Question:
The keyword search searches ALL fields. How could I prevent it to search fields that I
want to keep hidden or non-searchable?

Response:
If you have set your "form-length" to -1 for these fields in your .cfg file, you could add a
line to sub query in db.cgi.

After code:

if ($i == $auth_user_field) { $i++; next; }

Add code:

if ($db_form_len{$column} == -1) { $i++; next; } ### hide hidden

If you wanted to have some fields that were searchable by admin only.
Set the form-length for those fields to -2 and add the following to sub query (just below
the code I listed above). code:

if (($db_form_len{$column} == -2) && (!$per_admin)) { $i++; next; } ### hide hidden

Hope this helps, if not you may want to view additional thread references for more options.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: [LoisC] Customizing "Sort By" drop-down boxes in search In reply to
Great little mod this...

Unfortunately it doesn't work with Boolean Mod B when using with penguinradio's additional Boolean "MOD cross-fields fix".

http://www.gossamer-threads.com/...i?post=112154#112154

http://www.gossamer-threads.com/...i?post=103875#103875)

This is because in penguinradio's mod, he searches across the entire line in the db file i.e.

@values = ($line);

instead of:

@values = &split_decode($line);

I am trying to think of a way around this. Any help greatly appreciated.

Brian