MyBB-Plugins Forums
add avatar to menu area - Printable Version

+- MyBB-Plugins Forums (http://forums.mybb-plugins.com)
+-- Forum: MyBB General Discussion (http://forums.mybb-plugins.com/Forum-MyBB-General-Discussion)
+--- Forum: Coding Help (http://forums.mybb-plugins.com/Forum-Coding-Help)
+--- Thread: add avatar to menu area (/Thread-add-avatar-to-menu-area)

Pages: 1 2


add avatar to menu area - zero5854 - 02-05-2013

is there a way to add a logged in users avatar to the area shown in the pic below

[Image: avatar_zps9a9ca829.png]


RE: add avatar to menu area - Diogo Parrinha - 02-05-2013

A list of logged in users there? Is that it?


RE: add avatar to menu area - zero5854 - 02-06-2013

no sorry...what I mean is I would like to have the whatever logged in members avatar show in the spot I boxed out in the pic above...SO the avatar would be next to the dropdown box and then the mail icon would be next to that


RE: add avatar to menu area - Diogo Parrinha - 02-06-2013

Please read the description of this forum:
Quote:Need help with PHP coding related to MyBB? We can help! We will NOT code anything for you. We will help you to achieve your goal (by providing examples or pointing you in the right direction).



RE: add avatar to menu area - zero5854 - 02-06-2013

ok fine nvm


RE: add avatar to menu area - along - 02-17-2013

Try this

Admin CP -> Templates & Style -> Templates -> *Template Set* -> Portal Templates -> portal_welcomeblock
Add this code where you want the avatar to be displayed.

Code:
<img src="{$mybb->user['avatar']}" alt="Avatar" width="50px" height="50px" />

Hope Pirata allow me to post it here Big Grin


RE: add avatar to menu area - zero5854 - 02-20-2013

thanks for the code although for me it was on the index I wanted it. The code does work Smile for reference for others mine was in header_welcomeblock_member

EDIT: after some playing around I was able to get it to work by adding a bit of css to make it look pretty Tongue

[Image: cool_zps127ea5ab.png]

If you just use the code above by itself its just gonna be a floating avatar lol....

Add this to end of Global.css
Code:
.panel {
background: #1f1b1b;
margin-right: 7px;
padding: 4px;
margin-top: 0px;
margin-bottom: 5px;
-moz-border-radius-bottomleft: 5px;
-moz-border-radius-bottomright: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
position: relative;
z-index: 99;
}

then place "Along's" code in div tags like this....(header_welcomeblock_member

Code:
<div class="left panel"><img src="{$mybb->user['avatar']}" alt="Avatar" width="50px" height="50px" /></div>

You can adjust the numbers and color above to better fit your theme.


RE: add avatar to menu area - along - 02-21-2013

yes zero5854 ...

by css u can edit the style by your own..

with the basic code its show the avatar and with the css it will styling the avatar like bordering and positioning.. its depend on our themes right. hehe

i use it at floating header .

btw nice share.


RE: add avatar to menu area - zero5854 - 02-21-2013

right and thats just what I needed was that code. thanks again


RE: add avatar to menu area - Turbo - 02-25-2013

If the user does not have an avatar though it will display a broken image icon though, I tried an if statement but had no luck. Both the default avatar & user set avatar would should up. Did anyone deal with that?