MyBB Community Forums

Full Version: Member Profile - Avatar
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I would like to add a white border around the user avatar which is shown in the member's profile.

Can someone tell me where I can modify the {$avatar} variable to be able to do this? I've done it fine for the postbit, just can't find it for member's profile.

Thanks.
You'll find it in the member_profile template (under Member Templates):

<td width="25%" align="right" valign="middle">{$avatar}</td>
There is no way possible to modify the avatar in such a way that I'd like (add a border to the image) in the Member_profile. it needs to be something more internal I guess.
Have you tried doing:

<td width="25%" align="right" valign="middle"><div style="border: 1px solid #ffffff;">{$avatar}</div></td>
No, Knerba is right. I tried that same code and the border wraps the <td> element instead of the image. You will need to edit the member.php file and style the <img> element directly. Around line 1300, find:

$avatar = "<img src=\"{$memprofile['avatar']}\" alt=\"\" $avatar_width_height />";

Please note you need to escape the quotes there, so if you were to add a simple black border, you'd do:

$avatar = "<img style=\"1px solid #000\" src=\"{$memprofile['avatar']}\" alt=\"\" $avatar_width_height />";
I did what you said but that didn't work but the fact that you pointed me in the right direction is what was more important.

The solution was...

style=\"border:2px solid white;\"

Thanks guys!