Hello There, Guest! › Register

MySubscriptions 2.2 released.
Looking for a custom plugin for your site? Ask here for a quote.

add avatar to menu area
#1

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

[Image: avatar_zps9a9ca829.png]
Reply
#2

A list of logged in users there? Is that it?
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#3

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
Reply
#4

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).
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#5

ok fine nvm
Reply
#6

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
Reply
#7

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.
Reply
#8

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.
Reply
#9

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

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?
Reply




Users browsing this thread: 1 Guest(s)