phpFreeChat was developed with an aim of simplicity and flexibility.
Setting it up is relatively simple. All parameters are centralized in an array and passed as parameters on the instantiation of the phpFreeChat object.
You need to create a new theme (for example “mytheme”) :
span.pfc_heure, span.pfc_date { color: red; }
$params["theme"] = "mytheme";
Follow the above instructions for the theme creation. Then I suppose you have a directory “phpfreechat/themes/mytheme/”.
smiley1.png :) :-)
smiley2.gif :( :-(
smiley3.jpg :D :-D :o)
Each line begins with the image filename followed by the list of the string characters to replace by that image. Only use spaces to separate the smileys string matches.
$params["theme"] = "mytheme";
A command is a php class. So, to write your own command, you need to write a new php class (as an example look at the “src/commands/nick.class.php” file).
Each command class inherit from a virtual “pfcCommand” class. This virtual class define the command interface. Currently the only virtual method to implement is: “function run(…)”
You have some API you can use to write your command:
As an examples, have a look to this demo: 1 (try to type ”/roll 2d6”)
A phpfreechat proxy is a class that will be instantiated each time a command is run. The proxy can stop and modify the handled commands. It can also create and run new commands. Thanks to the proxies, the chat default behavior can be customized a lot.
To start understanding the proxy mechanism, have a look to the easier proxy: the log proxy. This proxy write down in a file all the posted message on each channels.
As an examples, have a look to the default file container source code or to the mysql container source code.
Many thanks to our contributors