PDA

View Full Version : Avatar URL on selected pages.


Kasc
05-12-2018, 04:34 AM
Hey

Recently decided to do a new theme for the forum to match with the main website and added the new addition of a sidebar on everypage (or will be, once I get to them 1 by 1) and the addition of the login / account section on the left hand side has their avatar above a "welcome back X" .. I'm just looking at how to get the avatar to show, I've tried a few things and i seems to return as (unnkown) so was wondering if anyone had any ideas how to show their avatar

Using Vbulletin 4.2.5

MarkFL
05-12-2018, 12:42 PM
Here is PHP code to get a user's avatar:

if ($show['member'])
{
require_once('./includes/functions_user.php');
$avatar_url = fetch_avatar_url($vbulletin->userinfo['userid']);
$avatar = $avatar_url[0];

if (!$avatar)
{
$avatar = $vbulletin->stylevars['imgdir_misc']['imagedir'] . '/unknown.gif';
}
}
else
{
$avatar = $vbulletin->stylevars['imgdir_misc']['imagedir'] . '/unknown.gif';
}