Simplifying search criteria - no preference option

15 years 8 months ago #68189 by tomrgg
Hi all - would really appreciate any help.

In the user list search function, the members have to choose a range of search criteria such as "no preference", "is exactly" etc.

Is there a way of restricting this choice? I really don't want the members to have to choose an option, I would like to pre-specify it.

Your help would be much appreciated.

Tom

Please Log in to join the conversation.

15 years 8 months ago #68236 by achintya
Hi

Yes, I really love the new 'search' modality in this version of CB, but first reactions to the 'search criteria' by ordinary users (who have no idea what boolean searches are) is shock/horror... they won't use the search drop down lists.

For someone who understands the search logic, these options are excellent and very useful, for someone who is just casually browsing the lists and wants to do a 'plain open text search' the drop down boxes and options are a nightmare to use.

So, yes, is there any way of not having drop down boxes but just present the options on screen to search by when a list is shown? ie, if someone wants to search by name, there is a 'search name' title and the text box already on screen to type in the name being searched for, no need for 'exactly' 'not exactly' etc etc.


achintya

Please Log in to join the conversation.

15 years 8 months ago #68243 by achintya
hi

me again. I just searched in the default_language.php file and found all the terms. I am now searching in the Administer/com_profiler directories and subdirectories to see where all these terms are used in the code.

It may be possible to save a backup copy of any files, then see if it is possible to easily remove these options without causing massive havoc in the coding (which I suspect would happen!).

Otherwise there is someone I worked with a few years ago who invented an early Advanced Search component for CB and he may be interested in being paid an amount to rewrite the core code so that we get what we are looking for?

What are your thoughts on this?


achintya

Please Log in to join the conversation.

15 years 8 months ago #68247 by achintya
Hi

If you look in administrator/comp_comprofiler/plugin.class.php and do a search for the term: UE_MATCH_IS_EXACTLY you will find all the Arrays that are used to give people search options.

I successfully deleted all of the code:

$choices = array( 'is' => _UE_MATCH_IS_EXACTLY,

'phrase' => _UE_MATCH_PHRASE,

'all' => _UE_MATCH_ALL,

'any' => _UE_MATCH_ANY,

'-' => _UE_MATCH_EXCLUSIONS . ':',

'isnot' => _UE_MATCH_IS_EXACTLY_NOT,

'phrasenot' => _UE_MATCH_PHRASE_NOT,

'allnot' => _UE_MATCH_ALL_NOT,

'anynot' => _UE_MATCH_ANY_NOT

);

and deleted all the array items I didn't want so it resembles just this:

$choices = array( 'is' => _UE_MATCH_IS_EXACTLY,


);

I uploaded this modified plugin.class.php file to replace the file on the server, and now I just seeing one option in the drop down list.

I performed a search and, so far, this does not seem to have damaged functionality.

So I guess you could work through (VERY CAREFULLY!) the other arrays (taking great care to not remove or change any of the surround code?

IMPORTANT: BUT DO BACKUP YOUR ORIGINAL plug.class.php file in case you find something falling over.

This change worked for me, but I cannot guarantee it will work for you, and you do this entirely at your own risk. Should be ok if you proceed one small step at a time. Suggest you don't try to change all the Arrays at the same time!

I am still keen to see if it may be possible to just remove the drop down boxes altogether and just have the appropriate lists and text areas permanantly on screen for that list.

Best of luck


achintya

Please Log in to join the conversation.

15 years 8 months ago #68275 by achintya
OK - just changed all the array codes and they seem to work fine when cut back to just 'one' option.

This is my code which seems to work (use at your own risk and make sure you backup your plugin.class.php file before changing)

You will notice that I have used the 'phrase' array item for multiple choice. There seems to be a problem with the provided array lines and phrase is commented out as an option. This is the only way I could make multiple chosen items choosable in the search operation.


achintya

from line approx 2598


switch ( $type ) {

case 'text':

$choices = array( 'phrase' => _UE_MATCH_PHRASE,


);

break;

case 'singlechoice':

$choices = array( 'is' => _UE_MATCH_IS,


);

break;

case 'multiplechoice':

$choices = array( 'phrase' => _UE_MATCH_PHRASE,


);

break;

case 'isisnot':

$choices = array( 'is' => _UE_MATCH_IS,

'-' => _UE_MATCH_EXCLUSIONS . ':',

'isnot' => _UE_MATCH_IS_NOT

);

Post edited by: achintya, at: 2008/07/14 09:14

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.189 seconds

Facebook Twitter LinkedIn