Example #1
0
$friend_ids = ids_array($space['friends']);
//好友
$buddy_ids = ids_array(gp("buddy_ids"));
//正在聊天的联系人
$new_messages = find_new_message();
//查找离线消息
for ($i = 0; $i < count($new_messages); $i++) {
    $msg_uid = $new_messages[$i]["from"];
    array_push($buddy_ids, $msg_uid);
    array_push($stranger_ids, $msg_uid);
}
//Login webim server.
$nick = to_utf8($name);
$setting = setting();
$block_list = is_array($setting->block_list) ? $setting->block_list : array();
$rooms = find_room();
$room_ids = array();
foreach ($rooms as $key => $value) {
    if (in_array($key, $block_list)) {
        $rooms[$key]['blocked'] = true;
    } else {
        array_push($room_ids, $key);
    }
}
$data = array('rooms' => join(',', $room_ids), 'buddies' => join(',', array_unique(array_merge($friend_ids, $buddy_ids, $stranger_ids))), 'domain' => $_IMC['domain'], 'apikey' => $_IMC['apikey'], 'endpoint' => $space['uid'], 'nick' => to_unicode($nick));
$client = new HttpClient($_IMC['imsvr'], $_IMC['impost']);
$client->post('/presences/online', $data);
$pageContents = $client->getContent();
//TODO: handle errors!
$pageData = json_decode($pageContents);
if ($client->status != "200" || empty($pageData->ticket)) {
Example #2
0
        case $_L['BTN_list']:
            break;
        case $_L['BTN_search']:
            //check if user is searching using name, payrollno, national id number or other fields
            $roomno = $_POST["search"];
            $res = find_room($roomno, $rooms);
            $roomid = $rooms['roomid'];
            break;
    }
}
if ($_GET['search'] || $_POST['roomno']) {
    $roomno = $_POST['roomno'];
    if ($_GET['search']) {
        $roomno = $_GET["search"];
    }
    $res = find_room($roomno, $rooms);
    $roomid = $rooms['roomid'];
    $_GET['search'] = 1;
}
$roomamenities = array();
get_roomamenities($roomamenities);
$allocated = array();
if ($roomid) {
    get_allocatedroomamenities($roomid, $allocated);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<link href="css/new.css" rel="stylesheet" type="text/css">
Example #3
0
$name = nick($space);
require 'http_client.php';
$stranger_ids = ids_except($space['uid'], ids_array(gp("stranger_ids")));
//陌生�?
$friend_ids = ids_array($space['friends']);
//好友
$buddy_ids = ids_array(gp("buddy_ids"));
//正在聊天的联系人
$new_messages = find_new_message();
for ($i = 0; $i < count($new_messages); $i++) {
    $msg_uid = $new_messages[$i]["from"];
    array_push($buddy_ids, $msg_uid);
    array_push($stranger_ids, $msg_uid);
}
$block_list = is_array($setting->block_list) ? $setting->block_list : array();
$rooms = find_room(gp("room_ids"));
$room_ids = ids_array($room);
foreach ($rooms as $key => $value) {
    if (in_array($key, $block_list)) {
        $rooms[$key]['blocked'] = true;
    } else {
        array_push($room_ids, $key);
    }
}
//Login webim server.
$nick = to_utf8($name);
$data = array('rooms' => join(',', $room_ids), 'buddies' => join(',', array_unique(array_merge($friend_ids, $stranger_ids))), 'domain' => $_IMC['domain'], 'apikey' => $_IMC['apikey'], 'endpoint' => $space['uid'], 'nick' => to_unicode($nick));
$client = new HttpClient($_IMC['imsvr'], $_IMC['impost']);
$client->post('/presences/online', $data);
$pageContents = $client->getContent();
//TODO: handle errors!