Code:
<?php
//error_reporting(E_ALL);
//ini_set('display_errors','On');
include dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR."plugins.php";
global $userid;
global $db;
global $language;
if ($_GET['action'] == 'request') {
$toId = $_POST['to'];
$random_from = md5(getTimeStamp()+$userid+'from');
$random_to = md5(getTimeStamp()+$toId+'to');
sendMessageTo($toId,"has sent you an audio/video chat request. Click <a href='javascript:;' onclick=\"javascript:jqcc.ccvideocall.accept('".$userid."','".$random_from."','".$random_to."','0');\">here</a> to accept it or simply ignore this message.");
sendSelfMessage($toId,"has successfully sent an audio/video chat request.");
}
if ($_GET['action'] == 'accept') {
sendMessageTo($_POST['to'],"has accepted your audio/video chat request. <a href='javascript:;' onclick=\"javascript:jqcc.ccvideocall.accept_fid('".$userid."','".$_POST['fid']."','".$_POST['tid']."','1');\">Click here</a> to launch the AV window!");
}
if ($_GET['action'] == 'call') {
$random_from = $_GET['fid'];
$random_to = $_GET['tid'];
$sender = $_GET['sender'];
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>Audio/Video Chat</title>
<style>
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
text-align: center;
}
html {
height: 100%;
overflow: hidden; /* Hides scrollbar in IE */
}
body {
height: 100%;
margin: 0;
padding: 0;
}
#flashcontent {
height: 100%;
}
</style>
</head>
<body>
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0'
width='690' height='548' id='tinychatp2p' align='top'>
<param name='allowScriptAccess' value='always' />
<param name='allowFullScreen' value='true' />
<param name='movie' value='http://p2p.tinychat.com/tinychatp2p.swf' />
<param name='menu' value='false' />
<param name='quality' value='high' />
<param name='scale' value='noscale' />
<param name='salign' value='tl' />
<param name='wmode' value='transparent' />
<param name='flashvars' value='room={$random_from}' />
<embed src='http://p2p.tinychat.com/tinychatp2p.swf' menu='false' quality='high' scale='noscale' salign='t' wmode='transparent' FlashVars='room={$random_from}' width='690' height='548'
name='tinychatp2p' align='top' allowScriptAccess='always' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />
</object>
</body>
</html>
EOD;
}
?>