PDA

View Full Version : Jpilot Jirc Chat Integration (basic, but it works)...


mini2
01-03-2004, 10:00 PM
This is my first hack I've shared, because it's quite generic. It's not probably quite as "complete" as it could be with forum style integration, but it works very well for what I required.

Basically I have a chat room (jirc) on my site already, but I wanted to show the number of people in the chat room, in the same way the forum home lists the number viewing each forum.

I've uploaded my jpilot files to the forum directory, and called the main chat page chat.php

You could probably integrate it better by making a new chat.php file and creating a new chat template, but I don't want my chat room to look like part of the forums, so I didn't do it that way.

The way I've dont it requires two files to be modified, and one template modified.

How I did it.

index.php I added a few small changes to get the people in the chat room counted up.

In the mysql query below "### LOGGED IN USERS ###" after "session.lastactivity," I added:

/*hack*/session.location,/*end hack*/

And below "$inforum = array();" I added:

/*hack*/
$inchat=0;
/*hack*/

Then beneath "eval('$activeusers .= ", ' . fetch_template('forumhome_loggedinuser') . '";');

} " I added:

/*hack*/
if($loggedin['location']=='/forum/chat.php'){
$inchat++;
}
/*end hack*/

In includes/functions_forumlist.php below "### Start makeforumbit ###" I added:

/*hack*/
global $inchat;
/*end hack*/

That's it for file mods.

Then in forumhome_forumbit_level2_post under:

<if condition="$show['browsers']">
<span class="smallfont">
(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)
</span>
</if>

I added:

<if condition="$forum[forumid]==628 AND $inchat!=0">
<span class="smallfont">($inchat in Chat)</span>
</if>":

If you do this, replace the value for forumid with whatever id the forum has you use.

The forum must be added as a "link" forum to the chat room URL (chat.php) for it to show in the forum list.

As I say, there's probably other ways of doing this, and I've no real intention just now of upgrading this, but it works nicely.

Attached is a small screen shot of the chat room listing on the forumhome...

mini2
01-03-2004, 11:01 PM
Probably worth adding that for my chat room I check the user is logged in etc (which would be simple if you made a new chat template) and then I use the username for the log in:

<param name="NickName" value="$bbuserinfo['username']">
<param name="UserName" value="MINI2 $bbuserinfo['username']">


Hope that makes sense and this helps someone somehow!

:)

Chris Gwynne
01-04-2004, 12:21 AM
<param name="UserName" value="MINI2 $bbuserinfo['username']">

You don't need the MINI2 in there. ;)

mini2
01-04-2004, 06:32 AM
<param name="UserName" value="MINI2 $bbuserinfo['username']">

You don't need the MINI2 in there. ;)
Very true. I stuck it in so I can see at a glance who comes via the web, and who comes via IRC.

;)

d3nnis
01-06-2004, 12:36 PM
hi all I did something different for jpilot / vb3 integration , the mod can be found here :

https://vborg.vbsupport.ru/showthread.php?p=457345

:D

RichieBoy67
07-26-2004, 01:39 AM
Will this work with the VBXIRC hack???? It seems like it would but I'm not sure how I could get the popup chat box to show whos online.... ????