Hello,
Could someone explain to me how to retrieve user information, such as are name, icon, ... on a page that displays an entities knowing that I can display the owner_guid, but when I go owner_name I have nothing ...
My PHP Code
<?php
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.
$owner_user = get_entity($vars['entity']->owner_guid);
echo $owner_user->metadata_name;
Thanks Team Webgalli,
$owner_user = get_entity($vars['entity']->owner_guid);
echo $owner_user->metadata_name; doesn't work in my case
but that works :
echo $owner_info->name;
metadata_name can be any thing like username, name, email, password, gender.....
I just need different information from the profile manager plugin, and I can not display them.
I follow the syntax you gave me, but it does not work in my case, only the one I mentioned works.
So, how to find information stored with profile manager to another page of that profile?
Thanks again.
the metadata name should be same as that of profile manager field names
I use "address" in profile manager
i write
$owner_user = get_entity($vars['entity']->owner_guid);
$owner_user->metadata_address;
and it display nothing ...
$owner_user->address;
Doesn't work :(
Just work for, name, username, email ... all stored in elgg_users_entity
$owner_user->name;
$owner_user->username;
$owner_user->email;
In that case the metadata_name you are trying is wrong. Also make sure that the user you are trying to expose have a value for that metadata and you have access to it.
Ok so, i check, the metadata name and it was good, i make test with some user, so, i logout and login with admin account to make other test,
$owner_user->metadata_address; doesn't work
but
$owner_user->address; !
So i think i have got a problem with restrict access to this information.
Thanks for your time Webgalli ;)
- Previous
- 1
- 2
- Next
You must log in to post replies.