MyBB Community Forums

Full Version: Add avatar to user menu
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like anyone who is logged in to my forums to see their avatar at the user menu. http://puu.sh/jFqxi/b62775dde0.jpg I also want the avatar to link to the person's profile.  How would I go about doing this?
Add this code wherever you want;

	<span style="text-align:left;"><a href="{$mybb->settings['bburl']}/usercp.php?action=avatar"><img class="panelavatar" style="vertical-align: top; margin-top: 5px;" src="{$mybb->user['avatar']} /images/default_avatar.png" height="40" width="40"></a></span>

You must edit the code to let it work properly, because this one is the default code from the Square Theme.
(08-18-2015, 06:25 AM)ArneVD Wrote: [ -> ]Add this code wherever you want;

	<span style="text-align:left;"><a href="{$mybb->settings['bburl']}/usercp.php?action=avatar"><img class="panelavatar" style="vertical-align: top; margin-top: 5px;" src="{$mybb->user['avatar']} /images/default_avatar.png" height="40" width="40"></a></span>

You must edit the code to let it work properly, because this one is the default code from the Square Theme.

This worked! http://puu.sh/jFzlU/98f2c10af3.jpg Thank you very much I just have one more question.  Would you happen to know the code that will link the person clicking it to their own profile?

It would be replacing this:

<a href="{$mybb->settings['bburl']}/usercp.php?action=avatar">
(08-18-2015, 08:49 AM)Scumbag Lemon Wrote: [ -> ]
(08-18-2015, 06:25 AM)ArneVD Wrote: [ -> ]Add this code wherever you want;

	<span style="text-align:left;"><a href="{$mybb->settings['bburl']}/usercp.php?action=avatar"><img class="panelavatar" style="vertical-align: top; margin-top: 5px;" src="{$mybb->user['avatar']} /images/default_avatar.png" height="40" width="40"></a></span>

You must edit the code to let it work properly, because this one is the default code from the Square Theme.

This worked! http://puu.sh/jFzlU/98f2c10af3.jpg Thank you very much I just have one more question.  Would you happen to know the code that will link the person clicking it to their own profile?

It would be replacing this:

<a href="{$mybb->settings['bburl']}/usercp.php?action=avatar">

No problem and yes, thats the code where you are brought to when you click on the avatar.

-Arne.
(08-18-2015, 09:23 AM)ArneVD Wrote: [ -> ]No problem and yes, thats the code where you are brought to when you click on the avatar.

-Arne.

Actually it brings me to "Change avatar" Not profile.
Then just remove usercp.php?action=avatar and put your link in it.
(08-19-2015, 07:40 AM)ArneVD Wrote: [ -> ]Then just remove usercp.php?action=avatar and put your link in it.

I am aware of that, this is not what I am asking.  I was wondering if you knew what the link would be to link to a person's profile.

Edit: I got it
Then use this one;

Just replace this with the link in your a tag.
{$mybb->settings['bburl']}/member.php?action=profile&uid={$mybb->user['uid']}