MyBB Community Forums

Full Version: Who can help me with this (Photon Chat 5 integration)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

Recently I purchased a copy of Photon Chat 5 and I would like to integrate it with my Forum.

For this the creators of the script have al kinds of ready to use code available for Joomla, Wordpress, Vbuletin, even Phpbb but unfortunately no MyBB

The code for phpbb looks like this

<?php
global $user;
$retrieved_username = $user->data['username'];
?>

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="860" height="550" align="middle">
<param name="allowScriptAccess" value="sameDomain">
<param name="allowFullScreenInteractive" value="true">
<param name="movie" value="chat.swf?username=<?php echo $retrieved_username ?>">
<param name="menu" value="false">
<param name="quality" value="best">
<param name="bgcolor" value="#2D2D2D">
<embed src="chat.swf?username=<?php echo $retrieved_username ?>" menu="false" quality="best" bgcolor="#2D2D2D" width="860" height="550" align="middle" allowScriptAccess="sameDomain" allowFullScreenInteractive="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer">
</object>

And it states:
Quote: PHPBB CODE
The top part of the code retrieves the member's username from phpBB. The bottom part places the chat client into your website. The username is passed to the chat.swf to execute the member auto-login.

Does anyone here have an idea how I can use such a code with Mybb?

Any help is appreciated
Nobody has an idea? I need help specifically with this part of the code:

<?php
global $user;
$retrieved_username = $user->data['username'];
?>

How would that code look when applied on the way my BB works. according to the creators of Photon Chat

Quote:Every CMS, forum, dating script or other system with a member database, stores the member's username and profile picture (if available) data in a temporary session array or global variable after the member has successfully logged into the website with their account. This member data needs to be retrieved and passed to the chat client to execute the member auto-login procedure.

Any ideas at all???

Thx in advance Smile
it can be like this (change path for global.php file as required)
<?php
define (IN_MYBB,1);
require_once 'global.php';
global $mybb;

$retrieved_username = $mybb->user['username']; 
// any other required code
?>
(2013-12-22, 12:20 PM).m. Wrote: [ -> ]it can be like this (change path for global.php file as required)
<?php
define (IN_MYBB,1);
require_once 'global.php';
global $mybb;

$retrieved_username = $mybb->user['username']; 
// any other required code
?>

Thanks! I am going to put it to the test Smile

No luck so far.

The code I used

<?php
define (IN_MYBB,1);
require_once '../forums/global.php';
global $mybb;

$retrieved_username = $mybb->user['username']; 
// any other required code
?>

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="860" height="550" align="middle">
<param name="allowScriptAccess" value="sameDomain">
<param name="allowFullScreenInteractive" value="true">
<param name="movie" value="chat.swf?username=<?php echo $retrieved_username ?>">
<param name="menu" value="true">
<param name="quality" value="best">
<param name="bgcolor" value="#2D2D2D">
<embed src="chat.swf?username=<?php echo $retrieved_username ?>" menu="true" quality="best" bgcolor="#2D2D2D" width="860" height="550" align="middle" allowScriptAccess="sameDomain" allowFullScreenInteractive="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer">
</object>

Produces the chat but doesn't auto login using the forum credentials.

For those interested the test chat can be found at http://urubin.com/chat/tchat.php and I am trying to make it auto login from the forum here: http://urubin.com/forums/index.php

Any ideas as to where I messed up? Toungue
^ appears like cookie issue - see replies here - you may have to change MyBB forum cookie path to /
(2013-12-22, 02:42 PM).m. Wrote: [ -> ]^ appears like cookie issue - see replies here - you may have to change MyBB forum cookie path to /

Dude(I think you are? Big Grin ) That worked like a charm! Thank you very much! Much obliged Smile

Looks like I traded one problem for another LOL Now I have the auto login working perfectly but can't logout of the forum anymore Big Grin

From what I read at http://community.mybb.com/thread-42123.html I need the /forum/ path in the cookies to log out of the forum but I need it to be / in order for the chat to work properly.

Anyone have any ideas on how to solve that one? Toungue