The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I'm trying to display avatars (hosted in the filesystem) on a non-vb page. Basically, I'm supplying a userid and want to display the avatar...
PHP Code:
![]() From all the examples I've read it seems like this *should* work, am I making a stupid mistake? Any help is appreciated! --------------- Added [DATE]1239745335[/DATE] at [TIME]1239745335[/TIME] --------------- also, just to be clear this file resides in my vbulletin directory so the path to functions_user.php should be good. |
#2
|
|||
|
|||
![]()
anybody? is there another solution to display avatars that are NOT hosted in the database on a non vb page?
|
#3
|
||||
|
||||
![]()
Exactly what is getting displayed in the source code? And maybe it would be better to go:
PHP Code:
|
#4
|
|||
|
|||
![]()
^^ I think we're basically doing the same thing there?
When i try to run this and print the results using "echo $avatarurl;" for example I get nothing. It doesn't display noavatar.gif which should display if $avatarurl is empty. I can replace, $avatarurl = fetch_avatar_url($avatarid); with $avatarurl = 1; and the script runs and I can display the results (which are 1), so my issue lies with the fetch_avatar_url($avatarid); portion which doesn't seem to be pulling the info it's supposed to. Do I need to include other files to access that function? |
#5
|
||||
|
||||
![]()
Did you look at the API for that function? I believe it returns an array. Is $avatarurl defined as an array? According to the API, that is the correct file to include.
|
#6
|
|||
|
|||
![]()
Yeah looking at the API is where I got most of this code.
The if statement should deal with the array, basically saying if there is a value for $avatarurl[0] assign it to $avatarurl, otherwise gave $avatarurl the value "noavatar.gif" |
#7
|
|||
|
|||
![]()
Try a
Code:
print_r($avatarurl); |
#8
|
|||
|
|||
![]()
^^ Tried it, I think $avatarurl = fetch_avatar_url($avatarid); just isn't working
![]() |
#9
|
||||
|
||||
![]()
Did you try looking in the vb code to find a some code where this function is and then just copying it?
And, if $avatarurl is defined as an array, you can't then just go use it as if it isn't an array. |
#10
|
|||
|
|||
![]() Quote:
$avatarurl is an array, but I am using it as one... $avatarurl[0] would access the first element in the array which should be the URL for the avatar. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|