Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By stretchwickster on
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
Solved
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:
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: