Integrate HTML5 chat with chameleon software online

Here is the step to integrate html5 chat with

Create html5chat.php on root and paste there this code:

if (empty($_GET['cmd']) || $_GET['cmd'] != 'lang')
    $area = "login";
$_GET['display'] = get_param('display', User::displayProfile());
$where = ' u.user_id = ' . to_sql(guid(), 'Number');
$webmasterid = xxxxx;
$password = "yyyyyy";
$id = $GLOBALS['g_user']['user_id'];
$avatars = glob("_files/photo/" . $id . "_*_m.jpg");
$avatar = (count($avatars)) ? "//{$_SERVER['SERVER_NAME']}/" . $avatars[0] : '';
switch($GLOBALS['g_user']['gender']) {
case 'C':
$gender = 'male';
case 'F':
$gender = 'female';
$gender = 'male';
$myuser = array(
    'username'  => $GLOBALS['g_user']['name'],
    'password'  => $password,
    'gender'    => $gender,
    'role'      => $GLOBALS['g_user']['role'],
    'image'     => $avatar,
    'profile'   => base64_encode("//{$_SERVER['SERVER_NAME']}/users_online.php?display=profile&uid=$id&offset=1")
$json = json_encode($myuser);
$encoded = file_get_contents("" . base64_encode($json));
<!doctype html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Webcam Chat</title>
        html, body {
            width: 100%;
            height: 100%;
    <script src="<?=$webmasterid?>/<?= $encoded ?>"></script>

Replace xxxx and yyyy by your webmasterid and your html5-chat password account.

One thought to “Integrate HTML5 chat with chameleon software online”

  1. the code works fine, but it has a flaw: when you change the profile photo, the chat one always remains the same …. can you solve this problem in the code? 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.