3 minutes reading time (528 words)

Integrating JBolo with other Social-Community extensions or Joomla User Management systems

Integrating JBolo with other Social-Community extensions or Joomla User Management systems

JBolo is one of the most popular Chat systems for Joomla & many popular Social networking platforms like JomSocial, EasySocial, Community builder to name a few. However besides these systems there are many extensions available that extend the Joomla User management to add features like extra fields, profiles, avatars etc. 

This blog is targeted at extension developers who want to add JBolo support for their specific profile extension. We are writing this integration guide for Jbolo so that you can easily integrate it with the community extension you build.

You can easily integrate Jbolo by modifying two files -

Find this file - administrator/components/com_jbolo/config.xml

1. Add configuration option to set integration to your community

Find this code in above file

<field name="community" type="radio" default="joomla" label="COM_JBOLO_INTERATION" description="COM_JBOLO_INTERATION_DESC" class="btn-group">
<option value="joomla">COM_JBOLO_INTERATION_JOOMLA</option>
<option value="cb">COM_JBOLO_INTERATION_CB</option>
<option value="jomsocial">COM_JBOLO_INTERATION_JOMSOCIAL</option>
<option value="jomwall">COM_JBOLO_INTERATION_JOMWALL</option>
<option value="EasySocial">COM_JBOLO_INTERATION_EASYSOCIAL</option>
</field>

Add option for your community extension in above config field -

<option value="your_community">COM_JBOLO_INTERATION_YOUR_COMMUNITY</option>

 

After that, you will need to modify the file - components/com_jbolo/helpers/integrations.php

2. Modify function - function getUserProfileUrl($userid)

// Add condition for your community option.
else if ($integration_option == "your_community")
{
    // Add code to generate a profile url/link for the user id provided
}

 

3. Modify function - function getUserAvatar($userid)

// Add condition for your community option.
else if ($integration_option == "your_community")
{
    // Make a function call to get user avatar for the user id provided.
    $uimage = $this->getYour_CommunityUserAvatar($userid);
}

 

4. Modify function - function getOnlineUsersList($uid, $usersNotToInclude)

// Add condition for your community option.
else if ($integration_option == "your_community")
{
    // Make a function call to get a list of online users from your community.
    $online_users = $this->getYour_CommunityOnlineUsersList($uid, $fonly, $chattitle, '', $usersNotToInclude);
}

 

5. Modify function - function getAutoCompleteUserList($uid, $filterText)

// Add condition for your community option.
else if ($integration_option == "your_community")
{
    // Make a function call to get a list of online users for group-chat autosuggest from your community.
    $online_users = $this->getEasySocialOnlineUsersList($uid, $fonly, $chattitle, $filterText, '');
}

 

6. Modify function - function getActivityStreamHTML()

// Add condition for your community option.
else if ($integration_option == "your_community")
{
    // If your community extension has a module that shows activity stream, you can show that in chatbar.
    $html = $this->getActivityHTMLFromModule($position);
}

 

7. Write new function that will return user avatar from your community

function getYour_CommunityUserAvatar($userid)
{
    // Add code to generate link to user's avatar image.
   return $uimage;
}

 

8. Write new function that will return list of online users from your community

function getYour_CommunityOnlineUsersList($uid, $fonly, $chattitle, $filterText='', $usersNotToInclude)
{
    // Add code to generate list of online users.

    // $uid - loogedin userid
    // $fonly - decideds if to show all users or just friends
    // $chattitle - decides if to show Username or Name in chatlist
    // $filterText - is a filter text that user inputs when adding a new user to groupchat
    // $usersNotToInclude - array of users blocked by loggedin users

    // Refer to code for other communities

    return $online_users;
}

 

Once you are done with this, login in two browsers and test the chat once. When you are confirm that it's working fine, you can submit the patch to us, so that we can maintain it later.

2
Amazon Cloudfront or S3 - What should I use ?
Adding Multi-Vendor Taxation & Enhanced Shipping M...

Related Posts