user search block

globalplayer - March 13, 2007 - 22:07

Is it possible to create block to search users? For example, users have text fields like "first name", "last name" in their profiles made with profile.module and I want to have a block where I could write user last name and then search if there is any on my website with this last name, is it possible to create something like this on drupal5?

i need a block

globalplayer - March 14, 2007 - 12:04

I have seen all those modules but they don't provide a search block , i need a block which which could be displayed on any page on left/right sidebar, on this block should be text area for user first/last name and list selection for gender, if there is any module which can do this?

Search already provide a

tostinni - March 14, 2007 - 16:05

Search already provide a block, so you can inspire yourself from it to put it in a module and instead of searching for node, you can make it searching for profiles...
But currently I'm not aware of any module doing exactly what you need.

Custom php block

geodaniel - July 27, 2007 - 15:45

You could try a custom php block something like this:

<?php
 
// based on search_box() function...

 
$form_id = 'search_form';

 
// Use search_keys instead of keys to avoid ID conflicts with the search block.
 
$form['keys'] = array(
   
'#type' => 'textfield',
   
'#size' => 15,
   
'#default_value' => '',
   
'#attributes' => array('title' => t('Enter the terms you wish to search for.')),
  );
 
$form['submit'] = array('#type' => 'submit', '#value' => t('Search'));
 
// Always go to the search page since the search form is not guaranteed to be
  // on every page.
 
$form['#action'] = url('search/profile');

  return
drupal_get_form($form_id, $form);
?>

 
 

Drupal is a registered trademark of Dries Buytaert.