By Norske on Wednesday, 23 December 2015
Replies 1
Likes 0
Views 827
Votes 0
Wondering what the best way to include a small avatar, name, and have both link to the user's profile? I am writing articles that reference ES members in them. Instead of just manually adding hyperlinked text I'd like to make it more engaging by adding the current avatar as well. Is there any kind of hidden code I can place in the article to automagically reference a user? For example:
[ES:user=JohnSmith]
Hello Norske,

I'm sorry but there is no simple way to do that. You need to load a Easysocial user to get those info.
Please use this:

$file = JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php';
include_once($file);

$id = 13; // change this to the user ID you want to load.
$user = ES::user($id);

$avatar = $user->getAvatar('medium');
$name = $user->getName();
$permalink = $user->getPermalink();


Hope this helps.
·
Wednesday, 23 December 2015 10:49
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post