• TO DOWNLOAD YOU NEED TO BUY AN UPGRADE

Customizing VSa - Chatbox with user avatars

Deviant

Banned
BANNED
#1
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:

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:

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