vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   $vbphrase question (https://vborg.vbsupport.ru/showthread.php?t=128412)

andewy3k 10-06-2006 08:22 AM

$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..

BigJohnny 10-06-2006 12:19 PM

im pretty sure this is because you are trying to use a PHRASE to display an IMAGE.

and also because phrases dont store images.

andewy3k 10-06-2006 08:04 PM

alright so what do I use to bring over the avatar image for the user?

???
???

BigJohnny 10-07-2006 04:02 PM

i believe its $bbuserinfo[avatar]

im not too sure on that though.

andewy3k 10-07-2006 04:38 PM

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

harmor19 10-08-2006 10:53 AM

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" />

andewy3k 10-08-2006 10:24 PM

wow even that did not work :(

just gives a dreaded red X of doom.

BigJohnny 10-09-2006 10:46 PM

click on the rex and go to properties, find out where it is looking for the image or what it is looking for.

Adrian Schneider 10-09-2006 10:58 PM

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.

andewy3k 10-10-2006 02:23 AM

Quote:

Originally Posted by BigJohnny
click on the rex and go to properties, find out where it is looking for the image or what it is looking for.

I checked the code its showing ..

HTML Code:

<img src=""  alt="" border="0" />
which obviously means its not picking up the avatar..

Quote:

Originally Posted by SirAdrian
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.



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&amp;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 :)


All times are GMT. The time now is 07:24 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03131 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete