Drupal 4.6.5

Hi there,

How do I hide the "operator" drop-down boxes that contain AND, OR and NOT from the user_search module's form?

I've tried commenting out the form_select line which creates these "operator" drop-down boxes but this causes a SQL error.

Does anyone know how I can achieve this?

Your help would be much appreciated.

Comments

stretchwickster’s picture

I came up with a solution for hiding the AND-OR-NOT operator drop-down. The following will step you through the process:

1) Go to the user_search.module file.

2) Find the following line (and make sure you are in the theme_user_search_advanced function):
$categories[$field->category] .= form_select('', 'operators][' . $field_id, check_plain($default_operator), array('AND' => t('AND'), 'OR' => t('OR'), 'NOT' => t('NOT')));

3) Surround the above line with the following lines, one above and one below:

$categories[$field->category] .= '<div id="hide-operator">';
$categories[$field->category] .= '</div>';

This will basically wrap it in a div which we can refer to in our css file.

4) In the style.css file that is part of your theme add the following code to hide the "hide-operator" div:

/* used in user advanced search form */
#hide-operator {
  display: none;
}