• 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

want to link username fro a forum to chat but get white page

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

Post a reply
18 posts • Page 1 of 2 • 1, 2

Postby |PR3D4T0R| » Wed Jan 12, 2011 8:51 pm

can please someone help?

my script:

Code: Select all
<?php

 define('IN_PHPBB', true);
  $phpbb_root_path = '/srv/www/htdocs/forum/phpBB3'; // adjust this path to your forum installation root
  $chat_root_phpbbrealtive_path = '../../phpfreechat-1.3/index1.php'; // Chat url relative to phpBB root ;)
  include( $phpbb_root_path . 'extension.inc' );
  include( $phpbb_root_path . 'common.' . $phpEx );
  $userdata = session_pagestart($user_ip, PAGE_INDEX);
  init_userprefs($userdata);
  // redirect to phpBB logon page if the user is not logged in
  if ( !$userdata['session_logged_in'] )
    redirect(append_sid($phpbb_root_path . "login.$phpEx?redirect=" . $chat_root_phpbbrealtive_path . "index.$phpEx", true));

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "chat op mijn website";
$params['admins'] = array('Bart' => '*******', 'Matthijs => ********');
//$params["nick"] = "guest".rand(1,1000);  // setup the intitial nickname
//$params['firstisadmin'] = true;
//$params["isadmin"] = true; // makes everybody admin: do not use it on production servers ;)
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["debug"] = true;
$params["language"]          = "nl_NL";
$params["frozen_nick"]              = true;
$params["nick"]              = $userdata[username];
$params["theme"] = "msn";
$chat = new phpFreeChat( $params );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
 <head>
 </head>
 <body bgcolor="0c3350">
<div class="content">
  <?php $chat->printChat(); ?>   
</body></html>

my forum index is :

Code: Select all
/srv/www/htdocs/forum/phpBB3/index.php

and the chat is:
Code: Select all
/srv/www/htdocs/phpfreechat-1.3/index1.php

THX
Last edited by |PR3D4T0R| on Wed Jan 12, 2011 9:42 pm, edited 1 time in total.
|PR3D4T0R|
Member
 
Posts: 10
Joined: Wed Jan 12, 2011 8:38 pm
Top

Postby re*s.t.a.r.s.*2 » Wed Jan 12, 2011 9:17 pm

Code: Select all
$params['admins'] = array('Bart' => '*******', 'Matthijs' => '********');

above were missing the single quotes in array value, and

Code: Select all
$params["nick"]              = $userdata['username'];

and in the $userdata array too..

see if that make any differences.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby |PR3D4T0R| » Wed Jan 12, 2011 10:00 pm

when i do that i get an HTTP-error (500)
|PR3D4T0R|
Member
 
Posts: 10
Joined: Wed Jan 12, 2011 8:38 pm
Top

Postby re*s.t.a.r.s.*2 » Thu Jan 13, 2011 12:50 am

If there were a php error in the script you wouldn't get a 500 error but instead a PHP error, but the still the page would be available , I think you got something going on with your server...
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby |PR3D4T0R| » Thu Jan 13, 2011 7:29 pm

now changed the name from index1.php to index.php and adjusted my code to that, now get the white page again.

Code: Select all
<?php

 define('IN_PHPBB', true);
  $phpbb_root_path = '/srv/www/htdocs/forum/phpBB3'; // adjust this path to your forum installation root
  $chat_root_phpbbrealtive_path = '../../phpfreechat-1.3'; // Chat url relative to phpBB root ;)
  include( $phpbb_root_path . 'extension.inc' );
  include( $phpbb_root_path . 'common.' . $phpEx );
  $userdata = session_pagestart($user_ip, PAGE_INDEX);
  init_userprefs($userdata);
  // redirect to phpBB logon page if the user is not logged in
  if ( !$userdata['session_logged_in'] )
    redirect(append_sid($phpbb_root_path . "login.$phpEx?redirect=" . $chat_root_phpbbrealtive_path . "index.$phpEx", true));

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "chat op mijn website";
$params['admins'] = array("Bart" => "Bart123", "Matthijs => Matthijs123");
//$params["nick"] = "guest".rand(1,1000);  // setup the intitial nickname
//$params['firstisadmin'] = true;
//$params["isadmin"] = true; // makes everybody admin: do not use it on production servers ;)
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["debug"] = true;
$params["language"]          = "nl_NL";
$params["frozen_nick"]              = true;
$params["nick"]              = $userdata["username"];
$params["theme"] = "msn";
$chat = new phpFreeChat( $params );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
 <head>
 </head>
 <body bgcolor="0c3350">
<div class="content">
  <?php $chat->printChat(); ?>   
</body></html>
|PR3D4T0R|
Member
 
Posts: 10
Joined: Wed Jan 12, 2011 8:38 pm
Top

Postby re*s.t.a.r.s.*2 » Thu Jan 13, 2011 11:49 pm

See this here
Code: Select all
$params['admins'] = array("Bart" => "Bart123", "Matthijs => Matthijs123");

should be $params['admins'] = array("Bart" => "Bart123", "Matthijs " => "Matthijs123");

and you get a white page because the php error in not being output on the HTML but in your webserver Log..
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby |PR3D4T0R| » Wed Jan 19, 2011 8:24 pm

no difrence with what i have...
|PR3D4T0R|
Member
 
Posts: 10
Joined: Wed Jan 12, 2011 8:38 pm
Top

Postby OldWolf » Wed Jan 19, 2011 10:45 pm

|PR3D4T0R| wrote:no difrence with what i have...

Ah, well then you don't need his help I guess....

re*s.t.a.r.s.*2 wrote:See this here
Code: Select all
$params['admins'] = array("Bart" => "Bart123", "Matthijs => Matthijs123");

should be $params['admins'] = array("Bart" => "Bart123", "Matthijs" => "Matthijs123");

and you get a white page because the php error in not being output on the HTML but in your webserver Log..

:rolleyes:
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby |PR3D4T0R| » Fri Jan 21, 2011 5:07 pm

changed, now not doing anything difrent then normal index...

i am sorry for being a noob with webserver/php and stuff
|PR3D4T0R|
Member
 
Posts: 10
Joined: Wed Jan 12, 2011 8:38 pm
Top

Postby |PR3D4T0R| » Fri Jan 21, 2011 7:10 pm

tried a code i saw in another post:

Code: Select all
<?php

define('IN_PHPBB', true);
$phpbb_root_path = '../forum/phpBB3/'; // See phpbb_root_path documentation
$phpEx = substr(strrchr(__FILE__, '.'), 1); // Set the File extension for page-wide usage.
include($phpbb_root_path . 'common.' . $phpEx); // include the common.php file, this is important, especially for database connects.

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');

get_username_string ;
$oog = $user->data [username];

// redirect to phpBB logon page if the user is not logged in
if ($oog == "Anonymous")
    {
        header("Location: http://www.***************.*********.**********.***********.*******/forum/phpBB3/ucp.php?mode=login&sid=beeca66cd4a6318d0f600ac8cc9725da");
    }

$utz = $user->data['user_timezone']; // Get user's time zone information from phpBB3 account settings





require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Chat op mijn website";
$params['admins'] = array("Bart" => "Bart123", "Matthijs" => "Matthijs123");
//$params["nick"] = "guest".rand(1,1000);  // setup the intitial nickname
//$params['firstisadmin'] = true;
//$params["isadmin"] = true; // makes everybody admin: do not use it on production servers ;)
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
//$params["debug"] = true;
$params["language"]          = "nl_NL";
//$params["frozen_nick"]              = true;
$params["theme"] = "theme";

$chat = new phpFreeChat( $params );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
 <head>
 </head>
 <body bgcolor="000000">
<div class="content">
  <?php $chat->printChat(); ?>   
</body></html>

now it redirects me to loginpage but after i can still select name in chat
Last edited by |PR3D4T0R| on Fri Jan 21, 2011 7:18 pm, edited 1 time in total.
|PR3D4T0R|
Member
 
Posts: 10
Joined: Wed Jan 12, 2011 8:38 pm
Top

Postby re*s.t.a.r.s.*2 » Fri Jan 21, 2011 8:19 pm

You need to set the nickname string from the forum:

Code: Select all
$params["nick"] = $oog;

put it in the code above, where the $param["nick"] is commented, take the // slashes before it out and the place the code I wrote in this post...

dont forget to rehash..
Last edited by re*s.t.a.r.s.*2 on Fri Jan 21, 2011 8:19 pm, edited 1 time in total.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby zagor256 » Fri Jan 21, 2011 10:28 pm

try that code, and just add needed parameters (rooms, admins, etc). If you need, I can also integrate avatars from phpbb to phpfreechat and to automatically login admins from phpbb3.



Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = '../'; //path to phpbb3 forum
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

if (!$user->data['is_registered'])
{
   login_box('', 'You must be registered to use chat!');
}

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();

$params["title"] = "Quick chat";
$params["frozen_nick"] = true;
$params["nick"] = $user->data ['username'];
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["debug"] = false;
$chat = new phpFreeChat( $params );
?>
<!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>Chat</title>
 </head>
 <body>
  <?php $chat->printChat(); ?>   
</body></html>

Rehash chat or delete files from cache directory if you want any changes.
Last edited by zagor256 on Fri Jan 21, 2011 10:30 pm, edited 1 time in total.
my site: zasebni stiki
zagor256
Member
 
Posts: 23
Joined: Thu Jul 17, 2008 5:59 pm
Location: Slovenia
  • Website
Top

Postby |PR3D4T0R| » Sat Jan 22, 2011 3:55 pm

THX re*S.T.A.R.S*2 , i now want that admins get identified automaticly, is that possible?
Last edited by |PR3D4T0R| on Sat Jan 22, 2011 4:06 pm, edited 1 time in total.
|PR3D4T0R|
Member
 
Posts: 10
Joined: Wed Jan 12, 2011 8:38 pm
Top

Postby re*s.t.a.r.s.*2 » Sat Jan 22, 2011 6:11 pm

Ok put this code, overwriting $oog var.
Code: Select all
$oog = $user->data ['username'];
$user_id=$user->data['group_id'];

then, check what user ID you belong as admin in your forum, lets think you are level 1 the as you see in the code below there is the 1, copy paste and put it in a line below the commented //$params["isadmin"].
note : I am not saying that your admin level is # 1 , just find out which one are you..
Code: Select all
if ($user_id == 1)
{
    $params["isadmin"] = true;
}

then dont forget to "/rehash".
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby zagor256 » Sun Jan 23, 2011 12:28 am

Try this:

If you want phpbb admins to be also phpfreechat admins use that:

Code: Select all
if ($auth->acl_get('a_'))
{
    $params["isadmin"] = true;
}

If you want both admins and moderators from phpbb to be admins on phpfreechat use that:

Code: Select all
if ($auth->acl_get('a_') || $auth->acl_get('m_'))
{
    $params["isadmin"] = true;
}
my site: zasebni stiki
zagor256
Member
 
Posts: 23
Joined: Thu Jul 17, 2008 5:59 pm
Location: Slovenia
  • Website
Top

Next

Post a reply
18 posts • Page 1 of 2 • 1, 2

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 27 guests

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