Home Search User Profiles

Search User Profiles

Type your search keyword in the followong form and click on the “Search” button.

Search for keyword:

2.

$searchkeyword = $_POST[“searchkeyword”];

if ( $searchkeyword!=”” ) {

print “Hier die Liste aller User, bei denen in einem der Profilfelder der Suchbegriff ” . $suchbegriff .” vorkommt”;

$rid=5;

$header = array(
array(‘data’ => t(‘Username’), ‘field’ => ‘name’, ‘sort’ => ‘asc’),
array(‘data’ => t(‘Status’), ‘field’ => ‘status’),
array(‘data’ => t(‘Member for’), ‘field’ => ‘created’),
array(‘data’ => t(‘Last access’), ‘field’ => ‘access’),
array(‘data’ => t(‘Datenfeld’), ‘field’ => ‘p_feldname’),
array(‘data’ => t(‘Picture’), ‘field’ => ‘picture’)
);

$sql = “SELECT u.uid, u.name, u.status, u.created, u.access, u.picture, MAX(pf.name) p_feldname FROM users u INNER JOIN users_roles ur ON u.uid = ur.uid INNER JOIN ( profile_values pv INNER JOIN profile_fields pf ON pv.fid = pf.fid ) ON u.uid = pv.uid WHERE ur.rid=$rid AND pv.value LIKE ‘%”.$searchkeyword.”%’ GROUP BY 1,2,3,4,5″;
$sql_count = “SELECT COUNT(DISTINCT u.uid) row_count FROM users u INNER JOIN users_roles ur ON u.uid = ur.uid INNER JOIN ( profile_values pv INNER JOIN profile_fields pf ON pv.fid = pf.fid ) ON u.uid = pv.uid WHERE ur.rid=$rid AND pv.value LIKE ‘%”.$searchkeyword.”%'”;
$sql .= tablesort_sql($header);
$result = pager_query($sql, 20,0,$sql_count );

$status = array(t(‘blocked’), t(‘active’));
while ($account = db_fetch_object($result)) {
$rows[] = array(theme(‘username’, $account),
$status[$account->status],
format_interval(time() – $account->created),
$account->access ? t(‘%time ago’, array(‘%time’ => format_interval(time() – $account->access))) : t(‘never’),
$account->p_feldname,
theme_user_picture($account)
);
}

$output = theme(‘table’, $header, $rows);
$output .= theme(‘pager’, NULL, 10, 0);
print ($output);
}
?>

If yuo have some feedback/proposals/wishes concerning this page, please post a comment or contact the admin directly via e-mail.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get Drishtikone Updates
in your inbox

Subscribe to Drishtikone updates and get interesting stuff and updates to your email inbox.