4
Thanks Ghia for the reply.. I currently in the process of developing website for my batch. It is a closed-community website. Here is the code in search.php:-
//Sort information
foreach (array_keys($users) as $k) {
$userarray = array();
$userarray["output"][] = "<a href='userinfo.php?uid=" . $users[$k]->getVar('uid') . "'>" . $users[$k]->getVar('uname') . "</a>";
$userarray["output"][] = ( $users[$k]->getVar('user_viewemail') == 1 || $GLOBALS['xoopsUser']->isAdmin() ) ? $users[$k]->getVar('email') : "";
foreach (array_keys($fields) as $i) {
if (in_array($fields[$i]->getVar('field_id'), $searchable_fields) && in_array($fields[$i]->getVar('field_type'), $searchable_types) && in_array($fields[$i]->getVar('field_name'), $searchvars)) {
$userarray["output"][] = $fields[$i]->getOutputValue($users[$k], $profiles[$k]);
}
}
$GLOBALS['xoopsTpl']->append('users', $userarray);
unset($userarray);
First I make a new field named 'name' in the database. Then I changed the above code to:-
//Sort information
foreach (array_keys($users) as $k) {
$userarray = array();
$userarray["output"][] = "<a href='userinfo.php?uid=" . $users[$k]->getVar('uid') . "'>" . $users[$k]->getVar('name') . "</a>";
$userarray["output"][] = ( $users[$k]->getVar('user_viewemail') == 1 || $GLOBALS['xoopsUser']->isAdmin() ) ? $users[$k]->getVar('email') : "";
What do you mean by creating a temporary user object? Can you please explain.. Sorry I'm a newbie.. thanks a lot.