• 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

wont join channel on first go integrated with phpBB

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

Post a reply
4 posts • Page 1 of 1

Postby radionow » Sat Jan 29, 2011 2:08 am

Hello everyone,
I'm a noob at php so bare with me here. I have been working to integrate pfc with phpBB3. I've been following the session integration instructions on this site and on the phpBB website. I have PFC grabbing the nicknames successfully, yay :D.... however, I have ran into a problem :(

While it grabs the nickname correctly, it wont join the channel on the first visit to chat.
Eg. If i sign into phpBB and join chat, it connects to chat with my nickname, but no channel opens. If I refresh the page, then it joins the channel successfully, and everytime I refresh chat after that, it will join the channel successfully, like its suppose to. However, if i logout of phpBB and log back in, I get the same issue, I have to refresh chat once again before it will join the channel. As you see below in my code provided, the channel it should join is called "Public".

Any ideas anybody? Here is my Index.php code...

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

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

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "ChickenTalk.org Chat";
$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["frozen_nick"]              = true;
$params["nick"]              = $user->data['username'];
$params["theme"] = "msn";
$params["channels"] = array("Public");
$chat = new phpFreeChat( $params );

?>

Its a simple integration with phpBB, no redirect if the user is not logged in but I think I can handle doing that on my own. Thats not my issue. my issue is it wont join channel "Public" on first chat visit, i have to refresh. Any ideas anybody?
Last edited by radionow on Sat Jan 29, 2011 2:10 am, edited 1 time in total.
My Site: http://chickentalk.org/
radionow
Member
 
Posts: 57
Joined: Sun Jan 10, 2010 6:26 pm
Top

Postby re*s.t.a.r.s.*2 » Sat Jan 29, 2011 3:01 pm

If you take the integration out form the script or comment, does connect you automatically to the channel?

I dont see how get in the user string wouldn't connect you to channel all at once..

or play with $paramas['connect_at_startup']=TRUE;

rehash and check if that makes any difference.
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 radionow » Sat Jan 29, 2011 4:58 pm

hey utan,
I will try that parameter, i thought it was set to true by default? when I take the integration out it seems to work fine.

I have narrowed down the issue to this:
If I navigate away from the page without logging out of chat, logout the forums and log back into the forums under a different account, then re-enter into chat, then it wont join the channel. If I quit chat properly before logging out the forums, or if someone else is in the chat and I timeout, then when I come back to chat under a different name, I don't have the issue.


PS. Sorry i left chat earlier today so fast, I was on dialup at the time and someone wanted the phone :/
My Site: http://chickentalk.org/
radionow
Member
 
Posts: 57
Joined: Sun Jan 10, 2010 6:26 pm
Top

Postby re*s.t.a.r.s.*2 » Sat Jan 29, 2011 5:45 pm

As I told you when we met at your chat,

There is a session issue here,

what you need to do is send the logout request in PFC,
Code: Select all
onclick="pfc.connect_disconnect()"

use the a link with "onclick" event then this triggers the pfc disconnect function..

but there is not a reliable way to do it..
because this can also be done with onunload event but also sometimes fails, usually a user dont go around with that many registered nicks...

PFC dont have a proper way to log out... only way is if the end user wants to leave and do change nick then he must press the logout button on PFC on a link you can provide...
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


Post a reply
4 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 22 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