$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.
The second echo will write the guid.
oh.... I can't belive I missed that. Thank you
Yeah, sometimes it happens ;)
Also, is there something like get_user_by_username($recipient); but for display name?
I don't think so, you can do get_user_by_username($recipient)->name or $r1->name.
I enter a display name that is real it doesn't work
if ($r1->name) {
system_message(elgg_echo('displayname:exists'));
}
Hmm.. I don't know, this should work if user have a name.
hmm... it is in an action and for some reason it is forwarding even though it doesn't say to forward anywhere.
it turns out that it was forwarding because there was no text on the action
this is my code
$r1 = get_user_by_username($recipient);
$ra1 = get_user_by_username($recipient)->name;
if ($recipient->name) {
echo "hi";
}
echo $recipient;
?>
- Previous
- 1
- 2
- 3
- 4
- 5
- Next
You must log in to post replies.