• 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 changing nick

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

Post a reply
3 posts • Page 1 of 1

Postby rakitir » Sat Jun 11, 2011 11:25 am

Code: Select all
<?php
session_start();

/*--------------------- chat --------------------------*/
   $params = array();
   
   if (isset($_SESSION['login']))
   {
      $params['dyn_params'] = array('frozen_nick');
       $params["frozen_nick"] = true;   
        $params["nick"] = $_SESSION['login'];
    }
   else
   {
        $params["nick"] = "Guest".rand(1,100);
   }
   require_once dirname(__FILE__)."/src/phpfreechat.class.php";
   

   $params["serverid"] = md5(__FILE__);
   $chat = new phpFreeChat( $params );
   
   /* ----------------- end chat --------------------------*/

?>

this cod works, but i have one problem. - the first time that it is impossible to send messages.

before logging
Image

after logging
Image

after the update page
Image

how to solve this problem?
Last edited by rakitir on Tue Jun 14, 2011 9:44 am, edited 1 time in total.
rakitir
New member
 
Posts: 8
Joined: Tue May 31, 2011 3:12 pm
Top

Postby re*s.t.a.r.s.*2 » Sat Jun 11, 2011 4:00 pm

hi again,

PFC uses sessions when you enter the chat the first time it ask for a nick and its saved in the session,
when you log in in your CMS then return to the chat, PFC uses previous nick in the session instead of picking up the CMS registered nick.. then to avoid that you need to destroy the old session and restart a new one or use javascript to send the quit command .....

This behavior its not a flaw in the CODE , this way its the default behavior when integrated to a CMS, it supposed that if you want to have chat connected just to allow registered users.. and not guest anymore...

if you use the javascript approach it might not work 100% because sometimes the command fails when sent , best bet is destroying the session using a link that calls a php file that has the code to destroy when landing to the login page you start the session and login the user and redirect back to chat..

regards.
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 rakitir » Mon Jun 13, 2011 10:56 am

how to "destroying the session using a link that calls a php file that has the code to destroy when landing to the login page"??
rakitir
New member
 
Posts: 8
Joined: Tue May 31, 2011 3:12 pm
Top


Post a reply
3 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

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