MyBB Community Forums

Full Version: PHPfreechat users and history
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I installed phpfreechat (now about my fifth chat attempt) specifically because it claims to allow numerous rooms with unique access but now I cant get any of that established.

I am using the plugin by RII and the chat loads up and user names are recognised but I need help to solve the following 3 issues:

A, Setup a second room
B, Change the rooms access from 1 (all registered users) to 8 (my custom users)
C, The list of usernames is right slap bang in the middle of the chat.

If A and B isnt possible then even changing the default access would do

My code is:

<?php
define("IN_MYBB", 1);
require_once "../global.php";
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();

$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["title"] = "Welcome to Command & Control";
$params["frozen_nick"] = true;

// setup the intitial nickname
if ($mybb->user['usergroup'] > 1) // user is not a guest
{
$params["nick"] = "".$mybb->user['username']; // match logged in user
}
else
{
/* // if you want guests to enter chat change the error_no_permission(); with that one:
$params["nick"] = "guest".rand(1,10000); // randomly create a nick for the guest
*/
error_no_permission();
}

if ( ($mybb->user['usergroup'] == 3) || // 3: Supermod -- ok
($mybb->user['usergroup'] == 4) || // 4: Admin -- ok
($mybb->user['usergroup'] == 6) // 6: Moderator -- ok
)
{
$params["isadmin"] = true; // set admin privs
}
else
{
$params["isadmin"] = false; // NO admin privs
}

//$params["isadmin"] = true; // do not use it on production servers Wink
//$params["debug"] = true;

//changing this will slow the chat
$params["shownotice"] = 0;
//parameters you can change
$params["max_channels"]=10;
$params["max_privmsg"]=5;
$params["channels"] = array("Lounge");
$params["frozen_channels"] = array("Lounge");
$params["max_displayed_lines"] = 50;

$chat = new phpFreeChat( $params );

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
</head>
<body>
<table width=100% height=100% border=0 cellspacing=2 cellpadding=2>
<tr><td>
<?php $chat->printChat(); ?>
</td></tr>
</table>
</body>
</html>

And the chat looks like this:
[attachment=17064]