The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
$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.. |
#2
|
||||
|
||||
im pretty sure this is because you are trying to use a PHRASE to display an IMAGE.
and also because phrases dont store images. |
#3
|
|||
|
|||
alright so what do I use to bring over the avatar image for the user?
??? ??? |
#4
|
||||
|
||||
i believe its $bbuserinfo[avatar]
im not too sure on that though. |
#5
|
|||
|
|||
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 |
#6
|
|||
|
|||
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" />
|
#7
|
|||
|
|||
wow even that did not work
just gives a dreaded red X of doom. |
#8
|
||||
|
||||
click on the rex and go to properties, find out where it is looking for the image or what it is looking for.
|
#9
|
||||
|
||||
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.
|
#10
|
|||
|
|||
Quote:
HTML Code:
<img src="" alt="" border="0" />
Quote:
Here is the function fetch_avatar_url() function... HTML Code:
// ###################### Start getavatarurl ####################### function fetch_avatar_url($userid) { global $vbulletin; if ($avatarinfo = $vbulletin->db->query_first_slave(" SELECT user.avatarid, user.avatarrevision, avatarpath, NOT ISNULL(customavatar.userid) AS hascustom, customavatar.dateline, customavatar.width, customavatar.height FROM " . TABLE_PREFIX . "user AS user LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON avatar.avatarid = user.avatarid LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON customavatar.userid = user.userid WHERE user.userid = $userid")) { if (!empty($avatarinfo['avatarpath'])) { return array($avatarinfo['avatarpath']); } else if ($avatarinfo['hascustom']) { $avatarurl = array('hascustom' => 1); if ($vbulletin->options['usefileavatar']) { $avatarurl[] = $vbulletin->options['avatarurl'] . "/avatar{$userid}_{$avatarinfo['avatarrevision']}.gif"; } else { $avatarurl[] = "image.php?u=$userid&dateline=$avatarinfo[dateline]"; } if ($avatarinfo['width'] AND $avatarinfo['height']) { $avatarurl[] = " width=\"$avatarinfo[width]\" height=\"$avatarinfo[height]\" "; } return $avatarurl; } else { return ''; } } } Hope this info helps, thanks ahead of time |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|