1. Setting the nick via URL only works the first time. After that, nick is pulled from the cache, despite it being a (theoretically) dynamic variable.
2. Setting the room via URL NEVER works. I really can't understand why.
Here is link to the room:
http://www.mathim.com/chatEngine/index. ... oom&sn=Ned
Here is link to a page that will delete all the stored data in /data/private/:
http://www.mathim.com/chatEngine/flush.php
Here is code to the index.php page
- Code: Select all
<?php
require_once "../config.php";
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$sn = $_GET["sn"];
$room = strval($_GET["room"]);
$invite = $_GET["invite"];
$channels = array($_GET["room"]);
$params = array();
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["title"] = $conf_slogan;
if($room != "")
{
$params["channels"] = $channels;
}
if($sn != "") $params["nick"] = $sn; // setup the intitial nickname
$params["frozen_nick"] = false; // do not allow to change the nickname
$params["shownotice"] = 3; // 0 = nothing, 1 = just nickname changes, 2 = connect/quit, 3 = nick + connect/quit
$params["max_nick_len"] = 20; // nickname length could not be longer than 10 caracteres
$params["max_text_len"] = 300; // a message cannot be longer than 50 caracteres
$params["max_channels"] = 3; // limit the number of joined channels tab to 3
$params["max_privmsg"] = 3; // limit the number of private message tab to 1
$params["max_msg"] = 15; // max message in the history is 15 (message seen when reloading the chat)
#$params["height"] = "450px"; // height of chat area is 230px
#$params["width"] = "800px"; // width of chat area is 800px
$params["debug"] = true; // activate debug console
$params["connect_at_startup"] = true;
$params["start_minimized"] = false;
$params["nickmarker"] = true;
$params["showsmileys"] = false;
$params["showsmileys"] = false;
$params["clock"] = true;
$params["data_public_url"] = "/chatEngine/data/public";
$params["server_script_url"] = "/chatEngine/index.php";
$chat = new phpFreeChat( $params );
print "<b>Extra Debugging :</b><br>n";
print "<b>Params:</b><br>";
print_r($params);
print "<br><b>_GET:</b> <br>";
print_r($_GET);
print "n<br><b>Room:</b> $roomn";
print "n<br><b>Channels:</b>";
print_r($channels);
$c =& pfcGlobalConfig::Instance();
print_r($c->channels);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>MathIM:
<?php
if($params["channel"] !="") print $params["channel"];
else print $conf_slogan;
?>
</title>
</head>
<body>
<?php require_once "../theme/header.php"?>
<div class="content">
<?php $chat->printChat(); ?>
</div>
</body></html>
Please help me make this program behave. Thanks.