Forums | Mahara Community
Support
/
How to allow group administrator to see username in the potential member list
03 July 2017, 16:03
Hi Cecilia,
Many thanks for your reply. I was on holidays, sorry for the late response.
Yes, the 'Never display usernames' is set to 'No'. But we still cannot see the usernames.
Cheers,
Lina
10 July 2017, 15:35
Hello Lina,
Checking the 'display_name' function again, and for what you said about the settings, the preferredname value for each user is not empty.
In the piece of code that decides whether to add the username or not:
if (empty($user->preferredname)) {
$firstlast = full_name($user);
if ($addusername) {
return $firstlast . ' (' . display_username($user) . ')';
}
return $firstlast;
}
else if ($user->id == $userto->id) {
// If viewing our own name, show it how we like it
return $user->preferredname;
}
we see that the line that adds the username won't be reached if the user has set a preferredname. This preferred name can be changed in Content->Profile->About me by changing the 'Display name' field.
If this is the case, then you can modify this code to force it to show the username next to the preferredname or not to ask for the preferredname in the first place.
I hope this helps and you can finally see the usernames.
Cheers,
Cecilia
12 July 2017, 21:21
Hi Cecilia,
Thanks a lot. It works! I changed the code to :
if ($user->id == $userto->id) {
// If viewing our own name, show it how we like it
return $user->preferredname;
}
We can see the username now.
I really really appreciate your kind help.
Thank you very much.
Best wishes,
Lina
- «Previous page
- 1
- 2
- »Next page