To install phpFreeChat you need:
safe_mode=On
makes problems)By default, you don't need a Mysql database because the system uses files to store messages and nicknames.
Using the setup (the easy way): (not available for 1.0-betaX)
Tip: remove the setup when the install is finished for security reason.
Using the ziped archives (for those who haven't gzip module in their php):
phpfreechat-x.x
directory on your server into a browsable directory (public directory).
Tip: if you have a SSH access, I suggest to untar the archives
directly on the server usign tar xzf phpfreechat-x.x.tar.gz
command.
phpfreechat-x.x/data/public
and
phpfreechat-x.x/data/private
directories.
If you are using FTP:
CHMOD 777 phpfreechat-x.x/data/private CHMOD 777 phpfreechat-x.x/data/public
If you are using SSH:
chmod a+w phpfreechat-x.x/data/*
phpfreechat-x.x
directory with your browser and
enjoy !Now you need surely to customize your chat. You can take a look at the
example scripts in the phpfreechat-x.x/demo
directory.
Here is the minimum script required for your chat to work (inspired from demo1):
<?php require_once "src/phpfreechat.class.php"; // adjust to your own path $params["serverid"] = md5(__FILE__); // used to identify the chat $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> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>phpFreeChat demo</title> <?php $chat->printJavascript(); ?> <?php $chat->printStyle(); ?> </head> <body> <?php $chat->printChat(); ?> </body> </html>
The chat is usable using the default configuration but a lot of options can be tweaked to customize the chat. For exemple, to change the refresh speed to 2 seconds, copy/paste this piece of code:
<?php require_once "src/phpfreechat.class.php"; // adjust to your own path $params["serverid"] = md5(__FILE__); $params["refresh_delay"] = 2000; // 2000ms = 2s $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> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>phpFreeChat demo</title> <?php $chat->printJavascript(); ?> <?php $chat->printStyle(); ?> </head> <body> <?php $chat->printChat(); ?> </body> </html>
Another example, to set the initial nickname to "guest" (this 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:
<?php require_once "src/phpfreechat.class.php"; // adjust to your own path $params["serverid"] = md5(__FILE__); $params["nick"] = "guest"; // it can be useful to take nicks from a database $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> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>phpFreeChat demo</title> <?php $chat->printJavascript(); ?> <?php $chat->printStyle(); ?> </head> <body> <?php $chat->printChat(); ?> </body> </html>
Thanks to these two example, you should understand how to pass parameters
to the chat: $params["param-name"] = "param-value";
Now for the full parameters list (only for 0.x versions, wait for 1.0-final release for complete documentation):
serverid
serverid
. If you don't know
what to write, just try : $params["serverid"] =
md5(__FILE__);
nick
$params["nick"] = iconv("ISO-8859-1", "UTF-8",
$bdd_nickname);
(of course, change the $bdd_nickname parameter
for your needs)(""
value by default, means users must choose a
nickname when s/he connect)
title
("My phpFreeChat"
by default)
channel
(auto-generated string based on the title parameter by default)
frozen_nick
(false
value by default)
max_nick_len
( 15
caracteres by default)
max_text_len
( 250
characters by default)
refresh_delay
( 5000
by default, 5000ms = 5s)
timeout
refresh_delay
a HTTP request.
( 20000
by default, 20000ms = 20s)
max_msg
(20
lines by default)
quit_on_closedwindow
true
will send a /quit
command when the user close his window (doesn't work on Firefox). This
parameter isn't true
by default because on IE and
Konqueror/Safari, reloading the window (F5) will generate the same
event as closing the window which can be annoying.
(false
value by default)
focus_on_connect
(true
value by default)
connect_at_startup
(true
value by default, means when the chat web page is
open, a connection to the chat is automaticaly performed)
start_minimized
true
will start the chat minimized.
(false
value by default)
height
("440px"
by default)
width
(""
by default, means it's given by the CSS)
shownotice
(3
by default)
nickmarker
(true
value by default)
clock
(true
value by default)
openlinknewwindow
true
will add the
target="_blank"
into parsed links. This attribute is used
to open the followed link in a new window.
(true
value by default)
showwhosonline
(true
value by default)
showsmileys
(true
value by default)
btn_sh_whosonline
(true
value by default)
btn_sh_smileys
(true
value by default)
themeurl
(this parameter is automaticaly calculated by default)
themepath
(dirname(__FILE__)."/../themes"
by default)
theme
("default"
by default)
language
i18n/*
sub directories names.
(by default this is the local server language)
output_encoding
(UTF-8 by default )
container_type
("File"
by default)
server_script_path
and server_script_url
server_script_url
must
point to the server script browable url (useful when using url
rewriting).
(by default these parameters are auto-calculated)
client_script_path
and client_script_url
client_script_url
must point
to the client script browable url (useful when using url rewriting).
(by default these parameters are auto-detected)
useie7
(true
value by default)
ie7path
(dirname(__FILE__)."/../lib/IE7_X_X"
by default)
jspath
(dirname(__FILE__)."/../lib/javascript"
by default)
usecsstidy
false
will disable CSSTidy library, css
optimisation (output size) will be disabled.
(false
value by default because it make problems on
strange server configurations)
csstidypath
(dirname(__FILE__)."/../lib/csstidy-X.X"
by default)
xajaxpath
(dirname(__FILE__)."/../lib/xajax_X.X"
by default);
data_private_path
dirname(__FILE__)."/../data/private"
by default)data_public_path
and data_public_url
data_public_url
parameter can be specified to help when url rewriting is used.
(dirname(__FILE__)."/../data/public"
by default)debug
(false
value by default)
debugxajax
(false
value by default)
prefix
("pfc_"
by default)