PDA

View Full Version : How to pull avatar with URL?


ConfusedCartman
11-23-2009, 08:25 PM
Using 3.8x:

I'm trying to pull avatars from the server in a script by using this PHP code:

function getAvatar($image) {
return $_SESSION['FORUM_URL']."image.php?u=".$image;
}

Where $_SESSION['FORUM_URL'] is equal to our forum directory and $image is equal to the userid of the user in question. However, when I do that I get a 1x1px transparent GIF image instead of their avatar, and I can't figure out how to get it to work. I know it works on another forum I manage, which is 3.7x, which leads me to believe that this might be something vBulletin changed between 3.7x and 3.8x. Any ideas?

kh99
11-23-2009, 10:12 PM
It works OK for me on 3.8.X, but if a user doesn't have a custom avatar you get what you describe.