function sendMessage() { $gender = $this->input->post('gender'); $type = $this->input->post('type'); $message = substr($this->input->post('message'), 0, $GLOBALS['global']['INPUT_LIMIT']['random_message']); $sql = "SELECT u.id_user FROM " . TBL_USER . " u, " . TBL_FRIENDLIST . " f WHERE u.status=0 "; $cond = ''; if ($type == 'friend') { $my_id_user = getAccountUserId(); $cond .= " AND ( (u.id_user=f.id_user AND f.friend={$my_id_user}) OR ( f.friend=u.id_user AND f.id_user={$my_id_user}) ) AND f.request_type=0 "; } if ($gender != 'Both') { $cond .= " AND u.gender= '{$gender}'"; } $offset_result = $this->db->query(" SELECT FLOOR(RAND() * COUNT(*)) AS offset FROM " . TBL_USER . " u, " . TBL_FRIENDLIST . " f WHERE u.status=0 {$cond}")->result(); if (!$offset_result) { echo json_encode(array('result' => 'ERROR', 'message' => 'No such user found. Send failure.')); exit; } $offset = $offset_result[0]->offset; $res = $this->db->query(" SELECT u.id_user FROM " . TBL_USER . " u, " . TBL_FRIENDLIST . " f WHERE u.status=0 {$cond} LIMIT {$offset},1")->result(); if (!$res) { echo json_encode(array('result' => 'ERROR', 'message' => 'No such user found. Send failure.')); exit; } $id_user = $res[0]->id_user; $data['id_user_from'] = getAccountUserId(); $data['id_user_to'] = $id_user; $data['message'] = $message; $data['sentdate'] = mysqlDate(); if ($this->online_m->checkOnlineUser($id_user)) { //send chat message ... $data['type_message'] = 0; include_once './cometchat/cometchat_init.php'; sendMessageTo($data['id_user_to'], $data['message']); } else { //send email $data['type_message'] = 1; $this->email_sender->juzonSendEmail_RANDOMMESSAGEEMAIL($id_user, $message); } $this->mod_io_m->insert_map($data, TBL_RANDOM_MESSAGE); echo json_encode(array('result' => 'ok', 'message' => 'Send successfully.')); exit; }
function inviteusers() { global $chatrooms_language; global $close; global $embed; global $embedcss; foreach ($_POST['invite'] as $user) { sendMessageTo($user, "{$chatrooms_language[18]}<a href=\"javascript:jqcc.cometchat.joinChatroom('{$_POST['roomid']}','{$_POST['inviteid']}','{$_POST['roomname']}')\">{$chatrooms_language[19]}</a>"); } echo <<<EOD <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>{$chatrooms_language[18]}</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <link type="text/css" rel="stylesheet" media="all" href="../../css.php?type=module&name=chatrooms" /> </head> <body onload="{$close}"> <div class="container"> \t<div class="container_title {$embedcss}">{$chatrooms_language[21]}</div> \t<div class="container_body {$embedcss}"> \t\t{$chatrooms_language[16]}</span> \t\t<div style="clear:both"></div> \t</div> </div>\t </body> </html> EOD; }
function unbanusers() { global $chatrooms_language; global $close; global $embed; global $embedcss; if (!empty($_POST['unban'])) { foreach ($_POST['unban'] as $user) { $sql = "delete from cometchat_chatrooms_users where userid = '" . mysql_real_escape_string($user) . "' and chatroomid = '" . mysql_real_escape_string($_POST['roomid']) . "'"; $query = mysql_query($sql); sendMessageTo($user, "{$chatrooms_language[18]}<a href=\"javascript:jqcc.cometchat.joinChatroom('{$_POST['roomid']}','{$_POST['inviteid']}','{$_POST['roomname']}')\">{$chatrooms_language[19]}</a>"); } } echo <<<EOD <!DOCTYPE html> <html> \t<head> \t\t<title>{$chatrooms_language[18]}</title> \t\t<meta http-equiv="content-type" content="text/html; charset=utf-8"/> \t\t<link type="text/css" rel="stylesheet" media="all" href="../../css.php?type=module&name=chatrooms" /> \t</head> \t<body onload="{$close}"> \t\t<div class="container"> \t\t\t<div class="container_title {$embedcss}">{$chatrooms_language[21]}</div> \t\t\t<div class="container_body {$embedcss}"> \t\t\t\t{$chatrooms_language[16]} \t\t\t\t<div style="clear:both"></div> \t\t\t</div> \t\t</div>\t \t</body> </html> EOD; }
function inviteusers() { global $avchat_language; global $userid; global $close; global $embed; global $embedcss; global $lightboxWindows; if ($lightboxWindows == '1') { $embedcss = 'embed'; } foreach ($_POST['invite'] as $user) { sendMessageTo($user, "{$avchat_language[14]}<a href=\"javascript:jqcc.ccavchat.accept_fid('{$userid}','{$_POST['roomid']}')\">{$avchat_language[15]}</a>"); } echo <<<EOD <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>{$avchat_language[18]}</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <link type="text/css" rel="stylesheet" media="all" href="../../css.php?type=plugin&name=avchat" /> </head> <body onload="{$close}"> <div class="container"> \t<div class="container_title {$embedcss}">{$avchat_language[16]}</div> \t<div class="container_body {$embedcss}"> \t\t{$avchat_language[12]}</span> \t\t<div style="clear:both"></div> \t</div> </div>\t </body> </html> EOD; }
<div class="container_body {$embedcss}"> <div class="games">{$games_language[9]}</div> <div style="clear:both"></div> </div> </div> </div> </body> </html> EOD; } if ($_GET['action'] == 'accept') { sendMessageTo($_REQUEST['to'], $games_language[10] . " <a href='javascript:void(0);' onclick=\"javascript:jqcc.ccgames.accept_fid('" . $userid . "','" . $_REQUEST['tid'] . "','" . $_REQUEST['fid'] . "','" . $_REQUEST['rid'] . "','" . $_REQUEST['gameId'] . "','" . preg_replace('/[^a-zA-Z0-9]/', '', $_REQUEST['gameWidth']) . "');\">" . $games_language[11] . "</a>"); if (!empty($_GET['callback'])) { header('content-type: application/json; charset=utf-8'); echo $_GET['callback'] . '()'; } } if ($_GET['action'] == 'play') { $fid = $_GET['fid']; $tid = $_GET['tid']; $rid = $_GET['rid']; $gameid = intval($_GET['gameId']); $auth = $fid . $rid . '100' . $gameid . 'fdd4605ba06214842e3caee695bd2787'; $rid = urlencode($rid); global $userid; global $guestsMode; $name = "";
fclose($file); } else { $inputSocket = fopen('php://input', 'rb'); $jpg = stream_get_contents($inputSocket); fclose($inputSocket); fwrite($file, $jpg); fclose($file); } if (file_exists(dirname(dirname(dirname(__FILE__))) . "/plugins/handwrite/uploads/" . $randomImage . ".jpg")) { $linkToImage = BASE_URL . "plugins/handwrite/uploads/" . $randomImage . ".jpg"; $text = '<a href="' . $linkToImage . '" target="_blank" style="display:inline-block;margin-bottom:3px;margin-top:3px;"><img src="' . $linkToImage . '" border="0" style="padding:0px;display: inline-block;border:1px solid #666;" height="90" width="134"></a>'; if (substr($_REQUEST['tid'], 0, 1) == 'c') { $_REQUEST['tid'] = substr($_REQUEST['tid'], 1); sendChatroomMessage($_REQUEST['tid'], $handwrite_language[3] . "<br/>{$text}"); } else { sendMessageTo($_REQUEST['tid'], $handwrite_language[1] . "<br/>{$text}"); sendSelfMessage($_REQUEST['tid'], $handwrite_language[2] . "<br/>{$text}"); if (isset($_REQUEST['sendername']) && $pushNotifications == 1) { pushMobileNotification($handwrite_language[2], $_REQUEST['sendername'], $_REQUEST['tid'], $_REQUEST['tid']); } } } $embed = ''; $embedcss = ''; $close = "setTimeout('window.close()',2000);"; if (!empty($_REQUEST['embed']) && $_REQUEST['embed'] == 'web') { $embed = 'web'; $embedcss = 'embed'; $close = "parent.closeCCPopup('handwrite');"; } if (!empty($_REQUEST['embed']) && $_REQUEST['embed'] == 'desktop') {
function inviteusers() { global $broadcast_language; global $userid; global $close; global $embedcss; global $lightboxWindows; if ($lightboxWindows == '1') { $embedcss = 'embed'; } foreach ($_POST['invite'] as $user) { sendMessageTo($user, "{$broadcast_language[14]}<a href=\"javascript:jqcc.ccbroadcast.accept('{$userid}','{$_POST['roomid']}')\">{$broadcast_language[15]}</a>"); } echo <<<EOD <!DOCTYPE html> <html> <head> <title>{$broadcast_language[13]}</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <link type="text/css" rel="stylesheet" media="all" href="../../css.php?type=plugin&name=broadcast" /> </head> <body onload="{$close}"> <div class="container"> \t<div class="container_title {$embedcss}">{$broadcast_language[11]}</div> \t<div class="container_body {$embedcss}"> \t\t{$broadcast_language[13]}</span> \t\t<div style="clear:both"></div> \t</div> </div>\t </body> </html> EOD; }
} if (!(!isset($_FILES['Filedata']) || !is_uploaded_file($_FILES['Filedata']['tmp_name']))) { if (!move_uploaded_file($_FILES['Filedata']['tmp_name'], dirname(__FILE__) . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . $md5filename)) { $message = 'An error has occurred. Please contact administrator. Closing Window.'; $mediauploaded = 0; } } if (empty($message)) { if (!empty($_POST['chatroommode'])) { sendChatroomMessage($_POST['to'], $filetransfer_language[9] . " (" . $_FILES['Filedata']['name'] . "). <a href=\"" . BASE_URL . "plugins/filetransfer/download.php?file=" . $_FILES['Filedata']['name'] . "\" target=\"_blank\">" . $filetransfer_language[6] . "</a>"); } else { if (isset($_REQUEST['callbackfn']) && $_REQUEST['callbackfn'] == 'mobileapp') { sendMessageTo($_POST['to'], $filetransfer_language[5] . " (" . $_POST['name'] . "). <a href=\"" . BASE_URL . "plugins/filetransfer/download.php?file=" . $_POST['name'] . "\" target=\"_blank\" imageheight=\"" . $_POST['imageheight'] . "\" imagewidth=\"" . $_POST['imagewidth'] . "\">" . $filetransfer_language[6] . "</a>"); sendSelfMessage($_POST['to'], "<a href=\"" . BASE_URL . "plugins/filetransfer/download.php?file=" . $_POST['name'] . "\" target=\"_blank\" imageheight=\"" . $_POST['imageheight'] . "\" imagewidth=\"" . $_POST['imagewidth'] . "\">" . $filetransfer_language[6] . "</a>"); } else { sendMessageTo($_POST['to'], $filetransfer_language[5] . " (" . $_FILES['Filedata']['name'] . "). <a href=\"" . BASE_URL . "plugins/filetransfer/download.php?file=" . $_FILES['Filedata']['name'] . "\" target=\"_blank\">" . $filetransfer_language[6] . "</a>"); sendSelfMessage($_POST['to'], $filetransfer_language[7] . " (" . $_FILES['Filedata']['name'] . ")."); } } $message = $filetransfer_language[8]; } $embed = ''; $embedcss = ''; $close = "setTimeout('window.close()',2000);"; if (!empty($_GET['embed']) && $_GET['embed'] == 'web') { $embed = 'web'; $embedcss = 'embed'; $close = "parent.closeCCPopup('filetransfer');"; } elseif (!empty($_GET['embed']) && $_GET['embed'] == 'desktop') { $embed = 'desktop'; $embedcss = 'embed';
if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lang" . DIRECTORY_SEPARATOR . $lang . ".php")) { include dirname(__FILE__) . DIRECTORY_SEPARATOR . "lang" . DIRECTORY_SEPARATOR . $lang . ".php"; } if ($p_ < 3) { exit; } if ($_GET['action'] == 'request') { sendMessageTo($_REQUEST['to'], $whiteboard_language[2] . " <a href='javascript:void(0);' onclick=\"javascript:jqcc.ccwhiteboard.accept('" . $userid . "','" . $_REQUEST['id'] . "');\">" . $whiteboard_language[3] . "</a> " . $whiteboard_language[4]); sendSelfMessage($_REQUEST['to'], $whiteboard_language[5]); if (!empty($_GET['callback'])) { header('content-type: application/json; charset=utf-8'); echo $_GET['callback'] . '()'; } } if ($_GET['action'] == 'accept') { sendMessageTo($_REQUEST['to'], $whiteboard_language[6]); if (!empty($_GET['callback'])) { header('content-type: application/json; charset=utf-8'); echo $_GET['callback'] . '()'; } } if ($_GET['action'] == 'whiteboard') { $id = $_GET['id']; $type = 'whiteboard'; if (!empty($_GET['chatroommode'])) { if (!empty($_GET['subaction'])) { sendChatroomMessage($_GET['id'], $whiteboard_language[7] . " <a href='javascript:void(0);' onclick=\"javascript:jqcc.ccwhiteboard.accept('" . $id . "');\">" . $whiteboard_language[8] . "</a>"); } $id .= "chatroom"; } else { $id = abs($userid * $userid * $userid - $id * $id * $id) . "users";
include dirname(__FILE__) . DIRECTORY_SEPARATOR . "lang" . DIRECTORY_SEPARATOR . $lang . ".php"; } if ($p_ < 4) { exit; } if ($_GET['action'] == 'request') { $grp = $_REQUEST['id']; sendMessageTo($_REQUEST['to'], $screenshare_language[2] . " <a href='javascript:void(0);' onclick=\"javascript:jqcc.ccscreenshare.accept('" . $userid . "','" . $grp . "');\">" . $screenshare_language[3] . "</a> " . $screenshare_language[4]); sendSelfMessage($_REQUEST['to'], $screenshare_language[5]); if (!empty($_GET['callback'])) { header('content-type: application/json; charset=utf-8'); echo $_GET['callback'] . '()'; } } if ($_GET['action'] == 'accept') { sendMessageTo($_REQUEST['to'], $screenshare_language[6]); if (!empty($_GET['callback'])) { header('content-type: application/json; charset=utf-8'); echo $_GET['callback'] . '()'; } } if ($_GET['action'] == 'screenshare') { global $lightboxWindows; $id = $_GET['id']; $type = $_GET['type']; if (!empty($_GET['chatroommode'])) { sendChatroomMessage($_GET['roomid'], $screenshare_language[2] . " <a href='javascript:void(0);' onclick=\"javascript:jqcc.ccscreenshare.accept('" . $userid . "','" . $_GET['id'] . "');\">" . $screenshare_language[3] . "</a>"); } ini_set('display_errors', 0); $connectUrl = "rtmp://" . $hostAddress . "/" . $application; if ($screensharePluginType == '0') {
$apiSecret = '1022308838584cb6eba1fd9548a64dc1f8439774'; $apiServer = 'https://api.opentok.com/hl'; $apiObj = new OpenTokSDK($apiKey, $apiSecret); if (empty($_SESSION['avchat_token'])) { $_SESSION['avchat_token'] = $apiObj->generate_token(); } } if ($_REQUEST['action'] == 'request') { if ($videoPluginType == '2') { $location = time(); $session = $apiObj->create_session($location); $grp = $session->getSessionId(); } else { $grp = time(); } sendMessageTo($_REQUEST['to'], $broadcast_language[2] . " <a href='javascript:void(0);' onclick=\"javascript:jqcc.ccbroadcast.accept('" . $userid . "','" . $grp . "');\">" . $broadcast_language[3] . "</a> " . $broadcast_language[4]); sendSelfMessage($_REQUEST['to'], $broadcast_language[5]); if (!empty($_REQUEST['callback'])) { header('content-type: application/json; charset=utf-8'); echo $_REQUEST['callback'] . '()'; } } if ($_REQUEST['action'] == 'call') { $grp = $_REQUEST['grp']; } if ($videoPluginType < '2') { $sender = $_REQUEST['type']; if (!empty($_REQUEST['chatroommode'])) { if (empty($_REQUEST['join'])) { sendChatroomMessage($grp, $broadcast_language[17] . " <a href='javascript:void(0);' onclick=\"javascript:jqcc.ccbroadcast.join('" . $_REQUEST['grp'] . "');\">" . $broadcast_language[16] . "</a>"); }
} $session = $apiObj->create_session($location); $grp = $session->getSessionId(); } else { $grp = sha1(time() + $userid + 'from'); } sendMessageTo($_REQUEST['to'], $avchat_language[2] . " <a href='javascript:void(0);' onclick=\"javascript:jqcc.ccavchat.accept('" . $userid . "','" . $grp . "');\">" . $avchat_language[3] . "</a> " . $avchat_language[4]); sendSelfMessage($_REQUEST['to'], $avchat_language[5]); if (!empty($_REQUEST['callback'])) { header('content-type: application/json; charset=utf-8'); echo $_REQUEST['callback'] . '()'; } exit; } if ($_REQUEST['action'] == 'accept') { sendMessageTo($_REQUEST['to'], $avchat_language[6] . " <a href='javascript:void(0);' onclick=\"javascript:jqcc.ccavchat.accept_fid('" . $userid . "','" . $_REQUEST['grp'] . "');\">" . $avchat_language[7] . "</a>"); if (!empty($_REQUEST['callback'])) { header('content-type: application/json; charset=utf-8'); echo $_REQUEST['callback'] . '()'; } exit; } if ($_REQUEST['action'] == 'call') { if ($videoPluginType < '3') { $grp = $_REQUEST['grp']; if (!empty($_REQUEST['chatroommode'])) { if (empty($_REQUEST['join'])) { sendChatroomMessage($grp, $avchat_language[19] . " <a href='javascript:void(0);' onclick=\"javascript:jqcc.ccavchat.join('" . $_REQUEST['grp'] . "');\">" . $avchat_language[20] . "</a>"); } } if ($videoPluginType == '0') {