By Spartan on Wednesday, 11 January 2017
Posted in General Issues
Likes 0
Views 187
Votes 0
Not quite sure if this is the correct place to post this, but here it is anyhow, and thanks for any input!

I have a standard Joomla! article (not K2, not anything else) that displays a list of team members, with a photo. What I would like to do is pull the user's avatar from EasySocial. After looking at the documentation, I'm a bit confused as how to implement this.

Any suggestions or starting points would be quite helpful!
I think you can use following block of code to get Easysocial user avatar image :

require_once(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/easysocial.php');

// Regarding this $userid you have to get your user id which populate on your "Our team" page.
$my = ES::user($userid);
$avatar = $my->getAvatar();


Documentation here : https://stackideas.com/docs/easysocial/developers/users/retrieving-user-avatar
·
Wednesday, 11 January 2017 12:42
·
0 Likes
·
0 Votes
·
0 Comments
·
What about others with an account? So since it's a standard Joomla article, I need to add that code to a template override for com_content?
·
Thursday, 12 January 2017 03:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hm, unfortunately that was not possible to use my suggested php code above to populate the Easysocial user avatar image if this "our team" is Joomla article page generated these content, because those content is not generated from your php file.

I believe the quickly way to do this you have to find those user avatar image URL then insert into your article page, that was no other easy way to achieve this if those content generated from Joomla article.
·
Thursday, 12 January 2017 10:43
·
0 Likes
·
0 Votes
·
0 Comments
·

<?php
require_once(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/easysocial.php');
// Regarding this $userid you have to get your user id which populate on your "Our team" page.
$my = ES::user($userid);
$avatar = $my->getAvatar();
?>


<div class="col-sm-6 col-md-3">
<div class="thumbnail"><img class="img-circle" src="<?php public function getAvatar($avatarSize = SOCIAL_AVATAR_MEDIUM); ?>" />
<div class="caption">
<h3>User Name Here</h3>
</div>


What am I missing here, and where would I supply the userid for the individual?
·
Sunday, 15 January 2017 07:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey there,

I am really sorry for the delay of this reply as it is a weekend for us here.

If you would like to load the hard-coded user id from this method -> $my = ES::user();

You have to put your user id directly on this method -> $my = ES::user(206); (e.g. my user id is 206)

And I have attached a sample code to how it populate user avatar image and his name, you can refer my attached file below.
·
Sunday, 15 January 2017 10:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Ah, ok now that makes sense - and thanks for replying on a weekend! I didnt expect one so soon!

Now, what about multiple users on the same page? Would I simply add a variable for each and specifically state the user id's for each person?
·
Sunday, 15 January 2017 10:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Actually there got a few way to do this like load the php foreach, so it can load all the existing user from your site then populate which user object on the page, since I do not know what you trying to achieve here, you can try download my attached file so you can hard-coded that user id inside the Easysocial user library.

Hope this will help.
·
Sunday, 15 January 2017 12:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Dude, this is absolutely perfect - thank you!
·
Sunday, 15 January 2017 12:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

You are most welcome. Glad to hear that your issue has been resolved now.

As a gentle reminder, kindly start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiry. I will lock and mark this thread as resolved.
·
Sunday, 15 January 2017 12:44
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post