$recipient is brought through a form. This is my code...
<?php
echo $recipient;
$r1 = get_user_by_username($recipient);
$r2 = $r1->getGUID();
?>
and my result is just...
Speedysnail6
it is supposed to display the user guid next to it. What did I do wrong?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
You wont be able to get user by their display name, its not unique. Ask them for their email and then use get_user_by_email()
@iionly solution is best, use dropdown list
@Mark How do you make the username show up everywhere so the display name becomes useless?
@iionly I have made a filter to give an error if the username is incorrect
The best solution would be dropdown box of friends showing display name with the values for each select containing the username. Or ask for email.
There are plugins to remove display name from registration form. I presume the value user enters for username is saved for username and display name in these plugins
Okay. Thanks
Could you point me to a plugin that hides the display name? I can't seem to find one.
I am using elgg 1.8
display name is indexed, but no api call for it exists; so
SELECT *FROM `tripmap_users_entity`
WHERE `name` = 'SppedySnail Dumkum Di DooDahh'
LIMIT 1;
will fetch user -- if only one exists
@dhrup
could you explain a little more what you mean?
The problem there is that display name is not unique in core - so you may not get the user you are expecting.
- Previous
- 1
- 2
- 3
- 4
- 5
- Next
You must log in to post replies.