• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ phpBB, Simple Machines Forum (SMF), and Forum Software (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

The Bridge didnt wotk

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

Post a reply
14 posts • Page 1 of 1

Postby Blubbs » Thu Apr 16, 2009 12:59 am

Hello there,

I wanted to use the SMF<->PhpFreeChat Bridge.

I did make an new index.php as mentioned in other Threads here. The only thing i see. Is a blank Page with this Source Code:

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Title</title>
      </head>
   
  <body>
   
  </body>

</html>

This is my index.php:

Code: Select all
<?php

/////////////////////////////////////////////////////////////////////////////////

// Include SSI.php. It is relative path! Chenge it for your path
require(dirname(__FILE__) . '/../SSI.php');

$user_info = ssi_welcome('array');

if (!$user_info['is_guest'])
{
    require_once dirname(__FILE__)."/src/phpfreechat.class.php";

    /////////////////////////////////////////////////////////////////////////////////

    $params = array();

    // Some initializations are going here
    // ......................................

    // Setup user nickname
    $params["nick"]     = $user_info['is_guest'] ? "Guest-" . rand(1, 1000) : $user_info['name'];

    // Other initializations are going here
    // ......................................

    /////////////////////////////////////////////////////////////////////////////////
    require_once dirname(__FILE__)."/src/phpfreechat.class.php";
   $params["title"]                = "T6Chat";
   $params["max_msg"]              = 21;
   $params["clock"]                = true;
   $params["serverid"]             = md5(__FILE__);           
   $params["language"]             = "de_DE-informal";
   $params["isadmin"]              = false;
   $params["theme"]            = t6chat;
   $params["btn_sh_whosonline"]   = false;
   $params["connect_at_startup"]   = true;
   $params["display_ping"]         = false;
   $params["startwithsound"]      = false;
   $params["shownotice"]         = 0;
   $params["nickmeta_private"]    = array('ip');
   $params["channels"]              = array("T6Chat");
   $params["frozen_channels"]       = array("T6Chat");
   $params["nickname_colorlist"]   = array('#961616');
   $params["bbcode_colorlist"]     = array('961616');
   $params["nickmarker"]         = false;
   $params["showsmileys"]         = false;
   $params["clock"]             = true;
   $params['admins'] = array('Nicole'  => 'xxxx',
                          'Admin' => 'xxxxxx');
   $params['skip_proxies'] = array('censor');
    $chat = new phpFreeChat($params);
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Your title is going here</title>
    <?php
        if (!$user_info['is_guest'])
        {
            $chat->printJavascript();
            $chat->printStyle();

            // Style sheet
            echo '<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/style.css" />';
        }
     ?>
  </head>
   
  <body>
    <?php
        if ($user_info['is_guest'])
        {
            // Some actions for not registered users are going here
        }
        else
        {
            $chat->printChat();
        }
    ?>

  </body>
</html>

The Chatscript is located in one subdirectiory of the SMF Installation.

I didnt use the SQL way to store the Chatmessages. The Script uses the Default Way. He stores his Message in Files.

Maybe i didnt see a tiny thing.

Any Help would be great.

Thanks in advance,

Blubbs
Last edited by Blubbs on Fri Apr 17, 2009 3:02 am, edited 1 time in total.
Blubbs
Member
 
Posts: 22
Joined: Mon Feb 16, 2009 6:09 pm
Top

Postby OldWolf » Thu Apr 16, 2009 5:19 am

A link would help so I can see what you're talking about for myself.
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 Blubbs » Thu Apr 16, 2009 5:36 am

Hello,

here is the smf.php:

http://telefonsexforum.de/Chat/smf.php

here is the working Chat.

http://telefonsexforum.de/Chat/index.php

Blubbs
Blubbs
Member
 
Posts: 22
Joined: Mon Feb 16, 2009 6:09 pm
Top

Postby OldWolf » Fri Apr 17, 2009 2:52 am

Ok, I'd like to be completely clear:
You're saying that this file:
http://telefonsexforum.de/Chat/smf.php

Contains the php code you posted on the top (second code chunk)... is this correct? Have you viewed the code from the server's side to make sure that it contains exactly that?

OldWolf
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 Blubbs » Fri Apr 17, 2009 3:05 am

Hello,

seems i C&P the wrong piece of Code. Excuse. I pasted the Original index.php.

I've corrected this in the Posting. Now you can see the smf.php.

I didnt put in the Layout and Design things. Only the config and SMF Bridge Code.

Thanks,

Blubbs
Last edited by Blubbs on Fri Apr 17, 2009 3:08 am, edited 1 time in total.
Blubbs
Member
 
Posts: 22
Joined: Mon Feb 16, 2009 6:09 pm
Top

Postby OldWolf » Sat Apr 18, 2009 12:03 am

There ya go, that's why... my bet is $user_info['is_guest'] is empty:

<?php
if ($user_info['is_guest'])
{
// Some actions for not registered users are going here
}
else
{
$chat->printChat();
}
?>
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 Blubbs » Sat Apr 18, 2009 1:09 am

OldWolf wrote:There ya go, that's why... my bet is $user_info['is_guest'] is empty:

Possible. I will try it tommorrow and will prompt Report if it works :-)

Thanks,

Blubbs
Blubbs
Member
 
Posts: 22
Joined: Mon Feb 16, 2009 6:09 pm
Top

Postby Blubbs » Sat Apr 18, 2009 2:25 pm

Hello,

i am one step closer.

I defined the URL Redirection to telefonsexforum.de for all Guests.

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Your title is going here</title>
    <?php
        if (!$user_info['is_guest'])
        {
            $chat->printJavascript();
            $chat->printStyle();

            // Style sheet
            echo '<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/style.css" />';
        }
     ?>
  </head>
   
  <body>
    <?php
        if ($user_info['is_guest'])
        {
        header("Location: http://www.telefonsexforum.de");
        }
        else
        {
            $chat->printChat();
        }
    ?>

  </body>
</html>

But now. I doesnt matter if i logged in into the forum or not. I will allways be redirected to telefonsexforum.de.

The Script doesnt recognized wheather i am logged in or not into SMF.

Thanks,

Blubbs
Blubbs
Member
 
Posts: 22
Joined: Mon Feb 16, 2009 6:09 pm
Top

Postby OldWolf » Sun Apr 19, 2009 3:23 am

Well, looking at what you just posted... there's nothing that sets the $user_info array to begin with. You used to have this code at the top:
require(dirname(__FILE__) . '/../SSI.php');

$user_info = ssi_welcome('array');

Which set $user_info to whatever SMF returns for ssi_welcome('array'). But now nothing sets it, so I'm betting you're getting some odd false positive on the is_guest (I would think an empty array value should be evaluated to false, but I'm not going to go dig out the comparison chart for php). Add that back to the top of the script and see what you get.

Also, if it doesn't work, I would go ahead and do a print_r and the $user_info and just see what the contents are.

Just a quick note, if you determine that that function isn't properly working, you need to stop by the SMF forums to get more information... since it's not a PFC function, there's really no way for me to support it... I'd like to be able to help with it, but I don't know the SMF package at all.
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 Blubbs » Mon Apr 20, 2009 10:34 pm

I only posted the part after the Config.

Here is the whole smf.php:

Code: Select all
<?php

/////////////////////////////////////////////////////////////////////////////////

// Include SSI.php. It is relative path! Chenge it for your path
require(dirname(__FILE__) . '/../SSI.php');

$user_info = ssi_welcome('array');

if (!$user_info['is_guest'])
{
    require_once dirname(__FILE__)."/src/phpfreechat.class.php";

    /////////////////////////////////////////////////////////////////////////////////

    $params = array();

    // Some initializations are going here
    // ......................................

    // Setup user nickname
    $params["nick"]     = $user_info['is_guest'] ? "Guest-" . rand(1, 1000) : $user_info['name'];

    // Other initializations are going here
    // ......................................

    /////////////////////////////////////////////////////////////////////////////////
    require_once dirname(__FILE__)."/src/phpfreechat.class.php";
   $params["title"]                = "T6Chat";
   $params["max_msg"]              = 21;
   $params["clock"]                = true;
   $params["serverid"]             = md5(__FILE__);           
   $params["language"]             = "de_DE-informal";
   $params["isadmin"]              = false;
   $params["theme"]            = t6chat;
   $params["btn_sh_whosonline"]   = false;
   $params["connect_at_startup"]   = true;
   $params["display_ping"]         = false;
   $params["startwithsound"]      = false;
   $params["shownotice"]         = 0;
   $params["nickmeta_private"]    = array('ip');
   $params["channels"]              = array("T6Chat");
   $params["frozen_channels"]       = array("T6Chat");
   $params["nickname_colorlist"]   = array('#961616');
   $params["bbcode_colorlist"]     = array('961616');
   $params["nickmarker"]         = false;
   $params["showsmileys"]         = false;
   $params["clock"]             = true;
   $params['admins'] = array('Nicole'  => 'xxxx',
                          'Admin' => 'xxxxxx');
   $params['skip_proxies'] = array('censor');
    $chat = new phpFreeChat($params);
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Your title is going here</title>
    <?php
        if (!$user_info['is_guest'])
        {
            $chat->printJavascript();
            $chat->printStyle();

            // Style sheet
            echo '<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/style.css" />';
        }
     ?>
  </head>
   
  <body>
    <?php
        if ($user_info['is_guest'])
        {
        header("Location: http://www.telefonsexforum.de");
        }
        else
        {
            $chat->printChat();
        }
    ?>

  </body>
</html>

Maybe we can talk via PN if this works better for you.

I could create an Account in the Forum for you if you want it.

Thanks again,

Blubbs
Blubbs
Member
 
Posts: 22
Joined: Mon Feb 16, 2009 6:09 pm
Top

Postby OldWolf » Tue Apr 21, 2009 10:55 am

Ok, it sounds like you didn't follow up with my other instructions, so let me repost them:

Also, if it doesn't work, I would go ahead and do a print_r and the $user_info and just see what the contents are.

Just a quick note, if you determine that that function isn't properly working, you need to stop by the SMF forums to get more information... since it's not a PFC function, there's really no way for me to support it... I'd like to be able to help with it, but I don't know the SMF package at all.
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 Blubbs » Tue Apr 21, 2009 1:49 pm

Hello,

i've created a small smftest.php

Code: Select all
<?php

/////////////////////////////////////////////////////////////////////////////////

// Include SSI.php. It is relative path! Chenge it for your path
require(dirname(__FILE__) . '/../SSI.php');

$user_info = ssi_welcome('array');

if (!$user_info['is_guest'])
{
    require_once dirname(__FILE__)."/src/phpfreechat.class.php";

    /////////////////////////////////////////////////////////////////////////////////

    $params = array();

    // Some initializations are going here
    // ......................................

    // Setup user nickname
    $params["nick"]     = $user_info['is_guest'] ? "Guest-" . rand(1, 1000) : $user_info['name'];

   
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Your title is going here</title>
   
    <?php
        echo '<pre>';
        print_r($user_info);
        echo '</pre>';
     ?>
  </head>
   
  <body>
   

  </body>
</html>

This seems to works fine.

You can reach the Document here:

http://www.telefonsexforum.de/Chat/smftest.php

It shows the whole array of $user_info
Blubbs
Member
 
Posts: 22
Joined: Mon Feb 16, 2009 6:09 pm
Top

Postby OldWolf » Wed Apr 22, 2009 6:08 am

Could you please create a test account for me so I can try it as a logged in user and help you pinpoint the issue?
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 Blubbs » Wed Apr 22, 2009 2:01 pm

I've send you a PN with the Login Information.

Greetings,

Blubbs
Blubbs
Member
 
Posts: 22
Joined: Mon Feb 16, 2009 6:09 pm
Top


Post a reply
14 posts • Page 1 of 1

Return to phpBB, Simple Machines Forum (SMF), and Forum Software (v1.x)

Who is online

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