Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 4 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Customizing VSa - Chatbox with user avatars
MarkFL's Avatar
MarkFL
Join Date: Feb 2014
Posts: 3,853

I'm a relative newcomer to vBulletin administration, but I am enjoying every second of it, thanks in large part to the community here at vBorg.

St. Augustine, FL
Show Printable Version Email this Page Subscription
MarkFL MarkFL is offline 12-08-2014, 10:00 PM

How to display user avatars. We use the file system to store our avatars, so could not use the image.php?u=userid method.

To show avatars open the plugin titled "VSa - ChatBox - MN" and locate the line:

PHP Code:
$vsacb_msg_box_parsed str_replace('\''''', $vsacb_bbparser->do_parse($vsacb_msg_box_styled,1,$vsacb_smilies_onoff,1,1,1)); 
And after that, inserted the code:

PHP Code:
require_once('./includes/functions_user.php');
$avatar_url fetch_avatar_url($vsacb_msg_box['userid']);

$avatar $avatar_url[0];

if (!
$avatar)
{
    
$avatar './images/misc/unknown.gif';
}

$user_avatar '<img src="'.$avatar.'" border="0" width="48" style="vertical-align: middle" />';

vB_Template::preRegister('vsa_chatbox_bit',array('user_avatar' => $user_avatar)); 
Save the plugin, and then in the template "vsa_chatbox_bit" you may use "{vb:raw user_avatar}" to display the user avatars.
Reply With Quote
  #12  
Old 05-20-2016, 03:59 PM
BliNeR-KeY BliNeR-KeY is offline
 
Join Date: Nov 2013
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i use
https://vborg.vbsupport.ru/showthread.php?t=268618

i cant set 20x20

Code:
.tile_avatar {
  width: 80px;
  height: 80px;
  background: #ef7600;
  text-align: center;
maybe you have code only for chatbox ?
Reply With Quote
  #13  
Old 05-20-2016, 04:04 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This article is about adding avatars to "VSa - Chatbox" not to the forumdisplay or other areas.
Reply With Quote
  #14  
Old 05-20-2016, 04:14 PM
BliNeR-KeY BliNeR-KeY is offline
 
Join Date: Nov 2013
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

pls check is so big 80x80
http://prntscr.com/b6ezvd
i just add

Code:
{vb:raw user_avatar} {vb:raw vsacb_msg_box.musername}
Reply With Quote
  #15  
Old 05-20-2016, 04:55 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Change this line:

PHP Code:
$user_avatar '<img src="'.$avatar.'" border="0" width="48" style="vertical-align: middle" />'
to suit your needs.
Reply With Quote
  #16  
Old 05-20-2016, 05:07 PM
BliNeR-KeY BliNeR-KeY is offline
 
Join Date: Nov 2013
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you so much fixed

Code:
$user_avatar = '<img src="'.$avatar.'" border="20" width="20" style="vertical-align: middle" />';
see

Code:
http://prntscr.com/b6fqys
Reply With Quote
Благодарность от:
MarkFL
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 03:48 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03839 seconds
  • Memory Usage 2,279KB
  • Queries Executed 23 (?)
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
  • (4)bbcode_code
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (6)post_thanks_box
  • (5)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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