====== Advanced configuration ======
This page is for 1.x phpfreechat versions. For 2.x versions, check the [[:documentation:|documentation]]
===== Setup the parameters =====
The chat is usable using the default configuration but a lot of options can be tweaked to customize the chat. For example, to change the refresh speed to 2 seconds, copy/paste this piece of code and run "/rehash" command:
phpFreeChat demo
printChat(); ?>
Another example: to set the initial nickname to "guest" (it can be useful when the chat is integrated into a portal or a forum which provides the login/password), copy/paste this piece of code:
phpFreeChat demo
printChat(); ?>
Thanks to these two examples, you should understand how to setup the chat using the parameters: $params["param-name"] = "param-value";
As parameters are stored in a cache, be sure to run **''/rehash''** command each time you change a parameter value.
Now have a look to the [[:parameters|global parameters list]] and to the [[:proxies|proxies parameters list]].
===== Directories structure recommendation =====
Here is some recommendations about how to deploy and integrate the chat in an existing project. Following these recommendations will facilitate future chat upgrades.
Firstly, I suppose your Web server root directory is www/ (where all your existing project files are located). Then [[:download|download]] and extract latest phpfreechat version in this directory, the directories hierarchy should have the look of this figure:\\ {{ directories-structure.png |}}
- __The phpfreechat raw sources :__ contains the unmodified phpfreechat sources (never modify it so it will be easier to upgrade next version). To have these files, just download the phpfreechat zip (or tar.gz for linux users) archives from the [[:download|download page]].
- __Your chat script :__ this script contains your customized chat parameters list. You also have to require_once the phpfreechat.class.php from your phpfreechat sources. Here is a sample chat.php files for the above example:
Chat
printChat(); ?>
- __Your other website files :__ just ignore this point if you just want to have a chat on your website. However maybe you would like to have other scripts in your website ? (ex: forum, registration system, blog) then just put these files here.