I have version 1b8 working fine integrated with phpbb, but with 1b9 (i simply change the dirname(__FILE__) path in the code) i receive the following error
- Code: Select all
Fatal error: Cannot redeclare getscriptfilename() (previously declared in /data/users/punkas/forums.testsite.com/htdocs/chat1b9/src/pfctools.php:41) in /data/users/punkas/forums.testsite.com/htdocs/chat/src/pfctools.php on line 39
Does anyone know how I could fix this?
- Code: Select all
chat.php
<?php
/***************************************************************************
* AJAX CHATROOM MOD chatroom.php
* -------------------
* begin : 01/03/06
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
//
$params = array();
// SET YOUR PARAMS HERE
if ( $userdata['session_logged_in'] == TRUE)
{
require_once dirname(__FILE__)."/chat1b9/src/phpfreechat.class.php"; // Set to the correct directory for your install. Relative to the forum directory.
$params['nick'] = $userdata['username']; // setup the intitial nickname
//$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["serverid"] = "punkas2"; // calculate a unique id for this chat
$params["frozen_nick"] = true;
$params["theme"] = "phpbb2";
$params['skip_proxies'] = array( "censor" );
$params["title"] = " ";
$params["max_nick_len"] = 20;
$params["max_msg"] = 200;
$params["channels"] = array("PunkAs");
$params['admins'] = array('phaedrus' => 'p234234',
's' => 'p2342343');
$chat = new phpFreeChat( $params );
$chat_header = $chat->printJavascript('true');
$chat_header .= $chat->printStyle('true');
$chatroom = $chat->printChat('true');
}
else
{
$chatroom = "Please <a href="login.php?redirect=chat2.php">login</a> to access the Chatroom.";
}
$page_title = $lang['Chat_Room'];
$template->assign_vars(array(
'CHATROOM' => $chat_header));
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'chatroom.tpl')
);
$template->assign_vars(array(
'CHATROOM_CODE' => $chatroom));
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>