Login

  1. LiveChat
  2. Create/manage secure chat
  3. phpBB2 MOD
  4. phpBB3 MOD
  5. Drupal source code
  6. vBulletin source code
  7. Generic PHP source code

Using secure chat rooms with Drupal 4, 5

Create a secure chat room and recieve an authorization key using  Create/manage secure chat room

Using the chat room in a page/block
Create a page/block and select Input format as PHP

<?
global $user;

if($GLOBALS['userKeyDefined'] != 1)  {
 $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 = $user->name;
  $usernickz = $userz;
  $userkey = userKey($usernickz, $roomkey);
  foreach($gagaadmins as $value)  {
    if($userz == $value)  {
      $userkey = md5(userKey($usernickz, $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>
<?
}
?>

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.

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>
<scr
ipt 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
</scr
ipt><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></noscr
ipt>


and using the drupal administer menu create a block(select Input format as PHP) with the following code and add as a footer

After the user logs in the flash in the footer will send a message internally to the chat room flash and change the users nick automatically without refreshing the frame
<?
global $user;

if($GLOBALS['userKeyDefined'] != 1)  {
 $GLOBALS['userKeyDefined'] = 1;
  function userKey($user, $roomKey)  {
    return md5(md5($user . $roomKey) . $roomKey);
  }
}

$chatroom = "Secure chat room name here";
$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 = $user->name;
$usernickz= $userz;
$userkey = userKey($usernickz, $roomkey);
foreach($gagaadmins as $value)  {
  if($userz == $value)  {
    $userkey = md5(userKey($usernickz, $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.