vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   jPilot (IRC chat) Integration (https://vborg.vbsupport.ru/showthread.php?t=33093)

PhotoGenie 02-05-2002 11:59 AM

If you want to be able to see whos in chat over threads list..

Use GeorgeofCS code from his hack on digichat. Here is a paste:

in forumdisplay.php

at the very bottom the right above:

eval("dooutput(\"".gettemplate('forumdisplay')."\" );");

add:

// Get users chatting
if ($showforumusers) {
$datecut = $ourtimenow - $cookietimeout;
$chatters = '';
$comma = '';
$forumusers = $DB_site->query("SELECT username, invisible, userid
FROM user
WHERE inchat = 1 AND
lastchatactivity > $datecut");
while ($forumuser = $DB_site->fetch_array($forumusers)) {
if (!$forumuser['invisible'] or $bbuserinfo['usergroupid'] == 6) {
$userid = $forumuser['userid'];
$username = $forumuser['username'];
if ($forumuser['invisible'] == 1) { // Invisible User but show to Admin
$invisibleuser = '*';
} else {
$invisibleuser = '';
}
eval("\$chatters .= \"".$comma.gettemplate('forumdisplay_loggedinuser' )."\";");
$comma = ', ';
}
}
if ($chatters) {
if (!$moderatedby) {
$onlineusers = "<br>";
}
eval("\$onlineusers .= \"".gettemplate('forumdisplay_loggedinusers')."\"; ");
}
}

Next in forumdisplay_loggedinusers template
change:

<br>(Users Browsing this Forum: $browsers)

to:

<br>(Users Browsing this Forum: $browsers)
<br>(Users In Chat: $chatters)

PhotoGenie 02-05-2002 12:07 PM

The only thing I dont like about the whos online is it doesn't log you out right away when you leave. You have to wait until your cookie times out. I set my cookie time out for 3 minutes and instead of putting "Members in chat" I put "Current/Recent" Chatters. I did this because some listed may not be in the room anymore, their cookie just hasn't timed out..

PhotoGenie 02-05-2002 02:13 PM

I decided to change where i put the chatters online in my main page .. I wanted under the pm messages at the bottom.. So I opened forumhome_pmloggedin template and put this at the bottom..

<tr id="cat">
<td bgcolor="{categorybackcolor}" colspan="6"><smallfont color="{categoryfontcolor}"><b>Current/Recent Chatters </b></smallfont><smallfont color="{categoryfontcolor}"></smallfont></td>
<tr>
<td bgcolor="{firstaltcolor}" colspan="6"><smallfont>$chatters</smallfont></td>
</tr></tr>

Instead of in my forumhome_loggedinuser template. Now it shows at the bottom plus its hidden from guest.. Guess you could find a bunch of different places you might want to put it.. These hacks are great, I'm having a lot of fun with them..:)

PhotoGenie 02-06-2002 05:51 PM

I wasn't satisfied with it not logging you out until your cookie timed out so I made another small change and to my surprise it worked.. This is working off my install of the whos chatting hack of Dom's to work with this hack..

I went back and changed the chat_index.php and added a simple pop up java script to it:

<html>
<head>
<title>Site Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function leave() {
window.open('http://www.your-site.com/chat_logout.php','','toolbar=no,menubar=no,locatio n=no,height=1,width=1');
}
// End -->
</SCRIPT>
</head>

<frameset onUnload="leave()" rows="1,*" frameborder="NO" border="0" framespacing="0">
<frame name="topFrame" scrolling="NO" noresize src="mainchat_top.php" >
<frame name="mainFrame" src="main_chat.php">
</frameset>
<noframes><body bgcolor="#FFFFFF" text="#000000">

</body></noframes>
</html>

Then I created chat_logout.php and inserted this:

<?php
require("global.php");
if( $bbuserid ) {

$DB_site->query("UPDATE user SET inchat='0' WHERE userid='$bbuserinfo[userid]'");
$DB_site->query("UPDATE user SET lastchatactivity=$ourtimenow WHERE userid='$bbuserinfo[userid]'");
} else {

} // end if
?>
echo <script>self.close();</script>
<head>

</head>

</body>
</html>

That was it.. Now it will log you out as soon as you leave the chat..
You may decide to change the time of the pop up window and incude html if you like with some text... No more waiting on the cookie to clear..

Jakeman 02-06-2002 06:56 PM

i don't like the way that hack gets the online chatters. i can do without it for now.

PhotoGenie 02-06-2002 08:06 PM

You mean with the refresh and all? I dont know much about this stuff. I just move things around until they work. I would like to see you (Jakeman) come up with a hack for this and include it in your present hack. My chatters miss each other without knowing whos in there. This integrated chat hack is still killer even without a whos in chat. I will use this until I see someone or you come up with something else. I'm willing to try anything just about. :)

Jakeman 02-07-2002 06:00 AM

[QUOTE]Originally posted by PhotoGenie
You mean with the refresh and all? I dont know much about this stuff. I just move things around until they work. I would like to see you (Jakeman) come up with a hack for this and include it in your present hack. My chatters miss each other without knowing whos in there. This integrated chat hack is still killer even without a whos in chat. I will use this until I see someone or you come up with something else. I'm willing to try anything just about. :)

lifesourcerec 02-09-2002 07:50 AM

[QUOTE]Originally posted by Jakeman
are you putting the chat.php and chatmain.php in the forum root? i just don't see how you could be getting these errors... the hack is pretty much straight forward and nonintrusive.

lifesourcerec 02-09-2002 08:07 AM

Fixed the problem. Too bad it cuts off the person's name (because of IRC server). I may add ls_ before the name

Jakeman 02-09-2002 08:34 PM

[QUOTE]Originally posted by lifesourcerec
Fixed the problem.


All times are GMT. The time now is 04:56 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01271 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete