Пример #1
0
<?php

/**
 * Include iFlyChat PHP Client
 * Ensure that path to iflychat.php is correct
 *
**/
require_once '../lib/iflychat.php';
/**
 * Get your APP ID and API Key from https://iflychat.com
**/
const APP_ID = 'YOUR_APP_ID';
const API_KEY = 'YOUR_API_KEY';
$iflychat = new \Iflylabs\iFlyChat(APP_ID, API_KEY);
$iflychat_code = $iflychat->getHtmlCode();
?>

<html>
<head>
</head>
<body>
<h1>How to include iFlyChat in your PHP website?</h1>


<!-- iFlyChat Engine Code Begins -->
<?php 
print $iflychat_code;
?>
<!-- iFlyChat Engine Code Ends -->

Пример #2
0
<?php

/**
 * Include iFlyChat PHP Client
 * Ensure that path to iflychat.php is correct
 *
**/
require_once '../lib/iflychat.php';
/**
 * Get your APP ID and API Key from https://iflychat.com
**/
const APP_ID = 'YOUR_APP_ID';
const API_KEY = 'YOUR_API_KEY';
$iflychat = new \Iflylabs\iFlyChat(APP_ID, API_KEY);
/**
 * You may get user_id, user_name and other user details
 * either from your active PHP session ($_SESSION)
 * or by querying your database
 */
$iflychat->setUser(array('user_id' => '2', 'user_name' => 'testUser', 'is_admin' => FALSE, 'user_avatar_url' => 'user-avatar-link', 'user_profile_url' => 'user-profile-link', 'is_mod' => FALSE));
$iflychat_code = $iflychat->getHtmlCode();
?>

<html>
<head>
</head>
<body>
<h1>How to include iFlyChat in your PHP website?</h1>


<!-- iFlyChat Engine Code Begins -->