User Manual

Home HomePre page User Profile Integration | 3rd Party Instant Messenging Module Next page

FriendList Integration


FriendList integration

The whole scenario is that the chat server will integrate the friendlist from an external database through dynamic application, like PHP, ASP, ASP.net or JSP if Friendlist module is enabled in chat server. The script will be used to add, remove, or query database.

Parameters List:

The following parameters and alues should not be changed.

ParameterValueDescription
action%action%This defines the action that the script will perform: 0:Query Friend 1:Add Friend 2:Remove Friend 3:Update Friend
username%username%This defines the user who will perform the action
destusername%destusername%This defines the user whose information entry the script will process
friendgroup%friendgroup%This defines the action that the server will perform.

 

The Application Return:

The application will return an xml-formatted string to chat server for further processing

ActionNecessary ParameterParameter exampleReturn
0:Query FriendAction, username

Action=0&username=jack
It indicates all of jack's friend will be returned

<UD> <FL> <g n="general"> <u n="tom"> </g> <g n="stranger"> <u n="rose">" </g> </FL> </UD This returning alue indicates tom is jack's friend, rose is not jack's friend, but jack is rose's friend
1:Add FriendAction, username, destusername, friendgroup

1.Action=1&username=jack&destusername=tom&
friendgroup=general It means jack add tom as his friend 2.Action=1&username=jack&destusername=tom&
friendgroup=stranger It indicates jack won't add tom as his friend

<FL r=" 0"> It indicates the friend is added successfully (if tom is already jack's friend before, it also returns success) <FL r=" 1"> It indicates it failed to add the friend
2:Remove FriendAction, username, destusernameAction=2&username=jack&destusername=tom It indicates jack will remove tom from his friend list<FL r=" 0"> It indicates the friend is removed successfully (if tom is already not jack's friend before, it also returns success) <FL r=" 1"> It indicates it failed to remove the friend
3:Update FriendAction, username, destusername, friendgroupAction=3&username=jack&destusername=tom&
friendgroup=general.
It indicates jack will "Add Friends" Action=3&username=jack&destusername=tom&
friendgroup=stranger. It indicates jack will "Remove Friends"

Sample configuration:

In <123webmessenger installed directory>/server/etc/groups/default/server.xml <integrated-user-data url="http://yoursite/userdata.php?action=%action%&amp;username=%username%&amp;
destusername=%destusername%&amp;friendgroup=%friendgroup%" charset="UTF-8" enable="On">
</integrated-user-data>

Sample Code:

You can download sample code from here:

The sample Friendlist database can be generated from friendlist.sql.

The sample code could be used directly if you have imported the sample database and configure the user-data-url in server.xml
after restarting your chat server.

You could modify the alue of following parameter integrate chat server with Friendlist table in your user databas.

$addFriendSql: The SQL sentence will add a friend.

$removeFriendSql: The SQL sentence will remove a friend.

$queryFriendSql: The SQL sentence will get "username" friendlist.

$opQueryFriendSql: The SQL sentence will get list that whose friend included "username" if the one who is not on "username" friend list.

$checkRowSql: The SQL sentence will check the existence of the username and destusername record in friend table.

$userNameRowField:The user name field in your user table.

$user->setDb($db): $db will be your database link.

Related links:

Website Integration


Home HomePre page User Profile Integration | 3rd Party Instant Messenging Module Next page

About Us | Contact us | Company Blog | Partnership | Affiliate | Forum | Privacy policy | Terms of Use | SiteMap | Links

Call Sales Now! USA +1 315 636 6657, UK +972 59 9380061, HK +970 56 8169833

Share 123 Flash Chat:

Copyright © TopCMM Software Limited 2001-2015 All Rights Reserved.