<?php
define('IN_PHPBB', true);
$phpbb_root_path = '../forum/';
$chat_root_phpbbrealtive_path = '../chat/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "phpBB Forum Chat";
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["channels"] = array("General");
$params["language"] = "en_US";
$params["nick"] = ereg_replace("[[:space:]]", "_", $userdata[username]);
$params["nick"] = iconv("iso-8859-1", "UTF-8", $params["nick"]);
//$params["nick"] = iconv("windows-1251", "UTF-8", $userdata[username]);
$params["theme"] = "phpbb2";
//$params["frozen_nick"] = true;
$params['admins'] = array('admin' => 'admin');
$params["isadmin"] = false;
//$params["isadmin"] = true; // just for debug

//$params["debug"] = true;
$chat = new phpFreeChat( $params );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>
phpBB Forum Chat
</title>
<link rel="stylesheet" href="<?php echo($phpbb_root_path . 'templates/subSilver/subSilver.css'); ?>"
type="text/css" />
</head>
<body>
<?php
if($userdata['session_logged_in'])
{
echo('<span class="gen">');
echo('Hi '.$userdata['username'].'! <a href="' . $phpbb_root_path . 'login.php?logout=true&sid=' . $userdata['session_id'] . '&redirect=..%2Fphpfreechat%2F' . '">Logout</a>');
echo('</span>
');
?>
<div class="content">
<?php $chat->printChat(); ?>
</div>
<?php
}
else
{
?>
<span class="gen">Hi Guest!</span>
<form action="<?php echo($phpbb_root_path); ?>login.php" method="post" enctype="multipart/form-data">
<table width="400" cellpadding="4" cellspacing="1" border=
"0" class="forumline" align="center">
<tr>
<th height="25" class="thHead" nowrap="nowrap">
Please enter your username and password to log in.
</th>
</tr>
<tr>
<td class="row1">
<table border="0" cellpadding="3" cellspacing="1"
width="100%">
<tr>
<td colspan="2" align="center">
</td>
</tr>
<tr>
<td width="35%" align="right">
<span class="gen">Username:</span>
</td>
<td>
<input type="text" name="username" size="25"
maxlength="40" value="" />
</td>
</tr>
<tr>
<td align="right">
<span class="gen">Password:</span>
</td>
<td>
<input type="password" name="password" size=
"25" maxlength="32" />
</td>
</tr>
<tr align="center">
<td colspan="2">
<span class="gen">Log me on automatically each visit: <input type="checkbox" name="autologin"
value="ON" /></span>
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="hidden" name="redirect" value=
"../phpfreechat/index.php" /><input type="submit"
name="login" class="mainoption" value=
"Log in" />
</td>
</tr>
<tr align="center">
<td colspan="2">
<span class="gensmall"><a href=
"<?php echo($phpbb_root_path); ?>profile.php?mode=sendpassword"
class="gensmall">I forgot my password</a></span>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<?php
}
?>
</body>
</html>
The problem is, when I go to the chat room and I am not logged in. When I go to login, it will, but as soon as it logs in, it brings up the customized error 404 page. So then when I go back to the chat room, I'm logged in, but the problem is i have to press the go back button. When I logout, same error, but it works, you just have to go back. Please help me with this, I dont know what's wrong. THANKS ALL!