MyBB Community Forums

Full Version: Customizing avatar in portal template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there!

I'm trying to edit the avatar image which appears on portal announcements. I've tried to modify the "portal_announcement" template, but the only thing i see is {$avatar}, which contains the full HTML.

Are there any variable containing the avatar url accesible from the portal template?

Thanks in advance ^^
What are you trying to change? The size? if so you can wrap that in a class via the css
(2012-11-04, 01:45 PM)Leefish Wrote: [ -> ]What are you trying to change? The size? if so you can wrap that in a class via the css

Not exactly. I'm trying to append a small image in the bottom right corner of the avatar.
For example, I have this in postbit_avatar:
<div style="position: relative;">
	<a href="{$post['profilelink_plain']}"><img src="{$post['avatar']}" alt="" {$avatar_width_height} /></a>
	<img style="position: absolute; bottom: 1px; right: 1px; z-index: 1;" src="images/professions/{$post['fid5']}.png" />
</div>
Aha, right. I think (will have to check) that the portal avatar is "hardcoded" in the php file. If you are fairly confident at editing php you could probably add that direct to the string in portal.php.

However - I think it is also that you are trying to put a post var into the portal template (not sure that is gonna work) - have you tried testing your HTML/css with just a simple small image first? Like a smilie - just as test. I see where you are going with it, and I THINK that to make this work in portal you would have to edit the announcements query in portal.php.

Edit to add: I think pavemen really is the portal.php man and seems open to help with portal.php over at his site:

http://www.communityplugins.com/forum/fo....php?fid=8
(2012-11-04, 02:36 PM)Leefish Wrote: [ -> ]Aha, right. I think (will have to check) that the portal avatar is "hardcoded" in the php file. If you are fairly confident at editing php you could probably add that direct to the string in portal.php.

However - I think it is also that you are trying to put a post var into the portal template (not sure that is gonna work) - have you tried testing your HTML/css with just a simple small image first? Like a smilie - just as test. I see where you are going with it, and I THINK that to make this work in portal you would have to edit the announcements query in portal.php.

Edit to add: I think pavemen really is the portal.php man and seems open to help with portal.php over at his site:

http://www.communityplugins.com/forum/fo....php?fid=8

I assumed the post var won't be the same, but I hoped there might be a difficult-to-find template called portal_avatar or something... Sigh, I'll have to edit the php xD

Yea, I think i'll need to edit the query too, at least to get the custom fields ...

Best regards, and thank you for all ^^

EDIT:
Yes, as we supposed, $avatar code is inside portal.php, line 548:
		$avatar = "<td class=\"trow1\" width=\"1\" align=\"center\" valign=\"top\"><img src=\"{$announcement['avatar']}\" alt=\"\" {$avatar_width_height} /></td>";
Yup, I suspected as much - I remember looking for it long ago. I removed avatars from my portal announcements in the end.