PDA

View Full Version : Avatar Thumbnails in the filesystem


kiki0
02-05-2013, 05:42 PM
I'm currently running AV Chat and driving myself a little mad here. I would love to go to them for support, but their support is very much lacking.

So, I've moved my forums avatars into the filesystem, which caused my avatars to not be displayed anymore in AVChat. I've added the following to the integration, which pulls SOME of the thumbnails. Others don't display at all and some show red X's. I can't find any correlation between any of them and it's driving me nuts. lol Any ideas? Appreciate any help very much.

Anyways, the code that was added is:

require_once(DIR .'/includes/functions_user.php');

// Grab avatar URL
$avatar = fetch_avatar_url($vbulletin->userinfo['userid'],true);
if ($avatar != '' AND $vbulletin->options['avatarenabled'])
{
$avatarurl = $avatar[0];
}

var_dump($avatarurl);
var_dump ($avconfig['thumbnailUrl']);

//Setup avatar if available
$avconfig['usersListType'] = 'thumbnail';
$avconfig['thumbnailUrl'] = '../'.$avatarurl.'';



--------------- Added 1360125628 at 1360125628 ---------------

Ok, so I found out that the code is correct and IS pulling the thumbnails appropriately. My issue is that if the user has no avatar, therefore no thumbnail, I get a red x. Any solutions to this?

--------------- Added 1360159669 at 1360159669 ---------------

Just wanted to post what I used to make this work. If the user doesn't have a thumbnail, it will grab the unknown.gif from your template. Remember to add this to the top of your file. For AVChat, this was all in integration.php (for those who use it.)

require_once(DIR .'/includes/functions_user.php');


// Grab avatar URL
$avatar = fetch_avatar_url($vbulletin->userinfo['userid'],true);
if (!is_array($avatar))
{
$avatar[] = "images/misc/unknown.gif";
}

{
$avatarurl = $avatar[0];
}

var_dump($avatarurl);
var_dump ($avconfig['thumbnailUrl']);

//Setup avatar if available
$avconfig['usersListType'] = 'thumbnail';
$avconfig['thumbnailUrl'] = '../'.$avatarurl.'';