MyBB Community Forums

Full Version: How do I add a border to avatars?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys,

Friendly neighbourhood newbie here with another easy one. I'm looking to make it so that every avatar that loads up on the post and in profile has a 1 px solid #252525 border around it. Also, if anyone could clarify if the templates and themes are programmed in CSS, XHTML or PHP (or whatever) I would be appreciative. Thanks!
Can't anyone help?
The templates are HTML styled with CSS. The php is just for te dynamic processes.

for the Avatars..

1- For the postbit
go to Admin CP > Templates > Modify / Delete > EXPAND > Postbit templates > postbit_avatar

There i guess you you can figure out what to do for the <img> tag.

2- For the profile
open ./member.php find

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

Also there you do the same steps, but make sure to escape the quotations (ex \"something\")

regards
zaher1988 Wrote:The templates are HTML styled with CSS. The php is just for te dynamic processes.

for the Avatars..

1- For the postbit
go to Admin CP > Templates > Modify / Delete > EXPAND > Postbit templates > postbit_avatar

There i guess you you can figure out what to do for the <img> tag.

I've already tried that. No border shows up on the avatar when I modify the IMG tag, or if I add a <div> around it with a border. I've modified the {$post['avatar']} part in Postbit Templates > postbit_authoruser by adding a <div...border:1pt> around it and it works for the most part. However, if someone does not post an avatar, an empty table with a border appears regardless. I don't want that. I want to be able to directly modify the avatar's programming so an avatar will preload with a border. Any help would be appreciated, thanks.
Oh damn it.. how i missed that.. this way can only work with clickable images.. anyway let's go back to divs

Open ./inc/functions_post.php

Find
eval("\$post['useravatar'] = \"".$templates->get("postbit_avatar")."\";");
Above it add
$style = "style=\"border: thin solid #000000; padding:0px; width:4%\"";

Now the postbit_avatar should look this way

<div {$style}><img src="{$post['avatar']}" alt="" {$avatar_width_height}  /></div>

For the profile it is already working i guess

Regards
Brilliance! thank you!!