**************************************************************************
** XMB: Web Portal System                                               **
** Module for 123 Flash Chat Server software                            **
** ==============================================                       **
**                                                                      **
** Copyright (c) by TopCMM 					                            **
** Daniel Jiang (support@123flashchat.com)          		        	**
** http://www.topcmm.com					                        	**
** http://www.123flashchat.com                                          **
** chat version: 2.1                                                    **
** XMB version: 1.9.11.13                                               **
**                                                                      **
**************************************************************************



####################################################################################################################
## Notes:                                                                                                         ##
##                                                                                                                ##
##     IMPORTANT!!!!                                                                                              ##
##     If you need to use the chat service on a local machine, before installing this module, please              ##
##     download 123FlashChat Server software first from this page:                                                ##
##     http://www.123flashchat.com/download.html                                                                  ##
##     You may get the latest free demo version of 123 flash chat server software at there.                       ##
##                                                                                                                ## 
##     And get professional support from: http://www.123flashchat.com/support.html                                ##
##     We provide online forum support, email support, online live support, and phone support                     ##
##     etc.                                                                                                       ##
##                                                                                                                ##
##     Good luck and have a nice day!                                                                             ##
##                                                                                                                ##
####################################################################################################################
## Before Adding This MOD To Your XMB, You Should Backup All The Files Related To This MOD                        ##
####################################################################################################################


Step 1, Install module files to your XMB:

        File Copy 
            copy 123flashchat/       to      <XMB installed directory root>/123flashchat       
   
Step 2, Files to Edit
         
     1), OPEN: <xmb installed directory>/header.php

       FIND:
-----------------------------------------------------------------------------------------------------------------------------------
// Search-link
-----------------------------------------------------------------------------------------------------------------------------------

       ADD AFTER 
----------------------------------------------------------------------------------------------------------------------------------
// 123Flash Chat Link Begin
	$links[] = "<img src=\"$imgdir/top_stats.gif\" alt=\"chat\" border=\"0\" /> <a target=\"_blank\" href=\"123flashchat/123flashchat.php\"><font class=\"navtd\">Chat</font></a>";
// 123Flash Chat Link End
----------------------------------------------------------------------------------------------------------------------------------

     2), OPEN: <xmb installed directory>/index.php

       FIND:
-----------------------------------------------------------------------------------------------------------------------------------
$whosonline = $whosonlinetoday = '';
-----------------------------------------------------------------------------------------------------------------------------------


       ADD AFTER 
----------------------------------------------------------------------------------------------------------------------------------
require '123flashchat/functions_chat.php';
----------------------------------------------------------------------------------------------------------------------------------


     3), Administration Panel -> Look & Feel -> Templates ->SELECT TEMPLATE index_whosonline ->Edit

       FIND:
-----------------------------------------------------------------------------------------------------------------------------------
$whosonlinetoday
-----------------------------------------------------------------------------------------------------------------------------------


       ADD AFTER
----------------------------------------------------------------------------------------------------------------------------------
$topcmmchat
----------------------------------------------------------------------------------------------------------------------------------

Step 3, Configure chat module's running mode:
        
        1). Please choose the running mode according to your needs.
             
            Configuration path:                       <XMB installed directory>/123flashchat/flashchatconf/config.php

            Configure the following parameters:
                                                      $running_mode
            Configuration reference:
                                                      $running_mode = 2; (only 1 or 2 or 3)


        2). Configure the parameters of the running mode you choose.


            1. Chat server is hosted by your own ($running_mode = 1).
            
                 If your chat is hosted by your own, 123FlashChat server software should be installed at first, 
                 please download 123FlashChat:  http://www.123flashchat.com/download.html. 

               Configuration path:                    <XMB installed directory>/123flashchat/flashchatconf/config_local.php


               Configure the following parameters:
													  $swf_file_name (modification is not recommended)
                                                      $chat_group
                                                      $primary_server_host
                                                      $primary_server_port
                                                      $client_location
                                                      $chat_data_path
                            
               Configuration reference:
                                                      $swf_file_name         =  "123flashchat.swf";  
													  $chat_group            =  "default";                                                      
                                                      $primary_server_host   =  "localhost";
                                                      $primary_server_port   =  51127;
                                                      $client_location	     =  "http://YOUR REAL CLIENT FOLDER URL/client/"; (repalce to real URL)
                                                      $chat_data_path        =  "<123flashchat install directory>/server/data/default/"; (repalce to real URL)


			2. Chat server is hosted by 123flashchat.com ($running_mode = 2).

                 If your chat is hosted by 123Flashchat.com, no 123FlashChat server software is needed to be installed; 
                 you may connect to your host chat room directly.
               
               Configuration path:                    <XMB installed directory>/123flashchat/flashchatconf/config_host.php

               Configure the following parameters:
			   
                                                      $client_location


               Configuration reference:
			   
                                                      $client_location   =  "http://host*.123flashchat/your host ID/"; (repalce to real URL)
 
             3. Chat server is hosted by 123flashchat.com free of charge ($running_mode = 3).

                 If you need to use this service, no 123FlashChat server software is needed to be installed, 
                 we will provide you free chat room, and you can choose the room name as you want.
            
               Configuration path:                    <XMB installed directory>/123flashchat/flashchatconf/config_free.php

               Configure the following parameters:

                                                      $room_name 

               Configuration reference:
                                                      $room_name              =  "Lobby";	//can use any name


Step 4, Integrate your chat with XMB user database

        If you choose running mode 1 or mode 2, integration is needed, you may achieve this by following the instructions below.

            1. Log in the Admin Panel of your 123FlashChat server
               OPEN: System Settings -> Integration
 
            2. Find: DataBase -> SELECT: URL -> edit 
      
            3. Change URL:
                 http://<XMB install directory>/123flashchat/login_chat.php?username=%username%&password=%password%

            4. Press OK to save your setting.
   