Username:  
Password:  
Register 
It is currently Tue May 20, 2025 12:09 pm

All times are UTC [ DST ]





Post new topic Reply to topic  [ 9 posts ] 
  Print view Previous topic | Next topic 
Author Message
 Post subject: ********** New fangled chat room **********
PostPosted: Sat Mar 31, 2007 7:22 pm 
Offline
User avatar

Joined: Thu Aug 17, 2006 8:25 pm
Posts: 22595
Because some people seem to have problems with the old on,here is a new improved version.

You need to be registered and logged in to use it.


Image


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 31, 2007 7:24 pm 
Offline
User avatar

Joined: Thu Aug 17, 2006 8:25 pm
Posts: 22595
Please confirm that it works for everyone.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 31, 2007 7:37 pm 
I can't find it!!!! confised confised

Whereabouts is it!?!? confised confised

:laugh: :laugh: :laugh: :laugh:


Top
  
 
 Post subject:
PostPosted: Sat Mar 31, 2007 8:23 pm 
Offline
User avatar

Joined: Thu Aug 17, 2006 8:25 pm
Posts: 22595
Seems to be fine. Great, that took a load of coding, here have a look:



#-----[ COPY ]------------------------------------------
#
copy chat.php to chat.php
copy chat.tpl to templates/subSilver/chat.tpl
copy icon_mini_chat.gif to templates/subSilver/images/icon_mini_chat.gif
copy irc_chat_config_body.tpl to templates/subSilver/admin/irc_chat_config_body.tpl
copy admin_irc_chat.php to admin/admin_irc_chat.php
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#
//
// That's all, Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// 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-
//


#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all, Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// 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-
//


#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]------------------------------------------
#
<td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{L_MEMBERLIST}</a>&nbsp;
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
&nbsp;<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>&nbsp;
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php

#
#-----[ FIND ]------------------------------------------
#
//
// Obtain number of new private messages
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
//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-
//

#
#-----[ FIND ]------------------------------------------
#

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

#
#-----[ BEFORE, ADD ]------------------------------------------
#

//
// 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-
//

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

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


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 31, 2007 8:25 pm 
i can see where you went wrong


Top
  
 
 Post subject:
PostPosted: Sat Mar 31, 2007 8:29 pm 
Offline
User avatar

Joined: Thu Aug 17, 2006 9:15 pm
Posts: 6471
Worked for me clappp


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 31, 2007 10:16 pm 
Offline

Joined: Sat Aug 19, 2006 5:48 pm
Posts: 1278
Nice bit of tidy coding too.

Well commented :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 01, 2007 3:04 am 
Piece of piss that coding lark. :roll: :laugh:


Top
  
 
 Post subject:
PostPosted: Sun Apr 01, 2007 1:29 pm 
Offline
User avatar

Joined: Thu Aug 17, 2006 11:26 pm
Posts: 5832
Location: number 8
it looks fine but

" AND s.session_time >= ".( time() - 300 ) . "

why have you opted for that time?

:laugh:

_________________
I have forgotten more than you will ever know


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Gadgies online

Dodgepots browsing this forum: Bazil, bobby lemonade, Brian Honour's Left Foot, charltonclive, Davcla, derwent, Essex poolie, Hartleblue, JackVet, Jamie1952, JBPoolie, Kebab&chips, Kenny Bottles, Kettering Poolie, Loopeltrah1960, Mikey76, Poolie27, Pools-on-trent, Porter’s porter, Stotty1908, TheNoose, Tonto1968, UKP, Warwick Hunt and 222 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  







The Bunker. The only HUFC forum with correct spelling and grammar.