PHPSimpleChat

Open Source PHP Chat Client & Library

Documentation Table of Contents - PHPSimpleChat
Frequently Asked Questions


How can I pass through usernames from my community site to PHPSimpleChat so they will show up in the chat room?

In order to pass usernames in, you must instantiate the PHPSimpleChat object with the username of the desired user. For example, if usernames were contained in the $user variable, the following code would work:

$mychat = new PHPSimpleChat($user);

How can I have multiple chat rooms, each with their own unique chats?

By default, if you don't pass a room identifier to the PHPSimpleChat constructor, all instances of the chat room will have the same conversations. However you can create unique chat rooms by passing a unique string as the second argument to the PHPSimpleChat constructor. It doesn't matter what the string is, as long as its different for each unique instance you want to create. Here is an example unique room, along with a username variable argument from the above question:

$mychat = new PHPSimpleChat($user, 'social_room_23');

If you don't want to pass dynamic usernames in to PHPSimpleChat, you can specify NULL in place of the user argument like this:

$mychat = new PHPSimpleChat(NULL, 'fishing');

How do you initiate a private chat?

PHPSimpleChat Private ChatClick the private chat icon next to the name of the user you want to private chat with. A new conversation window will open up. The user will be notified of the private chat request. If they accept, a new chat window will open up for them and they will be joined into the private chat.

PHPSimpleChat is not as responsive as I want. How can I make it more responsive?

PHPSimpleChat can be configured to be more responsive. By default, conservative response settings have been set to ensure functionality across many types of database servers. To tune PHPSimpleChat to be more responsive, see the Performance and Tuning section.