View Full Version : Display Custom Avatar Outside Vbulletin
TMR Bac
06-19-2008, 09:03 PM
I did some searching and couldn't find an answer so I figured I'd try a post.
Has anyone successfully found a way to display a logged in user's custom avatar when they are on a website's page not part of vbulletin?
Right now I'm including the global.php file and can successfully pull a member's info like username, id, etc. outside the forum.
I can't for the life of me figure out if it's possible to display a custom avatar.
Brother Malachi
06-19-2008, 09:28 PM
This should do the trick.
<img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="" border="0" />
TMR Bac
06-20-2008, 12:45 AM
Thanks, but it was a no-go on both a non-forum page and inside the vbulletin header file.
Do you have that working on your own site?
Also, the only include or anything I'm doing on the non-forum pages is including global.php. Is there anything else I need to set or call to full establish the forum environment outside the forum?
I'm thinking yes because on a previous version of vbulletin the "who's online" included people anywhere on the site with just including the global.php file. On this latest version, that isn't working anymore.
Dismounted
06-20-2008, 10:21 AM
Use can use fetch_avatar_url() to generate the URL.
TMR Bac
06-20-2008, 04:59 PM
Use can use fetch_avatar_url() to generate the URL.
Thanks!
I'm fairly new at these types of php commands.
This is off.. what am I doing wrong?
$avatarurl = fetch_avatar_url();
echo "<img src=\"$avatarurl\">";
Dismounted
06-21-2008, 04:01 AM
Please look in the API documentation to see how to use the function.
TMR Bac
06-21-2008, 10:12 PM
Thanks. I understand the variables I need to plug into the function, but I don't understand the syntax I need to get the result to display on the page.
array fetch_avatar_url (integer $userid, [boolean $thumb = false])
Dismounted
06-22-2008, 06:53 AM
Go into functions.php and see what the function returns.
TMR Bac
06-26-2008, 05:13 PM
There is a functions_user file and there is fetch avatar functions in it.
My problem is I'm not familiar enough with syntax to figure out exactly what I should be pulling from there to put on my php page to get the avatar to display.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.