- LiveChat
- Create/manage secure chat
- phpBB2 MOD
- phpBB3 MOD
- Drupal source code
- vBulletin source code
- Generic PHP source code
Generic PHP source code example for membership linkage if($GLOBALS['userKeyDefined'] != 1) { When logged in as a chat adminstrator if you send BANIP to a user as a message their IP will be banned for several hours. To clear all banned IPs send a message to yourself(or any user) as CLEARIP. To temporarily give chat administration access to another user send them a message as GIVEOP, and to take back administration access send TAKEOP. If you wish the recent chat log send a message to yourself(or any user) as CLEARLOG. if($GLOBALS['userKeyDefined'] != 1) { $chatroom = "Secure chat room name here";
Create a secure chat room and recieve an authorization key using Create/manage secure chat room
Using the chat room wthin a page
<?
global $user;
$GLOBALS['userKeyDefined'] = 1;
function userKey($user, $roomKey) {
return md5(md5($user . $roomKey) . $roomKey);
}
}
if(true){
$chatroom = "Secure chat room name here";
$roomkey = "Secure chat room authorization key here";
$gagaadmin = "Chat room administrator IDs here. For multiple adminstrators seperate with ,(commas).";
$heightz = 400;
$gagaadmin = preg_replace('/\s*,\s*/', ',', $gagaadmin);
$gagaadmins = split(',', $gagaadmin);
$userz = "The user ID, this would for example be queried from a database";
$usernickz = "The user nick name, this would for example be queried from a database";
$userkey = userKey($usernickz, $roomkey);
foreach($gagaadmins as $value) {
if($userz == $value) {
$userkey = userKey(userKey($usernickz, $roomkey), $roomkey);
}
}
$usernickz = urlencode($usernickz);
?>
<center>
<script src="http://en.gagalive.com/Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','100%','height','<?=$heightz?>','title','GagaLive chat room','src','http://en.gagalive.com/livechat1?&chatroom=<?echo $chatroom?>&user=<?echo $usernickz?>&encrypt=<?echo $userkey?>','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','http://en.gagalive.com/livechat1?&chatroom=<?echo $chatroom?>&user=<?echo $usernickz?>&encrypt=<?echo $userkey?>' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100%>" height="<?=$heightz?>" title="GagaLive chat room">
<param name="movie" value="http://en.gagalive.com/livechat1.swf?&chatroom=<?echo $chatroom?>&user=<?echo $usernickz?>&encrypt=<?echo $userkey?>">
<param name="quality" value="high">
<embed src="http://en.gagalive.com/livechat1.swf?&chatroom=<?echo $chatroom?>&user=<?echo $usernickz?>&encrypt=<?echo $userkey?>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100%" height="<?=$heightz?>"></embed>
</object></noscript>
<?
}
?>
Note that if the chat room is empty, the chat room is deleted and the IP ban list is also reset.
For use in a seperate frame
If you want to use the chat room in a seperate frame
Put the following HTML in the frame that should have the chat room
<script src="http://en.gagalive.com/Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','90%','height','150','title','GagaLive chat room','src','http://en.gagalive.com/livechat1?chatroom=ChatroomName','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','http://en.gagalive.com/livechat1?chatroom=ChatroomName' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="90%" height="150" title="GagaLive chat room">
<param name="movie" value="http://en.gagalive.com/livechat1.swf?chatroom=ChatroomName">
<param name="quality" value="high">
<embed src="http://en.gagalive.com/livechat1.swf?chatroom=ChatroomName" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="90%" height="150"></embed>
</object></noscript>
Use the following HTML after the user logs in which would usually be placed in a different frame as the chat frame where the CMS or membership system is in.
After the user logs in the flash in the current frame will send a message internally to the chat room flash and change the users nick automatically without refreshing the frame
<?
global $user;
$GLOBALS['userKeyDefined'] = 1;
function userKey($user, $roomKey) {
return md5(md5($user . $roomKey) . $roomKey);
}
}
$roomkey = "Secure chat room authorization key here";
$gagaadmin = "Chat room administrator IDs here. For multiple adminstrators seperate with ,(commans).";
$gagaadmin = preg_replace('/\s*,\s*/', ',', $gagaadmin);
$gagaadmins = split(',', $gagaadmin);
$userz = "The user ID, this would for example be queried from a database";
$usernickz = "The user nick name, this would for example be queried from a database";
$userkey = userKey($usernickz, $roomkey);
foreach($gagaadmins as $value) {
if($userz == $value) {
$userkey = userKey(userKey($usernickz, $roomkey), $roomkey);
}
}
$usernickz = urlencode($usernickz);
?>
<embed height="0" width="0" src="http://en.gagalive.com/livechat1_login.swf?chatroom=<?echo $chatroom ?>&user=<?echo $usernickz?>&encrypt=<?echo $userkey?>"></embed>
When logged in as a chat adminstrator if you send BANIP to a user as a message their IP will be banned for several hours. To clear all banned IPs send a message to yourself(or any user) as CLEARIP. To temporarily give chat administration access to another user send them a message as GIVEOP, and to take back administration access send TAKEOP. If you wish the recent chat log send a message to yourself(or any user) as CLEARLOG.
Note that if the chat room is empty, the chat room is deleted and the IP ban list is also reset.
