• 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

Problem with $params[\'nick\'] and 0.x version

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

Post a reply
8 posts • Page 1 of 1

Postby mikemad » Fri Jul 27, 2007 6:22 pm

Hello!
I want to integrate the chat with a site. This site have a login system that take data from database and put them in a Session ....

This is my script:

Code: Select all
$cod=mb_detect_encoding($_SESSION['username']);

require_once dirname(__FILE__)."/rt_chat/src/phpfreechat.class.php";
$params["serverid"] = md5(__FILE__);

$params["nick"] = iconv($cod, "UTF-8", $_SESSION['username']);
$params["frozen_nick"]=true;

$params["language"] = "it_IT";

//nascondiamo smiles
$params["showsmileys"]=false;
$params["btn_sh_smileys"]=false;

$chat = new phpFreeChat($params);

$chat_var['javascript']=$chat->printJavascript(true);
$chat_var['style']=$chat->printStyle(true);
$chat_var['chat']=$chat->printChat(true);

But it doesn't work!! When i login in the chat... the chat ask me to insert the nick!!! Why?? Where is the problem?? Sorry For my english. Thank you
Mike
mikemad
New member
 
Posts: 6
Joined: Fri Jul 27, 2007 6:13 pm
Top

Postby sappheiros » Fri Jul 27, 2007 10:28 pm

hello mikemad,

I can't tell you about you code,
but working with session nicks too,
concerning chat access I solve the problem of asking the nick on entry by :

$params["connect_at_startup"] = true; // connexion directe au tchat
Last edited by sappheiros on Fri Jul 27, 2007 10:29 pm, edited 1 time in total.
sappheiros
Member
 
Posts: 11
Joined: Fri Jul 27, 2007 12:53 pm
Location: France
Top

Postby mikemad » Wed Aug 01, 2007 3:44 pm

Hello!
I'm Back ...

Sappheiros thanks a lot but your suggest don't work :( ...

somebody can help me ??

tnks
mikemad
New member
 
Posts: 6
Joined: Fri Jul 27, 2007 6:13 pm
Top

Postby phpfreechat » Wed Aug 01, 2007 5:48 pm

are you sure "iconv($cod, "UTF-8", $_SESSION['username']);" doesn't return empty string ?
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby mikemad » Wed Aug 01, 2007 6:49 pm

Yes... if i echo $params["nick"], i'll get the correct value!!!
mikemad
New member
 
Posts: 6
Joined: Fri Jul 27, 2007 6:13 pm
Top

Postby mikemad » Fri Aug 03, 2007 5:24 pm

I've done another test:
in the file phpfreechatconfig.class.php

i wrote this line:

Code: Select all
$this->nick = $_SESSION['username'];

before this line ...

Code: Select all
    // setup a defaut title if user didn't set it up
    if ($this->title == "")        $this->title        = _pfc("My Chat");

nothing ... don't work!!!!

but if i write

Code: Select all
$this->nick = "helloworld";

it works!!!!! why?????
mikemad
New member
 
Posts: 6
Joined: Fri Jul 27, 2007 6:13 pm
Top

Postby mikemad » Fri Aug 03, 2007 5:42 pm

in which file the nick is set?? so i can put the value directly in this file .... please help me eheh i'm going crazy :D
mikemad
New member
 
Posts: 6
Joined: Fri Jul 27, 2007 6:13 pm
Top

Postby mikemad » Fri Aug 03, 2007 6:07 pm

ALLELUIA!!!! i put this line

Code: Select all
$c->nick=$_SESSION['username'];

in pfcommand_connect.class.php !!!

Now the nick is correctly setted!!!! But another problem is arrived .... now when i enter in the chat .. the nick is ok, but the user is not connected ( even if the icon of connection is ok ...) and i have to click 2 time on it .. 1 for disconnect .. 2 for reconnect ... any ideas??

Sorry for my bad english ...

Tnks Mike
mikemad
New member
 
Posts: 6
Joined: Fri Jul 27, 2007 6:13 pm
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 7 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