Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-06-2006, 08:22 AM
andewy3k andewy3k is offline
 
Join Date: Oct 2006
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default $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..
Reply With Quote
  #2  
Old 10-06-2006, 12:19 PM
BigJohnny's Avatar
BigJohnny BigJohnny is offline
 
Join Date: Jun 2006
Location: Canada
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

and also because phrases dont store images.
Reply With Quote
  #3  
Old 10-06-2006, 08:04 PM
andewy3k andewy3k is offline
 
Join Date: Oct 2006
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

???
???
Reply With Quote
  #4  
Old 10-07-2006, 04:02 PM
BigJohnny's Avatar
BigJohnny BigJohnny is offline
 
Join Date: Jun 2006
Location: Canada
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i believe its $bbuserinfo[avatar]

im not too sure on that though.
Reply With Quote
  #5  
Old 10-07-2006, 04:38 PM
andewy3k andewy3k is offline
 
Join Date: Oct 2006
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 10-08-2006, 10:53 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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" />
Reply With Quote
  #7  
Old 10-08-2006, 10:24 PM
andewy3k andewy3k is offline
 
Join Date: Oct 2006
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow even that did not work

just gives a dreaded red X of doom.
Reply With Quote
  #8  
Old 10-09-2006, 10:46 PM
BigJohnny's Avatar
BigJohnny BigJohnny is offline
 
Join Date: Jun 2006
Location: Canada
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

click on the rex and go to properties, find out where it is looking for the image or what it is looking for.
Reply With Quote
  #9  
Old 10-09-2006, 10:58 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 10-10-2006, 02:23 AM
andewy3k andewy3k is offline
 
Join Date: Oct 2006
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:07 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.11468 seconds
  • Memory Usage 2,270KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete