MyBB Community Forums

Full Version: Use {$mybb->user['avatar']} to display a specific users avatar for everyone.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Basically I have a page where I want to display the admins avatar.  How can I define a uid using  {$mybb->user['avatar']}  Or am I using the wrong one entirely?  Thanks if anyone can help! Toungue
That var woul not exist you have to use a plugin.

Only avatar works on posts or for actual account only on other parts yoy may use some plugin.
Where do you want to display it? You need to either query the avatar or insert the image manually like this (since it's for 1 admin only):
<img src="http://linktoadminsavatar.com/image.png" alt="" />

Because {$mybb->user['avatar']} shows the avatar of the user currently browsing the forum.
(2014-08-16, 05:27 AM)Destroy666 Wrote: [ -> ]Where do you want to display it? You need to either query the avatar or insert the image manually like this (since it's for 1 admin only):

<img src="http://linktoadminsavatar.com/image.png" alt="" />

Because {$mybb->user['avatar']} shows the avatar of the user currently browsing the forum.

Thanks I guess this will work, but is there anything for {$mybb->UID"1"['avatar']} deal?  I'll be using it for something else.  Anyone know?
That's not a proper PHP code... Once again, it's not possible this way and you need to query a specific avatar from database, then assign it to a variable and lastly output in template(s).
I think he was just trying to give an example of what he wants, but he doesn't know what the code would look like.

I also would be curious what the actual written code would look like for something like this.  Perhaps rather than just saying a plugin or query is needed, can you supply it?  Or at least some type of example that we could easily use/tweak to make this happen on a forum?