• 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

Encodingproblem in phpbb2: you must be connected to send a m

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

Post a reply
8 posts • Page 1 of 1

Postby kptb » Sun Nov 11, 2007 4:10 am

This does not work.

Code: Select all
<?php
Header("Cache-control: private, no-cache");
Header("Expires: Mon, 26 Jun 1997 05:00:00 GMT");
Header("Pragma: no-cache");


define('IN_PHPBB', true);
$phpbb_folder_name = '.';
$phpfreechat_folder_name = 'chat';

$phpbb_root_path = '../';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Kissmyrank:) Community Chat";
$params["serverid"] = md5("Kissmyrank"); // calculate a unique id for this chat
$params["channels"] = array("Main Room");
$params["language"] = "en_US";
$params["nick"] = iconv("iso-8859-1", "UTF-8", $userdata[username]);
//$params["nick"] = iconv("windows-1252", "UTF-8", $userdata[username]);
//$params["nick"] = $userdata[username];
$params["theme"] = "zilveer";
$params["frozen_nick"] = true;
$params["proxies_cfg"]["censor"]["words"] = array("heck","darn");
$params["isadmin"] = false;
$params["max_nick_len"] = 30;
$params["timeout"] = 60000;
if ($userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD) $params['isadmin'] = true;
//$params["isadmin"] = true; // just for debug ;)
//$params["debug"] = true;
$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 xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="pragma" content="no-cache" />
    <title>
      <?php echo($board_config['sitename']); ?> :: Chat
    </title>

    <?php $chat->printJavascript(); ?>
    <?php $chat->printStyle(); ?>

    <link rel="stylesheet" href="<?php echo($phpbb_root_path . 'templates/ca_artemis/style_main.css'); ?>"
    type="text/css" />
   </head>
  <body>
    <?php
    if($userdata['session_logged_in'])
    {
      echo('<span class="gen">');
      echo('Hi '.$userdata['username'].'! <a href="'.$phpbb_root_path.'login.php?logout=true&sid='.$userdata['session_id'].'&redirect=..%2F'.$phpfreechat_folder_name.'%2F'.'">Logout</a>');
      echo('</span><br />');
    ?>
    <div class="content">
      <?php $chat->printChat(); ?>
    <p>
      Tips:
    </p>
    <ul>
      <li>
        To open a <strong>private chat</strong>, click on
          the nickname in the right column (user list).
      </li>
      <li>
        To <strong>join a channel</strong>, type this
          text in the input box : <code>/join yourchannelname</code>
          (replace yourchannelname by what your want)
      </li>
      <li>
        To listen <strong>sound notification</strong>,
        put your chat window in the background and wait
        for someone post a message.
      </li>
    </ul>
    </div>
    <?php
    }
    else
    {
 redirect(append_sid($phpbb_root_path . "login.$phpEx?redirect=/chat/" . "index.$phpEx", true));   
    ?>
    <?php
    }
    ?>
  </body>
<? echo "#".$params["nick"]."#"; ?>
</html>

while this one works.

Code: Select all
<?php
Header("Cache-control: private, no-cache");
Header("Expires: Mon, 26 Jun 1997 05:00:00 GMT");
Header("Pragma: no-cache");


define('IN_PHPBB', true);
$phpbb_folder_name = '.';
$phpfreechat_folder_name = 'chat';

$phpbb_root_path = '../';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Kissmyrank:) Community Chat";
$params["serverid"] = md5("Kissmyrank"); // calculate a unique id for this chat
$params["channels"] = array("Main Room");
$params["language"] = "en_US";
//$params["nick"] = iconv("iso-8859-1", "UTF-8", $userdata[username]);
//$params["nick"] = iconv("windows-1252", "UTF-8", $userdata[username]);
//$params["nick"] = $userdata[username];
$params["theme"] = "zilveer";
$params["frozen_nick"] = true;
$params["proxies_cfg"]["censor"]["words"] = array("heck","darn");
$params["isadmin"] = false;
$params["max_nick_len"] = 30;
$params["timeout"] = 60000;
if ($userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD) $params['isadmin'] = true;
//$params["isadmin"] = true; // just for debug ;)
//$params["debug"] = true;
$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 xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="pragma" content="no-cache" />
    <title>
      <?php echo($board_config['sitename']); ?> :: Chat
    </title>

    <?php $chat->printJavascript(); ?>
    <?php $chat->printStyle(); ?>

    <link rel="stylesheet" href="<?php echo($phpbb_root_path . 'templates/ca_artemis/style_main.css'); ?>"
    type="text/css" />
   </head>
  <body>
    <?php
    if($userdata['session_logged_in'])
    {
      echo('<span class="gen">');
      echo('Hi '.$userdata['username'].'! <a href="'.$phpbb_root_path.'login.php?logout=true&sid='.$userdata['session_id'].'&redirect=..%2F'.$phpfreechat_folder_name.'%2F'.'">Logout</a>');
      echo('</span><br />');
    ?>
    <div class="content">
      <?php $chat->printChat(); ?>
    <p>
      Tips:
    </p>
    <ul>
      <li>
        To open a <strong>private chat</strong>, click on
          the nickname in the right column (user list).
      </li>
      <li>
        To <strong>join a channel</strong>, type this
          text in the input box : <code>/join yourchannelname</code>
          (replace yourchannelname by what your want)
      </li>
      <li>
        To listen <strong>sound notification</strong>,
        put your chat window in the background and wait
        for someone post a message.
      </li>
    </ul>
    </div>
    <?php
    }
    else
    {
 redirect(append_sid($phpbb_root_path . "login.$phpEx?redirect=/chat/" . "index.$phpEx", true));   
    ?>
    <?php
    }
    ?>
  </body>
<? echo "#".$params["nick"]."#"; ?>
</html>

My name contains a space and an "@".
I am also admin of the forum.
I get a flashing you are disconnected message.
Error seems to be relative to the encoding of the nick.
Commenting that single line (the one for setting the nick) resolves the disconnected issue (i can send and receive messages right but of course users have to input their nick manually).
When the line is not commented name appears displayed correctly but i can't see nor send messages.
More important on the wrong configuration ie refuses to load the page.
I am using Opera Web Browser but the problem shows up also with firefox.
What am i doing wrong?

Thanks in advance for your help.
Last edited by kptb on Fri Nov 16, 2007 5:02 pm, edited 1 time in total.
kptb
New member
 
Posts: 5
Joined: Sun Nov 11, 2007 3:46 am
Top

Postby kptb » Sun Nov 11, 2007 12:04 pm

Setting the nick manually like $params["nick"] = "Mr. @st"; won't work either. Nor converting this string to UTF-8. It does not have any effect.
So it can be either a bug with the nick handling or still some weird encoding problem.
Everytime i try a new version of the php file i delete the cookie and the private data three directories.
Please help.
Last edited by kptb on Sun Nov 11, 2007 12:14 pm, edited 1 time in total.
kptb
New member
 
Posts: 5
Joined: Sun Nov 11, 2007 3:46 am
Top

Postby OldWolf » Tue Nov 13, 2007 11:54 pm

I don't know for sure, because I haven't played with it, but @ may be used for commands somewhere?
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 kptb » Wed Nov 14, 2007 6:19 pm

It's just plain install with that index file.And the @ does not seem to be the problem. If i set the default nick to "kp babbaac" with no @ it is the same.If i don't set any default it works.And also the fact that ie7 gives a 404 only when nick param is present seems to suggest that there is something more to it...
kptb
New member
 
Posts: 5
Joined: Sun Nov 11, 2007 3:46 am
Top

Postby OldWolf » Thu Nov 15, 2007 11:49 pm

That's really strange... my set up uses the nick parameter with no problems. o.O
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 kptb » Fri Nov 16, 2007 10:16 am

Since nothing helpful has come out i will try some other chat.Thank you oldwolf for your help anyway.
kptb
New member
 
Posts: 5
Joined: Sun Nov 11, 2007 3:46 am
Top

Postby M0tah » Sat Nov 17, 2007 8:56 am

I'm having the same problem with the 1.0 final release. However, I didn't have any of these problems with the 1.0 beta 11 release. It looks like the bug was introduced in the final 1.0 release, so if you're having this problem, try using the beta 11 release.
M0tah
New member
 
Posts: 3
Joined: Sat Nov 17, 2007 8:34 am
Top

Postby kptb » Sat Nov 17, 2007 10:27 am

Thank you but for now i am using a lighter AJAX Chat that is working good.
If a good version of this one comes out i will try it.
The shame here is that there is almost no support...
kptb
New member
 
Posts: 5
Joined: Sun Nov 11, 2007 3:46 am
Top


Post a reply
8 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

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