1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. If you want premium products then purchase our VIP or SVIP plans
  3. Dont forget read our rules HERE Also anyone caught Leeching this content or Scamming will be banned on numerous networks.
    Dismiss Notice
  4. Dont forget we do not allow Multiple Accounts, so all of your accounts as well as your IP will be banned.
    Dismiss Notice
  5. Tired of Download Limits ? UPGRADE Today!
    Dismiss Notice

Customizing VSa - Chatbox with user avatars

Discussion in 'Vbulletin' started by Deviant, May 9, 2016.

  1. Deviant

    Deviant Administrator Staff Member ADMIN

    Likes Received:
    171
    Trophy Points:
    43
    Gender:
    Male
    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.
     

Share This Page

Post thread