Yeah, sorry - I should have looked at fetch_avatar_url before assuming I knew what it returns. It does return an array, and it seems like it either just has one array element with the url, or else it has a "hascustom" element set to 1, with a number of other fields. I looked for other places that call fetch_avatar_url, but I'm still not sure how it's all supposed to be used. Here's one from user.php (in admincp, I think):
PHP Code:
require_once(DIR . '/includes/functions_user.php');
$userinfo['avatarurl'] = fetch_avatar_url($userinfo['userid']);
if ($userinfo['avatarurl'] == '' OR $userinfo['avatarid'] != 0)
{
$userinfo['avatarurl'] = '<img src="' . $vbulletin->options['cleargifurl'] . '" alt="" border="0" />';
}
else
{
$userinfo['avatarurl'] = "<img src=\"../" . $userinfo['avatarurl'][0] . "\" " . $userinfo['avatarurl'][1] . " alt=\"\" border=\"0\" />";
}
That code's kind of confusing because the return value is put in $userinfo['avatarurl'] and it's also using $userinfo['avatarid'] that comes from somewhere else, I guess.
It could be that fetch_avatar_url is only used in a few special places because it does a query to get the answer, so if you put it on a page with a lot of avatars it's going to add a lot of queries (which maybe doesn't matter to you, but just so you know..).