**************************************************************************
** IPB: 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                                          **
** http://www.invisionboard.com/                                        **
**                                                                      **
**************************************************************************



####################################################################################################################
## 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 IPB, You Should Backup All The Files Related To This MOD                        ##
####################################################################################################################


Step 1, Install module files to your IPB:


        File Copy 

            copy all php files/                          to                  <IPB installed directory root>/
            copy folder flashchatconf/                   to                  <IPB installed directory root>/flashchatconf/
            copy ./style_images/1/123flashchat.gif       to                  <IPB installed directory root>/style_images/<them of templete>/123flashchat.gif       




Step 2, Files to Edit

         
     1). OPEN: <IPB installed directory>/index.php

       FIND:
-----------------------------------------------------------------------------------------------------------------------------------
//  Set up our language choice
-----------------------------------------------------------------------------------------------------------------------------------



       AFTER ADD
----------------------------------------------------------------------------------------------------------------------------------
include "functions_chat.php";
include "flashchatconf/config.php";


$chatters = getChatters ();
$user_list = getChatterList ();

if($running_mode != 3){
$ipsclass->vars['flashchat_room'] = "There are <b>".$chatters ['room_numbers']." </b> rooms<br>";
$ipsclass->vars['flashchat_connection'] = "There are <b>".$chatters ['connections']." </b> connections<br>";
}
$ipsclass->vars['flashchat_logon'] = "There are <b>".$chatters ['logon_users']." </b> logon users<br>";
$ipsclass->vars['flashchat_list'] = "User list: <b>".$user_list." </b> <br><br>";
----------------------------------------------------------------------------------------------------------------------------------





    2). 1 OPEN: Admin Panel -> "Look & Feel" -> then under that box, locate to "Edit HTML Templates"

        2 Look for the title of your skin, then locate to "Edit Template HTML"

        3 Choose Board Index -> birthday ->  Fill in following code to add befor the content, then commit changes.


----------------------------------------------------------------------------------------------------------------------------------
<!-- 123 Flash Chat Server Software Mod Begin -->
<tr><td class="row1" width="1%"><a href="http://www.123flashchat.com" onClick="openChat
();return false;" onMouseOver="window.status='123flashchat';return true"><img 
src='style_images/<#IMG_DIR#>/123flashchat.gif' border='0'  alt='Closed' /></a></td>
<td class="row2">
             {$this->ipsclass->vars['flashchat_room']}     
             {$this->ipsclass->vars['flashchat_connection']}
             {$this->ipsclass->vars['flashchat_logon']}
             {$this->ipsclass->vars['flashchat_list']}
            </td></tr>
            <script language="javascript" src="chatwinsize.php"></script>
<!-- 123 Flash Chat Server Software Mod End --> 
----------------------------------------------------------------------------------------------------------------------------------



       4 "Edit Template HTML" -> Choose All Global Html -> global board header


       FIND:
-----------------------------------------------------------------------------------------------------------------------------------
<a href="{$this->ipsclass->base_url}act=calendar">{$this->ipsclass->lang['tb_calendar']}</a>
-----------------------------------------------------------------------------------------------------------------------------------




       AFTER ADD
----------------------------------------------------------------------------------------------------------------------------------
<a  href="http://www.123flashchat.com" onClick="openChat();return false;" onMouseOver="window.status='123flashchat';return true">
Chat</a>
----------------------------------------------------------------------------------------------------------------------------------



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

            Configure the following parameters:
                                                      $running_mode
            Configuration reference:
                                                      $running_mode = 1; (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:                    <IPB installed directory>/flashchatconf/config_local.php


               Configure the following parameters:
                                                  
                                                      $chat_group
                                                      $client_size_width
                                                      $client_size_height
                                                      $chat_data_path
                                                      $primary_server_host
                                                      $primary_server_port
                                                      $chat_client_root_path
                                                      $swf_file_name (modification is not recommended)
                            
               Configuration reference:
                                                      $chat_group            =  "default";
                                                      $client_size_width     =  634;
                                                      $client_size_height    =  476;
                                                      $chat_data_path        =  "<123flashchat install directory>/server/data/default/"; 
                                                      $primary_server_host   =  "localhost";
                                                      $primary_server_port   =  51127;
                                                      $chat_client_root_path =  "http://www.123flashchat.com/";
                                                      $swf_file_name         =  "123flashchat.swf";  



             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:                    <IPB installed directory>/flashchatconf/config_host.php

               Configure the following parameters:

                                                      $chat_group 
                                                      $client_size_width
                                                      $client_size_height
                                                      $primary_server_host
                                                      $primary_server_port 
                                                      $chat_client_root_path (Not Necessary)
                                                      $swf_file_name (Modification is not recommended)

               Configuration reference:
                                                      $chat_group            =  "default";
                                                      $client_size_width     =  634;
                                                      $client_size_height    =  476;
                                                      $primary_server_host   =  "www.123flashchat.com";
                                                      $primary_server_port   =  51128;
                                                      $chat_client_root_path =  "";
                                                      $swf_file_name         =  "123flashchat.swf";  
 
             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:                    <IPB installed directory>/flashchatconf/config_free.php

               Configure the following parameters:

                                                      $room_name 

               Configuration reference:
                                                      $room_name              =  "YourRoomName";
                                                      (If you leave $room_name as blank, the default $room_name's value will be your domain's name.)



Step 4, Integrate your chat with IPB 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 -> Integrate Panel
 
            2. Find: DataBase -> SELECT: URL -> edit 
      
            3. Change URL:
                 http://<IPB install directory>/login_chat.php?username=%username%&password=%password%

            4. Press OK to save your setting.
   