![]() |
$vbphrase question
Im not sure if this is the "proper" section to be posting, but I am trying to insert $vbphrase[avatar] to display the users avatar right on the front page..
I tried $vbphrase[avatar] and <img src=$vbphrase[avatar]> nothing works.. thanks ahead of time.. |
im pretty sure this is because you are trying to use a PHRASE to display an IMAGE.
and also because phrases dont store images. |
alright so what do I use to bring over the avatar image for the user?
??? ??? |
i believe its $bbuserinfo[avatar]
im not too sure on that though. |
it did not work, I used
<img src=$bbuserinfo[avatar]> and just $bbuserinfo[avatar] but nothing :( anyone else have any ideas? thanks ahead of time |
Taken from the "postbit" template and slightly modified it.
HTML Code:
<img src="$bbuserinfo[avatarurl]" $bbuserinfo[avwidth] $bbuserinfo[avheight] alt="<phrase 1="$bbuserinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" /> |
wow even that did not work :(
just gives a dreaded red X of doom. |
click on the rex and go to properties, find out where it is looking for the image or what it is looking for.
|
Take a look at the function fetch_avatar_url() from includes/functions_user.php. It will depend on the board, too, because there are a few different ways avatars are stored. This function will take care of them all.
|
Quote:
HTML Code:
<img src="" alt="" border="0" /> Quote:
Here is the function fetch_avatar_url() function... HTML Code:
// ###################### Start getavatarurl ####################### Hope this info helps, thanks ahead of time :) |
Try this.
PHP Code:
|
no, this time no image shows at all.. not even a red x..
could it be because we are using php tags within html? |
It returns an array.... you'll need to use $avatar[0] to get the img src, and $avatar[1] (contains HTML) to get the width/height.
Code:
<img src="$avatar[0]"$avatar[1] alt="" /> |
still not working.. get red x
i tried HTML Code:
then i tried HTML Code:
|
1 Attachment(s)
see, look at the attached image..
|
When you say "front page" do you mean your forums' index?
|
yup, also known in the styles manager as "FORUMSHOME"
btw. im not using VBadvance or w/e that mod is called.. |
1 Attachment(s)
Download the attachment and import it to your plugins.
Open up your "FORUMHOME" template and add $avatar anywhere you want. |
WORKS GREAT!
but, I still need some kind of IF statement within the plugin or within the forumshome template to check if the user has an avatar, if not .. to show a special image if so show their avatar.. any help is appreciated.. |
_______________________________________________
anyone? I need an if statement :) Just like basically saying If "user has avatar" then code to pickup avatar and place within var $avatar else blank.gif (to show they dont have one) |
Replace your plugin PHP code with this:
PHP Code:
|
thanks :)
with some minor tweaks. it works great.. thanks :) |
All times are GMT. The time now is 12:06 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|