Index of /123flashchat/docs

[ICO]NameLast modifiedSizeDescription

[DIR]Parent Directory   -
[DIR]css/ 09-Dec-2010 10:55 -
[DIR]images/ 09-Dec-2010 10:55 -
[DIR]js/ 09-Dec-2010 10:55 -

 PHP Chat Instructions
About PHP chat module
Title: PHP Chat of 123Flash Chat chat module for integrate your website
Description: 123 Flash Chat PHP chat 3rd party module can make your website have its own flash chat room. It also can integrate your website with databases through simple configuration. It is a totally free third party plug-in component.
Version: 1.0.0
Company: TOPCMM
Website: http://www.123flashchat.com
Author: Daniel Jiang
Installation Instructions
 Install

1. Requirements

PHP chat has a few requirements which must be met before you are able to install and use it.

* A webserver or web hosting account running on any major Operating System with support for PHP

* PHP 4.3.3+  (>=4.3.3, >4.4.x, >5.x.x, >6.0-dev )

* If you need to do database integration.A SQL database system, one of:

MySQL 3.23 or above
MS SQL Server 2000 or above
Oracle

is required.



2. Quick install


1), Decompress the php chat package to a local directory on your system.

2), Upload PHP chat folder and the files in it containing in the installation package to your web server.

3), Change the permissions on the following directories to be writable by all:

phpchat/configure/,  phpchat/install/

4), If you install 123flashchat software on the local machine, please adapt the below document authorization into writable one:

(Windows, C:\Program Files\123FlashChatServer7.x\ means 123 Flash Chat server installed path, please change it with your real installation path)
C:\Program Files\123FlashChatServer7.x\server\etc\fcserver.xml
C:\Program Files\123FlashChatServer7.x\server\etc\groups\default\server.xml
C:\Program Files\123FlashChatServer7.x\server\etc\groups\default\database\database\*.xml

(Unix/Linux, /usr/local/123flashchat/ means 123 Flash Chat server installed path, please change it with your real installation path)
/usr/local/123flashchat/server/etc/fcserver.xml
/usr/local/123flashchat/server/etc/groups/default/server.xml
/usr/local/123flashchat/server/etc/groups/default/database/database/*.xml

5), Using your web browser visit the location you placed phpchat with the addition of index.php,
e.g.
http://www.mydomain.com/phpchat/

6), Click the INSTALL NOW button, follow the steps and fill out all the requested information.


3. Advanced Install
3.1 Select integration module



PHP Chat Accord to your requirement to the website chat room, PHP chat will offer you three integrated modules for you to choose.

1), Enter the installation page, click the "INSTALL NOW " button, and then it will take you to the module selection page.

2), If the CMS or Forum system you're running on your website is included in modules selection lists, we recommend you to use 3rd party module for integration instead of PHP Chat because the particular 3rd party module can save your efforts in integration.

3), Please select your website type, click "download" so as to download relevant module installation package. Please integrate it according to the installation guide in the package.

4), If you choose to use 3rd party module to do website integration, it is unnecessary for you to install php chat integrated package. Otherwise, please click "Others" to enter and view the Select PHP Chat integrated mode


3.2 Select PHP Chat integrated mode


1), Free mode. If you select Free mode, all you need to do is configure chat room name, fill in your room name and complete installation, then 123flash.com will offer a free chat room for your website. please refer to the "free mode install instruction" for more details Free mode install instruction

2), Only the user who host chat room by 123flashchat.com should choose Host mode. If so, it is very easy for you to integrate host chat room to your website so long as you write your host address and the relevant database information Host mode install instruction.
To apply the chat hosting service , please access http://www.123flashchat.com/host.html

3), Local mode.If you select Local mode, you should download 123 Flash Chat server software at http://www.123flashchat.com/download.html, fill in your 123 Flash Chat installation address and the relevant database info to integrate the local 123 Flash Chat to your website. Local mode install instruction


3.3 Free mode install instruction

1), In Select PHP Chat integrated mode page please select "Host chat room free of charge by 123flashchat.com" (Free mode).

2), Fill in your favorable room name and click "next" to complete installation.


3.4 Host mode install instruction

3.4.1 Tips for host user filling in host address
1), In Select php chat integrated mode page, please select "Host chat room by 123flashchat.com" (Host mode)

2), The host address format is as follows.

http://yourHostServerAddress/yourHostName/
e.g: http://host71200.123flashchat.com/phpchat/

If you fill in it with a wrong format, you are not able to do the next operation.


3.4.2 Integration declaration for Host mode

As the illustration above

1), Selection 1,"Do you want to integration with your database"

If you select "No", it indicates that you don't want to integrate with the website database. The chat room and user information will be stored into our database. If the user want to log in chat room, he or she must register new id or log in with guest.

If you select "yes", it indicates that you want to integrate with the website database and you have to configure the following items.

2), Selection 2, "Please select your current using database"

Please select the database type in the selections of MySQL, Oracle or MS Server.

3), Selection panel 3, "Please configure the database connecting parameters"

Please make sure all the information you fill in is true. Please refer to Declaration for database integration parameters.

4), Please click "next" after finishing filling to the last installation page.

The login_chat.php is used to do database integration, Please configure login_chat.php address to the chat admin panel

Log into chat admin panel -> System Settings -> Integration panel -> DataBase -> URL -> fill login_chat.php URL into 'URL' blank -> save it

Click "Install Done" to finish installation then it will forward Copy code and link page to gain chat room page link and its relevant nested code, Please refer to the Move client & restart server.


3.5 Local mode install instruction

3.5.1 123 Flash Chat installation address filling declaration


1), In Select PHP Chat Integrate Mode page, please select "Host chat room on local server" (Local mode).

2), Please download and install 123 Flash Chat, we recommend you to use the version contain JRE

Chat Server Path filling format is as below

<123 Flash Chat Server installed directory>/123FlashChatServer7.x
For example,
Windows:         C:\Program Files\123FlashChatServer7.x\
Unix/Linux:       /usr/local/123FlashChatServer/

If you fill in it with a wrong format, you are not able to do the next operation.


3.5.2 Integration declaration for Local mode

As the illustration above

1), Selection 1, "Do you want to integrate with your database"

If you select "No", it shows that you don't want to integrate with database. The chat room and user information will be stored into the 123 Flash Chat server's user database. If the user want to log in chat room, he or she must register with new id or log in with guest.

If you select "yes", it shows that you want to integrate with the website database and you should configure the items above in screenshot.

2), Selection 2,"Please select integration mode"

Please select your favorable integration mode, refer to the URL integration mode,  Database integration mode for help.

3), Selection 3, "Please select your using database"

Please select your database type.

4), Selection panel 3, "Please configure the database connecting parameters"

Please make sure all the information in these items are true. Please refer to Database integration parameter declaration.

5), After finishing filling, click "NEXT" to the Move client & restart server page.



1), Please select the way how to copy the chat client. We recommend you copy the chat client not automatically but manually, because it really takes time by script!

Manually copy mode: search for 123 Flash Chat installation directory and copy the client files to the PHP Chat installation directory.

2), Please select the way of restarting the 123 Flash Chat server. Auto-start is only available to the version 7.4 or higher version

Manually restart mode:

Windows: search for 123 Flash Chat installation directory, you will see the restart.bat under the server folder, double click it.

Linux: search for 123 Flash Chat installation directory, find the fcserver.sh under the server folder,
            then type command "./fcserver.sh restart" and press "Enter" with root account.


4. Install done,copy code and link

As the illustration above

You can view the installed chat room page under index tab.

You can gain the link address for chat room under Copy URL tab.

You can gain the chat room code under Copy Code tab. insert the code into your page then the chat room will be shown in the current page. It is necessary for the licensed user to modify the swf address for making sure the path of phpchat/client/123flashchat.swf is correct.


5. Remove install folder

After you complete installation, you are not able to install it again. If you really want to install it again, please remove the phpchat/install/installed.lock file manually and begin from Quick install.

When you complete the installation, you will be lead to the copy code and link. If you haven't removed the phpchat/install folder, this message “Attention: please remove the install folder” will be shown on the current page. Please remove the phpchat/install folder.

6 Advance


6.1 Integration mode and relevant parameters filling annotation

6.1.1 URL integration mode

We recommend you use this mode because it can reduce the numbers of the database connecting pool and relief the burden for database.

After you filling database configuration information, please make sure that you save these information to the "configure / config.php" for login_chat.php calling. PHP Chat supports MySQL, MS SQL and Oracle at present.

login_chat.php URL Output:
(What does each number means in terms of the authentication result.)
0 - login successfully;
1 - wrong password;
2 - the username can't be used;
3 - login error
4 - username does not exist
5 - successfully log in as an administrator


6.1.2 Database integration mode

After you filling database configuration information, your configuration information will be written into the %123flashchat installed directory%server/etc/fcserver.xml and %123flashchat installed directory%server/etc/groups/default/server.xml for the calling of 123 Flash Chat server. PHP Chat supports MySQL, MS SQL and Oracle at present.

It is direct integration of the chat server and the user database, through JDBC driver, which is abbreviation of Java DataBase Connectivity standard.

This way is for advanced user who not only understands how to connect database using JDBC driver, but also is capable of performance tuning to handle high traffic.


6.1.3 Database integration parameter declaration


Database host: You need to fill in your database host server ip address. If the database is installed on your local machine, please fill in with "localhost"

Database name: You need to fill in database name.

Database username: You need to fill in the account username which is allowed to access the database.

Database password: You need to fill in the password which is allowed to access the database.

Database user table: You need to fill in database user list table name of the integrated website.

Username field: You need to fill in its relevant username field name stored in the user list table.

Password field: You need to fill in its relevant password field name stored in the user list table.

EnableMD5: This item provides Encryption judgment. In your database, if the user password is encrypted with md5, you should set this item "on". Only do this can it identify the user password is encrypted with md5. If your encryption is not md5 or there is addtional salt parameter, you should go to the API to add your own encryption function. Please refer API for Developers.

6.2 API for Developers

If you're running 123FlashChat server side by yourself or host 123FlashChat chat room by 123flashchat.com, and you're ready to integrate chat room with your existing user databases, you can configure the PHP Chat API after you finish installing the PHP Chat. If you’re using the free chat room provided by us, please ignore this chapter.

PHP chat offers two API files and they are located in phpchat/api/

1). Transfer Username and Password API for auto login.

During the PHP chat installing process, if you have already selected and integrated your website database, you can use this API, no matter you choosing Database integrated mode or URL integrated mode.
Api_user_session.php API files are used to transfer the username and password for the user who have logon into your website.

Once you pass the current user’s username and password to the variables of $username and $password respectively in Api_user_session.php which is called by 123flashchat.php, you don't need to login twice to access 123FlashChat chat room.

sample code:

//code begin
/*After the user login into your website, Their username and password can be gained from your website's "Session" or "Cookie".The Api_user_session.php need gain the login user's username and password, you should rewrite the script to pass the values to the variables of $username and $password respectively for the calling of 123flashchat.php. For doing so, there is no need for the user to type its password again to log in the chat room when he or she visits the pages of 123flashchat.php. */
session_start();
$username= $_SESSION[username];
$password= $_SESSION[password];
//code end

2). Password encryption method API for authentication.

Api_password_encrypt.php API file is used to add your website special password encrypt algorithms helped to identify the encrypted password. Here we use API to pass the name of encrypted method then login_chat.php will call this function to validate the password. If you change the path of Api_password_encrypt.php, you also need to change Api_password_encrypt.php include path in login_chat.php
For password authentication, if your encryption method is not MD5, you may need to add your encryption algorithm into API, and assign the function name of your encryption method to password_encrypt_function_name, your encryption method will be called automatically to be used to authenticate user’s account.

sample code:

//code begin
//assume the following function is your website's special password encrypt algorithms
function hash_pw($password){
$salt = "phpchat";
return md5($password.$salt);
}
$password_encrypt_function_name = "hash_pw";

//code end