﻿############################################################## 
## MOD Title: 123 Flash Chat Server Integration Module
## MOD Author: TOPCMM Software Corp. http://www.123flashchat.com <support@123flashchat.com >
## MOD Description: Realtime Chat Module for PHPBB users to use 123 Flash chat Server(a java chat server with flash client).
## 
##
############################################################## 
## Notes:
##
##     IMPORTANT!!!!
##     Before installing this mod, please download 123 Flash Chat Server software from
##     http://www.123flashchat.com/download.html
##     to get the lastest free demo version of 123 flash chat server software
##     
##
##       
##     Get support from : http://www.123flashchat.com/support.html
##     We provide online forum support, email support, online live support, and phone support, etc.
##
##
## Before Adding This MOD To Your phpbb, You Should Backup All Files Related To This MOD 
##############################################################
# 
#-----[ COPY ]------------------------------------------ 

copy 123flashchat.php                         		to <phpbb root directory>/123flashchat.php
copy login_chat.php                     	        to login_chat.php
copy includes/functions_chat.php                    to includes/functions_chat.php
copy templates/subSilver                            to templates/subSilver
(If your current skin is not subSilver,copy the file under templates/subSilver to your current skin folder)


#-----[ OPEN ]------------------------------------------ 

server.xml on the server side of your chat,
(the server side is not included in this download module package,
it won't be available until you've installed 123flashchat demo version!)
Sample URL of it:
<123FlashChatServer installed DIR>/server/etc/groups/default/server.xml

# 
#-----[ FIND ]------------------------------------------ 
# 
<integrated-other-database>None</integrated-other-database>

# 
#-----[ REPLACE WITH ]----------------------------------
#
<integrated-other-database>URL</integrated-other-database>

# 
#-----[ FIND ]------------------------------------------ 
# 
7 -  username banned . -->
  <auth-url charset="UTF-8">http://yourwebsite/phpbb_login_chat.php?username=%username%&amp;password=%password%</auth-url>

#  
#-----[ REPLACE WITH ]----------------------------------
#
7 -  username banned . -->
<auth-url>http://your_phpbb_url/phpbb_login_chat.php?username=%username%&amp;password=%password%</auth-url>

Restart the chat server after server.xml is modified to make the changes effective. 

#-----[ OPEN ]------------------------------------------  
123flashchat.php

# 
#-----[ FIND ]------------------------------------------ 
# 
/********* please modify your parameters ---- begin  ****************/

$chat_client_root_path = "";
$swf_file_name = "123flashchat.swf";
$skin_name = "default";
$language = "en";

set it to your current chat settings 


#-----[ OPEN ]------------------------------------------  
language/lang_english/lang_main.php:

# 
#-----[ FIND ]------------------------------------------ 
# 
$lang['Session_invalid'] = 'Invalid Session. Please resubmit the form.';

#  
#-----[ AFTER ADD ]----------------------------------
#
$lang['CHAT'] = 'Chat';

$lang['Chat_connections_zero'] = 'There are <b>0</b> user connected to the chat server'; 
$lang['Chat_connections'] = 'There are <b>%d</b> users connected to the chat server'; 
$lang['Chat_connection'] = 'There is <b>%d</b> user connected to the chat server'; 

$lang['Chat_rooms_zero'] = 'There are <b>0</b> Chat rooms'; 
$lang['Chat_rooms'] = 'There are <b>%d</b> Chat rooms'; 
$lang['Chat_room'] = 'There is <b>%d</b> Chat room'; 

$lang['Chat_logon_users_zero'] = 'There are <b>0</b> logon chatters'; 
$lang['Chat_logon_users'] = 'There are <b>%d</b> logon chatters '; 
$lang['Chat_logon_user'] = 'There is <b>%d</b> logon chatter';
$lang['Chat_logon_userlist'] = 'Chatting users: ';


#-----[ OPEN ]------------------------------------------  
includes/functions_chat.php:

# 
#-----[ FIND ]------------------------------------------ 
# 
$chat_data_path = "C:/Program Files/123FlashChatServer6.9.3/server/data/default/";

change it to the folder with following file in it( don't miss last "/") :

#-----[ OPEN ]------------------------------------------  
includes/page_header.php

# 
#-----[ FIND ]------------------------------------------ 
# 
	$l_online_users = sprintf($l_t_user_s, $total_online_users);
	$l_online_users .= sprintf($l_r_user_s, $logged_visible_online);
	$l_online_users .= sprintf($l_h_user_s, $logged_hidden_online);
	$l_online_users .= sprintf($l_g_user_s, $guests_online);

#  
#-----[ AFTER ADD ]----------------------------------
#

// begin 123 flash chat mod
	include($phpbb_root_path . 'includes/functions_chat.'.$phpEx);
	$chatters = getChatters();

	$c_connections = $chatters['connections'];
	$c_rooms = $chatters['room_numbers'];
	$c_logon_users = $chatters['logon_users'];

	if ( $c_connections == 0 )
	{
		$chat_connections = $lang['Chat_connections_zero'];
	}
	else if ( $c_connections == 1 )
	{
		$chat_connections = $lang['Chat_connection'];
	}
	else
	{
		$chat_connections = $lang['Chat_connections'];
	}

	if ( $c_rooms == 0 )
	{
		$chat_rooms = $lang['Chat_rooms_zero'];
	}
	else if ( $c_rooms == 1 )
	{
		$chat_rooms = $lang['Chat_room'];
	}
	else
	{
		$chat_rooms = $lang['Chat_rooms'];
	}

	if ( $c_logon_users == 0 )
	{
		$chat_logon_users = $lang['Chat_logon_users_zero'];
	}
	else if ( $c_logon_users == 1 )
	{
		$chat_logon_users = $lang['Chat_logon_user'];
	}
	else
	{
		$chat_logon_users = $lang['Chat_logon_users'];
	}

	$l_chat_connections = sprintf($chat_connections, $chatters['connections']);
	$l_chat_rooms = sprintf($chat_rooms, $chatters['room_numbers']);
	$l_chat_logon_users = sprintf($chat_logon_users, $chatters['logon_users']);

	$l_chat_user_list = $lang['Chat_logon_userlist'] . getChatterList();
	// end 123 flash chat mod
	

# 
#-----[ FIND ]------------------------------------------ 
# 
	'T_SPAN_CLASS1' => $theme['span_class1'],
	'T_SPAN_CLASS2' => $theme['span_class2'],
	'T_SPAN_CLASS3' => $theme['span_class3'],
	
#  
#-----[ AFTER ADD ]----------------------------------
#
	'L_123FLASHCHAT' => $lang['CHAT'],
	'U_123FLASHCHAT_POPUP' => append_sid('123flashchat.'.$phpEx),
	'CHAT_TOTAL_ROOMS' => $l_chat_rooms,
	'CHAT_TOTAL_CONNECTIONS' => $l_chat_connections,
	'CHAT_TOTAL_LOGON_USERS' => $l_chat_logon_users,
	'CHAT_USER_LIST' => $l_chat_user_list,

#-----[ OPEN ]------------------------------------------  
templates/subSilver/overall_header.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
</head>

# 
#-----[ BEFORE ADD ]------------------------------------------ 
# 
<script language="Javascript" type="text/javascript">
function openChat()
{
	window.open('{U_123FLASHCHAT_POPUP}', '_123flashchat', 'HEIGHT=476,resizable=yes,WIDTH=634');;
}
</script>

# 
#-----[ FIND ]------------------------------------------ 
#
<td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">&nbsp;<a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a>&nbsp; &nbsp;

# 
#-----[ AFTER ADD ]------------------------------------------ 
# 
<a href="http://www.123flashchat.com" onClick="openChat();return false;" onMouseOver="window.status='{L_123FLASHCHAT}';return true" class="mainmenu"><img src="templates/subSilver/images/icon_123flash_chat.gif" width="12" height="13" border="0" alt="{L_123FLASHCHAT}" hspace="3" />{L_123FLASHCHAT}</a>


#-----[ OPEN ]------------------------------------------  
templates/subSilver/index_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
#
<tr> 
	<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE} &nbsp; [ {L_WHOSONLINE_ADMIN} ] &nbsp; [ {L_WHOSONLINE_MOD} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>
  </tr>
# 
#-----[ AFTER ADD ]------------------------------------------ 
# 
<!-- 123 Flash Chat Server Software Mod Begin -->   <tr>  	<td class="row1" align="center" valign="middle" rowspan="2"><a href="http://www.123flashchat.com" mce_href="http://www.123flashchat.com" target="_blank" onClick="openChat();return false;" onMouseOver="window.status='';return true"><img src="templates/subSilver/images/123flashchat.gif" mce_src="templates/subSilver/images/123flashchat.gif" alt="open Chat" border="0"></a></td> 	<td class="row1" align="left" width="100%"><span class="gensmall">  <br>  <br>   <br>  </span> 	</td>   </tr>   <!-- 123 Flash Chat Server Software Mod End -->                               