Flash Irc Chat
##############################################################
## : IRC Chat MOD
## : devzone < devzone@ramicohen.com >
## : . .

## : 2.0.1
##
## :
## :12
## : language/lang_english/lang_admin.php
## language/lang_english/lang_main.php
## templates/subSilver/overall_header.tpl
## includes/page_header.php
## includes/constants.php
## viewonline.php
## : chat.php
## chat.tpl
## icon_mini_chat.gif
## irc_chat_config_body.tpl
## admin_irc_chat.php
#
#-----[ ]------------------------------------------
#
chat.php chat.php
chat.tpl o templates/subSilver/chat.tpl
icon_mini_chat.gif o templates/subSilver/images/icon_mini_chat.gif
irc_chat_config_body.tpl to templates/subSilver/admin/irc_chat_config_body.tpl
admin_irc_chat.php o admin/admin_irc_chat.php
#
#-----[ ]------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ ]------------------------------------------
#
//
// That's all, Folks!
// -------------------------------------------------
#
#-----[ ]------------------------------------------
#
/
// MOD: IRC Chat v2.0.0
//
$lang['IRC_Chat_General_Config'] = 'General IRC Chat Configuration';
$lang['IRC_Chat_Config_explain'] = 'The form below will allow you to customize all the IRC Chat MOD options.';
$lang['IRC_Chat_General_Settings'] = 'General chat settings';
$lang['irc_chat_room_default'] = 'Default chat room';
$lang['irc_chat_room_default_explain'] = 'Leave blank to use site name as default chat room name';
$lang['irc_chat_rooms_string'] = 'Chat rooms in main list';
$lang['irc_chat_rooms_string_explain'] = 'Use comma separated values (my room1,my room 2,etc).Leave blank to use ICQ\'s default chat rooms list.';
$lang['irc_chat_width'] = 'Flash width in px.';
$lang['irc_chat_width_explain'] = '(rec. 585)';
$lang['irc_chat_height'] = 'Flash height in px.';
$lang['irc_chat_height_explain'] = '(rec. 350)';
$lang['irc_chat_frame_height'] = 'Frame/pop-up height in px.';
$lang['irc_chat_frame_height_explain'] = '(rec. 400)';
$lang['irc_chat_page_mode'] = 'Open chat in';
$lang['irc_chat_page_mode_page'] = 'Normal page';
$lang['irc_chat_page_mode_frame'] = 'Frame';
$lang['irc_chat_page_mode_pop'] = 'Pop-up';
$lang['irc_chat_permissions'] = 'Chat permissions';
$lang['irc_chat_permissions_explain'] = 'This is an IRC room, so users can enter using other IRC program (i.e. MIRC).';
$lang['irc_chat_show_online'] = 'Show number of online users next to chat link';
$lang['irc_chat_show_online_explain'] = 'Based on users that are curnntly on the chat page NOT the chat room';
$lang['irc_chat_allow_link'] = 'Allow guests to enter chat page';
$lang['irc_chat_allow_link_explain'] = 'If not allowed - guests will be promped to login to access chat';
$lang['irc_chat_allow_chat'] = 'Allow guests to write in chat';
$lang['irc_chat_allow_chat_explain'] = 'Guests can only view, but not type in flash.';
//
// MOD: -END-
//


#
#-----[ ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ ]------------------------------------------
#
/
// That's all, Folks!
// -------------------------------------------------
#
#-----[ ]------------------------------------------
#
//
// MOD: IRC Chat v2.0.0
//
$lang['IRC_Chat'] = 'Chat';
$lang['IRC_chat_guests_not_allowed'] = 'You need to login to join the chat';
//
// MOD: -END-
//

#
#-----[ ]------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ ]------------------------------------------
#
<td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">
#
#-----[ ]------------------------------------------
#
{L_MEMBERLIST}</a>
#
#-----[ ]------------------------------------------
#
<a href="{U_IRC_CHAT}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_chat.gif" width="12" height="13" border="0" alt="{L_IRC_CHAT} {L_ONLINE_CHAT_USERS_EXPLAIN}" hspace="3" />{L_IRC_CHAT} {L_ONLINE_CHAT_USERS}</a>
#
#-----[ ]------------------------------------------
#
includes/page_header.php

#
#-----[ ]------------------------------------------
#
//
// Obtain number of new private messages
#
#-----[ ]------------------------------------------
#
//
//IRC Chat MOD 2.0.0
//

//Get chat online users
$chat_online_users = 0;

if ($board_config[irc_chat_show_online])
{
$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
AND s.session_time >= ".( time() - 300 ) . "
AND s.session_page = ". PAGE_IRC_CHAT ."
ORDER BY u.username ASC, s.session_ip ASC";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);
}


$prev_user_id = 0;
$prev_user_ip = $prev_session_ip = '';

while( $row = $db->sql_fetchrow($result) )
{
// User is logged in and therefor not a guest
if ( $row['session_logged_in'] )
{
// Skip multiple sessions for one user
if ( $row['user_id'] != $prev_user_id )
{
$chat_online_users++;
}
$prev_user_id = $row['user_id'];
}
else //user is a guest
{
// Skip multiple sessions for one user
if ( $row['session_ip'] != $prev_session_ip )
{
$chat_online_users++;
}
}

$prev_session_ip = $row['session_ip'];

}
$db->sql_freeresult($result);
$l_chat_online_users = "(".$chat_online_users.")";
$l_chat_online_users_explain = $l_chat_online_users." ".$lang['Online_explain'];
}

//generate chat URL
$u_irc_chat = append_sid('chat.'.$phpEx);

if ($board_config['irc_chat_page_mode'] == 2){ // page in frame mode
$u_irc_chat .= "\" target=\"_top";
}else if ($board_config['irc_chat_page_mode'] == 1){ // page in popup mode
$irc_width = $board_config['irc_chat_width'] + 50;
$u_irc_chat = "$u_irc_chat\" target=\"chat_win\" onClick=\"javascript:window.open('".$u_irc_chat."','chat_win','width=".$irc_width.",height=".$board_config['irc_chat_frame_height'].",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes');";
}
//
// MOD: -END-
//
#
#-----[ ]------------------------------------------
#

'L_USERNAME' => $lang['Username'],
#
#-----[ ]------------------------------------------
#

//
// MOD: IRC Chat v2.0.0
//
'ONLINE_CHAT_USERS' => $chat_online_users,
'L_ONLINE_CHAT_USERS' => $l_chat_online_users,
'U_IRC_CHAT' => $u_irc_chat,
'L_IRC_CHAT' => $lang['IRC_Chat'] ,
'L_ONLINE_CHAT_USERS_EXPLAIN' =>$l_chat_online_users_explain,

//
// MOD: -END-
//

#
#-----[ ]------------------------------------------
#
includes/constants.php

#
#-----[ ]------------------------------------------
#
define('PAGE_TOPIC_OFFSET', 5000);
#
#-----[ ]------------------------------------------
#
//
// MOD: IRC Chat v2.0.0
//
define('PAGE_IRC_CHAT', -1155);
//
// MOD: -END-
//
#
#-----[ ]------------------------------------------
#
viewonline.php
#
#-----[ ]------------------------------------------
#
case PAGE_INDEX:
#
#-----[ ]------------------------------------------
#
case PAGE_IRC_CHAT:
$location = $lang['IRC_Chat'];
$location_url = "chat.$phpEx";
break;
#
#-----[ / ]------------------------------------------
#
# EoM

backup

DEMO
web-tourist.net

/ /