By Mel on Wednesday, 28 November 2018
Posted in General
Replies 4
Likes 0
Views 466
Votes 0
Hi,

I want to add a link to a users easysocial profile with their avatar link in a different component. At the moment I can display the link to their user profile name but it is just the text. How do I change my code to include their avatar too? Here is the code I am currently using:

<a href="<?php echo $ESuser->getPermalink();?>"><?php echo $ESuser->name;?>

Any help would be most appreciated.

Kind regards

Mel
Hi Mel,

Perhaps you can try as below:
[gist type="php"]
$ESuser->getPermalink();
$ESuser->getAvatar();
[/gist]
·
Wednesday, 28 November 2018 18:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Muhammad,

thank you for replying. When I paste that into my php file it shows the text and not the output. Basically I just want to display the avatar and username as a link like they display for example in the friend search (see attached image)
Mel
·
Wednesday, 28 November 2018 19:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Ops sorry mel

for avatar with the user permalink display you can use as:
[gist type="php"]
<a href="<?php echo $ESuser->getPermalink();?>">
<img src="<?php echo $ESuser->getAvatar();?>"/>
</a>
[/gist]
Please give it a try
·
Thursday, 29 November 2018 10:50
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post