Integrating With Your Custom Database

Gixaw Chat can be seamlessly integrated with your custom application or member database. Please follow the instructions below:

  1. First you need to create a file called gixawremote_custom.php. It should contain your PHP code with the following flow:
  2. <?php
    require_once(realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.’gixawremote.php’);

    if (/* user is not logged in */) {
        /*
           Show or redirect to the login form of your application.
           Once logged in, redirect the user back to the same url, with exactly same querystring.
           It’s important that querystring remains the same or return_to_gixaw function won’t work.
       */
    }
    else {
       /*
           User is logged in! We need to send it’s information back to
           Gixaw installation which sent us here.

          The $data array should have the information about the logged in user.
          The required keys are given below.
       */
        $data = array(
                ’external_id’ => $user_id,
                ’display_name’ => $nick_or_display_name,
                ’group_name’ => $group_name,
        );

        return_to_gixaw($data);
    }

    ?>

    Accepted keys for $data (array passed to return_to_gixaw function).

    Required keys:

    external_id - this is the integer or string used to uniquely identify this user, usually it would be the “id” field in your database table.
    display_name - display name (or nick name) for this user
    group_name - group name for this user, if your database does not store group names then it is advised to use Administrator for admin user, Moderator for the selected few and Member for the rest.

    Optional keys:

    profile_full_name - full name
    profile_email_address - email address
    profile_dob - date of birth
    profile_gender - gender
    profile_home_phone - home phone
    profile_work_phone - work phone 

  3. Upload it to anywhere on your web site where your application exists (e.g http://www.yourdomain.com/gixawremote_custom.php)
  4. Log into the admin area of Gixaw Chat and open Membership > Integrations.
  5. Click Enable Integrations (if not enabled already).
  6. Add a new integration in the admin area and fill in the following details:
    1. Integration Name as anything you wish to.
    2. Integration URL as http://www.yourdomain.com/gixawremote_custom.php
    3. Integration Logout URL as http://www.yourdomain.com/
    4. Leave Integration Secret Key as it is.
    5. Integration Charset same as your charset of your site. If you’re not sure what it is, leave this blank.
  7. Once created, click the Download link against the integration (in admin area) to download gixawremote.php file.
  8. Upload gixawremote.php to the same directory where you uploaded gixawremote_custom.php.
  9. In the Gixaw Chat admin area, click Make Default link against this integration.
     

Your integration is activated! Your members will automatically be logged into the chat now.

We also provide integration services to our customers. For any custom integrations, contact us.

Tags: , , ,

Leave a Reply

You must be logged in to post a comment.