PDA

View Full Version : Avatar in template


Gellpak
03-22-2005, 03:40 PM
I'm attempting to place the current user's avatar in a location in the header template, but the avatar variables I know fail to display the image. I tried adding the below code to the end of global.php but it didn't help. Any suggestions?


$bbuserinfo['user_avatar']="<img src='{$bbuserinfo['user_avatar']}' alt='Edit Your Avatar' border='0'>";
$bbuserinfo['user_avatar']="<a href='profile.php?{$session['sessionurl']}&do=editavatar'>{$bbuserinfo['user_avatar']}</a>";
$welcome_avatar=$bbuserinfo['user_avatar'];

Gellpak
03-22-2005, 06:04 PM
Got it. Here's the code. Place this in phpinclude_start


require_once('./includes/init.php');
require_once('./includes/functions_user.php');
$bbuserinfo['user_avatar']=fetch_avatar_url($bbuserinfo['userid']);
$bbuserinfo['user_avatar']="<img src='$vboptions[bburl]/{$bbuserinfo['user_avatar']}' border='0'>";
$bbuserinfo['user_avatar']="<a href='$vboptions[bburl]/profile.php?{$session['sessionurl']}&do=editavatar'>{$bbuserinfo['user_avatar']}</a>";
$welcome_avatar=$bbuserinfo['user_avatar'];


and then place $welcome_avatar where you want it to output the avatar.