• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

cannot redeclare issue in 1b9 (+phpbb)

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
6 posts • Page 1 of 1

Postby shacknasty » Mon Feb 26, 2007 11:30 am

Hi,

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);
?>
Last edited by shacknasty on Mon Feb 26, 2007 11:31 am, edited 1 time in total.
shacknasty
Member
 
Posts: 16
Joined: Tue Oct 24, 2006 8:32 am
Top

Postby shacknasty » Tue Feb 27, 2007 5:03 am

Does this have something to do with what is in the release notes

"Thanks to this improvement, the chat is easier to integrate because printStyle() and printJavascript() function are removed, you just need to call printChat() in your html body where you want the chat appears."

?
shacknasty
Member
 
Posts: 16
Joined: Tue Oct 24, 2006 8:32 am
Top

Postby phpfreechat » Tue Feb 27, 2007 2:14 pm

I don't understand your error message ..., however, you can replace these lines :
$chat_header = $chat->printJavascript('true');
$chat_header .= $chat->printStyle('true');
$chat_header = $chat->printJavascript('true');
$chat_header .= $chat->printStyle('true');
by :
$chat_header .= $chat->printStyle(true);

maybe it could help
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby shacknasty » Wed Feb 28, 2007 1:08 am

hmm, quite strange. When I make that change, then refresh the chat page, I receive these errors ONLY THE FIRST TIME. then if I refresh again, I get the same error as above.

Code: Select all
Warning: opendir(/data/users/punkas/forums.punkas.com/htdocs/chat1b9/src/../data/public/js): failed to open dir: No such file or directory in /data/users/punkas/forums.punkas.com/htdocs/chat1b9/src/pfcglobalconfig.class.php on line 323

Warning: readdir(): supplied argument is not a valid Directory resource in /data/users/punkas/forums.punkas.com/htdocs/chat1b9/src/pfcglobalconfig.class.php on line 324

Warning: closedir(): supplied argument is not a valid Directory resource in /data/users/punkas/forums.punkas.com/htdocs/chat1b9/src/pfcglobalconfig.class.php on line 337

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /data/users/punkas/forums.punkas.com/htdocs/chat1b9/src/pfcglobalconfig.class.php:323) in /data/users/punkas/forums.punkas.com/htdocs/chat1b9/src/pfcuserconfig.class.php on line 25

Fatal error: Cannot redeclare getscriptfilename() (previously declared in /data/users/punkas/forums.punkas.com/htdocs/chat1b9/src/pfctools.php:41) in /data/users/punkas/forums.punkas.com/htdocs/chat/src/pfctools.php on line 39
shacknasty
Member
 
Posts: 16
Joined: Tue Oct 24, 2006 8:32 am
Top

Postby shacknasty » Thu Mar 29, 2007 3:26 am

I am still receiving this same error with v1 beta 10, does anyone have any clues as to how I could solve this?

Am using the chat integrated with phpbb, and up untill b9 it was working fine. my chat.php looks like this

Code: Select all
<?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__)."/chat1b10/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"]    = "punkasa";
$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'  => '*****',
                          '.' => '*****',
                          's' => '*****');

    $chat = new phpFreeChat( $params );

$chat_header .= $chat->printStyle(true);
    $chatroom = $chat->printChat('true');
}
else
{
    $chatroom = "Please <a href="login.php?redirect=chat.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);
?>
shacknasty
Member
 
Posts: 16
Joined: Tue Oct 24, 2006 8:32 am
Top

Postby shacknasty » Thu Mar 29, 2007 3:46 am

Alright im not sure WHY that happens, but if i just delete the old version and replace it with this one it works. just cant run 2 at the same time
shacknasty
Member
 
Posts: 16
Joined: Tue Oct 24, 2006 8:32 am
Top


Post a reply
6 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 8 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub