Thursday, October 16, 2014

phpFreeChat

<?php

require_once dirname(__FILE__)."/src/phpfreechat.class.php";

$params = array();

$params["title"] = "W4UOA Chatroom";


$params['channels'] = array('Main');


$params['time_offset'] = 60*60*1;  // advance time by 60 seconds


$params['timeout'] = 60000;  // set timeout to 60 minutes


//$params["nick"] = "guest".rand(1,1000);  // setup the intitial nickname


$params['firstisadmin'] = true;

//$params["isadmin"] = true; // makes everybody admin: do not use it on production servers ;)

//$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat


$params["serverid"] = md5("Chatroom"); // fixed serverid


$params["debug"] = false;


// set admin and password


$params['admins'] = array('w4uoa' => 'xxxxx');


$chat = new phpFreeChat( $params );


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>

<body>


  <div class="content">


  <?php $chat->printChat(); ?>


  <?php if (isset($params["isadmin"]) && $params["isadmin"]) { ?>

    <p style="color:red;font-weight:bold;">Warning: because of "isadmin" parameter, everybody is admin. Please modify this script before using it on production servers !</p>
  <?php } ?>

  </div>



<div class="footer">

  <span class="partners">-</span>
</div>
    
</body></html>

No comments: