/*
 * Date:	17.09.2007
 *
 * File:	readme.txt
 * Project:	AJAX_CHAT
 *
 * Author:	Sebastian Tschan
 * Website:	https://blueimp.net
 *
 * License:	GPL
 * 
 */


AJAX Chat
=========

Version 0.4




Requirements
============

Server-Side:

- PHP >= 4
- MySQL >= 4


Client-Side:

- Enabled JavaScript
- Enabled Cookies




Installation
============

1.	Configuration settings
	----------------------

	Edit database settings in lib/config.php:

	$ajaxChatConfig['dbConnection']['host'] = 'your_database_hostname';
	$ajaxChatConfig['dbConnection']['user'] = 'your_database_username';
	$ajaxChatConfig['dbConnection']['pass'] = 'your_database_password';
	$ajaxChatConfig['dbConnection']['name'] = 'your_database_name';


2.	Creation of database tables
	---------------------------

	Execute the provided SQL script chat.sql by using phpMyAdmin:
	http://www.phpmyadmin.net/
	
	On phpMyAdmin, select your database and click on "Import".
	Select the file chat.sql from your local harddisk and click on "OK".
	This should execute the included commands to create the tables needed by this chat.


3.	Upload to the server
	--------------------

	Upload the chat folder to your server into your phpBB3 forum directory:
	e.g. http://example.org/phpBB3/chat


Ready! Just place a link to the chat directory on your forum. :)




Configuration files:
====================

AJAX Chat is fully customizable and contains two configuration files:

1.	lib/config.php
	--------------
	This file contains the server side (PHP) settings.

2.	js/config.js
	------------
	This file contains the client side (JavaScript) settings.

Each configuration option is explained with a comment prior to the setting assignment.




Customizing the layout:
=======================

The layout of AJAX Chat is fully customizable by using CSS (Cascaded Style Sheets).
AJAX Chat comes with a predefined set of styles. To add your own style, do the following:

1.	Add a new CSS file (e.g. mystyle.css) by copying one of the existing files from the CSS directory.

2.	Edit your file (css/mystyle.css) and adjust the CSS settings to your liking.

3.	Add the name of your style without file extension to the available styles in lib/config.php:

	// Available styles:
	$ajaxChatConfig['styleAvailable'] = array('mystyle','prosilver','subsilver2','beige','black','grey');
	// Default style:
	$ajaxChatConfig['styleDefault'] = 'mystyle';

If customizing the layout by using CSS is not enough, adjust the template files in lib/template/.




Adding custom commands:
=======================

AJAX Chat comes with a set of predefined IRC style commands.

You can add your own commands by overriding the method parseCustomCommands($text, $textParts).
To override this method, add it to the class CustomChat in lib/class/CustomChat.php.

The file js/custom.js is provided to add your own client-side functionality.
Just have a look at the example how to replace custom commands on client side.




Log files:
==========
	
	By default, AJAX chat stores the chat messages in the database.
	
	To enable the creation of log files adjust the following setting in lib/config.php:
	
	$ajaxChatConfig['logsCreateLogs'] = true;

	The database table containing the chat messages will now be purged in regular intervals.
	The purged messages are logged to file in the directory logs/.
	
	The chat needs write access (0722) to this directory to be able to write the log files.	
	Most FTP clients allow to adjust file and directory permissions from the context menu.



