Im trying to display a users' avatar in navbar. I add this lines to a plugin in the global_start hook location.
PHP Code:
// include backend
require_once('./global.php');
require_once(DIR . '/includes/functions_user.php');
// setup avatar if exists
$avatar = fetch_avatar_url($vbulletin->userinfo['userid']);
if ($avatar != '' AND $vbulletin->options['avatarenabled'])
{
$avatarurl = $avatar[0];
}
Then the html in the navbar template:
HTML Code:
<img src="$avatarurl" alt="Your Avatar" border="0" />
The avatar won't display. What am I doing wrong?