Forums / Cotonti / Support / Header avatar problems

jacken
#1 2009-08-13 00:29
hi dudes

im trying to get the user avatar in the header under the control panel.

i found this thread - http://www.cotonti.com/forums.php?m=posts&p=13554
and ive done like medj did.

in common.php i added
$usr['avatar'] = $row['user_avatar'];

in header.php i added
"HEADER_USER_AVATAR" => sed_build_userimage($usr['user_avatar'], 'avatar'),

and in the header tpl file i added {HEADER_USER_AVATAR} where i wanted it.

the problem is that it only gives me a pic of the default avatar instead of the one that the user is using

all help is appreciated
Trustmaster
#2 2009-08-13 01:50
Where exactly do you put that in common.php?
The most correct place is about line 233:
$usr['newpm'] = $row['user_newpm'];
$usr['auth'] = unserialize($row['user_auth']);
$usr['profile'] = $row;
$usr['avatar'] = $row['user_avatar'];
Alternatively, you could try using this tag to get the image source in any TPL instead without any modifications in PHP files:
<img src="{PHP.usr.profile.user_avatar}" />
May the Source be with you!
jacken
#3 2009-08-13 02:02
yeah i had it right were u put it.

but i used ur image code instead and it worked great.

thx!