First off, I just wanted to compliment you on a nice program. I just recently started studying PHP, and this will give me something to practice with.
I just installed the 1.0.beta9 version on my website, embedded in a webpage.
Link http://www.sevenravens.dynip.com/index.php
The code I added to the page:
***These are first in the file ***
<?php
// create the customized command
require_once dirname(__FILE__)."/testchat1/src/pfccommand.class.php";
class pfcCommand_roll extends pfcCommand
{
function run(&$xml_reponse, $clientid, $msg)
{
$c =& $this->c;
$nick = $c->nick;
$container =& $c->getContainerInstance();
$text = trim($msg);
// Call parse roll
require_once dirname(__FILE__).'/testchat1/demo/demo27_dice.class.php';
$dice = new Dice();
if (!$dice->check($text))
{
$result = $dice->error_get();
$cmd =& pfcCommand::Factory("error", $c);
$cmd->run($xml_reponse, $clientid, "Cmd_roll failed: " . $result);
}
else
{
$result = $dice->roll();
$container->writeMsg($nick, $result);
}
if ($c->debug) pxlog("Cmd_roll[".$c->sessionid."]: msg=".$result, "chat", $c->getId());
}
}
// create the chat
require_once dirname(__FILE__)."/testchat1/src/phpfreechat.class.php";
$params = array();
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["title"] = "Sevenravens Chat box. See forum for more information.";
$params["nick"] = "guest".rand(1,1000);
$params["start_minimized"] = true;
$params["connect_at_startup"]=true;
$params["quit_on_closedwindow"]=true;
$params["timeout"]=5000;
//$params["debug"] = false;
$chat = new phpFreeChat( $params );
?>
Then added at the desired location for the box to appear I added:
<?php $chat->printChat(); ?>
I have the contents of the original zip file in the subdirectory testchat1
The issue I am having is that if I close the browser while connected to the chat, then open a new browser window, my old nick is still listed and the only way I can remove it is manually deleting the nick file. I tried to duplicate the error on the demo you have on your site, and it doesn't happen, so was wondering if there was something I needed to change to eliminate this problem. I tried the param["quit_on_closedwindow"] As you saw above, but this hasn't helped.
Any advice would be helpful.
Thank you.