Version: , by WEBDosser
Developer Last Online: Apr 2020
Version: Unknown
Rating:
Released: 08-12-2001
Last Update: Never
Installs: 0
No support by the author.
i have this installed on my site but would like to know if there is a way of telling people that some is in the chatroom, say like there username changes colour or something like that. or even the link to it on the main forum page adds the number or name of the people in there..
I think this would be a great hack.
Thnx..
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Be warned, the full scale integration that you speak of is not for the faint of heart. It requires considerable resources and know-how. More than I posses anyway .
This is a PHP program that creates a daemon in the chat room. Behind it lives a few MySQL tables. Basically after configuration (which when I have time I'll post, but its not hard to figure out), the bot logs all user in/out activity in a SQL Database. All it takes is this query to get who's in the room(s):
Code:
select DISTINCT nick as username from chan_users where (chan_name = '#general_rem' or chan_name='#everything_else') and reason IS NULL AND nick !='murmurs_bot';
Similar code gets you the amount of time. Basically I modified some code from the PHPMyChat hack to do this:
PHP Code:
// CHAT HACK
// Ok Get Users and Stats
$chatusers=$DB_murmurs->query("select DISTINCT nick as username from chan_users where chan_name = '#general_rem' AND mode='u' and reason IS NULL AND nick !='rem_bot';");
if ($chatuser=$DB_murmurs->fetch_array($chatusers)) {
$numchatusers = $DB_murmurs->query_first("select count(nick) as chatcount from chan_users where chan_name = '#general_rem' AND mode='u' and reason IS NULL AND nick !='rem_bot';");
$numchatuser = $numchatusers[chatcount];
$chatusername=$chatuser[username];
$activechatusers=$chatusername;
while ($chatuser=$DB_murmurs->fetch_array($chatusers)) {
$chatusername=$chatuser[username];
$activechatusers.=", ".$chatusername;
}
if ($numchatuser == 1) {
$numchatuser = "There is ".$numchatuser." person in the chat room";
} else {
$numchatuser = "There are ".$numchatuser." people in the chat room";
}
$lightbulb = 'on';
} else {
$lightbulb='off';
$numchatuser = "Nobody is in the chat room at this time.";
}
eval("\$chatinfo .= \"".gettemplate("chatloggedin")."\";");
// END CHAT HACK
Then, just use the jPilot hack already posted.
But the key is the php_egg program. Also, I did a cron job that restarts the bot every half hour, just to make sure it stays alive. Right now our IRC server is in a different datacenter, so it died sometimes.
I have mine integrated as a forum in my boards as well. I don't have the resources or the knowledge to do the eggbot hack either.
I am wondering- is there a way to use this in conjunction with the Who's Online information? If someone is in the chat forum, I think they show up on the Who's Online Page since it's still a forum. I wonder if there is a way to take that info (those who are only in the chat forum) and place it in a Who's In Chat list beneath the Online Users on the main page. I know that was done with the eggbot, but is there a way to do it with the logged in user tables instead?
Originally posted by TigerLily I have mine integrated as a forum in my boards as well. I don't have the resources or the knowledge to do the eggbot hack either.
I am wondering- is there a way to use this in conjunction with the Who's Online information? If someone is in the chat forum, I think they show up on the Who's Online Page since it's still a forum. I wonder if there is a way to take that info (those who are only in the chat forum) and place it in a Who's In Chat list beneath the Online Users on the main page. I know that was done with the eggbot, but is there a way to do it with the logged in user tables instead?
TigerLily
Yeah, you can use the "location" field in the users session information to see if they are on the chat page. I was thinking about doing this, but with the realtime nature of chat, that 15 minutes before their session timed out was bothersome. Users would get mighty pissed if they saw 15 people in a room and found out they were there 10 minutes ago but that was the last page they were on.
The Eggbot hack requires a cron job, so you do need root access to use it. The cron job restarts the bot every hour or so just to make sure it keeps running. I could always program a watcher program to see if its running and restart it if it stops, but a cron job does it nicely with minimal fuss.
But, on the bright side its worked like a charm this week and users really dig it.
Thanks, Ethan! I am probably going to go with the location field method- I want to keep it as simple as possible. My members are pretty chatty- there is usually someone in there anyhow! Thanks for illustrating the eggbot method (ROFL- I think of egg drop soup everytime I hear "eggbot") If I get really adventurous, I'll give it a whirl!
TigerLily
The JPilot integration has been going really nicely, and I'm getting ready to launch it publicly. The problem is still making the people in the chat room show up.
I want the chatters to show up in Who's In Chat just like the $activeusers do in Who's Online, pulling the info from the location field. I can install other hacks fine, and do small hacks with html and variables, but I'm lost on this one. I know the answer has to be fairly simple!
I want to: determine if the user is on the chat forum, get the users name and stick it on the main page in Who's in Chat (like Who's Online. I've also added $chatusers to the forumhome_loggedinusers template.
Here is what I have so far. I know it's wrong, perhaps someone can show me what I am missing and doing wrong!
if ($location['forum']==105) { //chatuser hack
$chatuser=$loggedin['username'];
}
105 is the number of my forum which I've converted to do chat in. Any help would be appreciated! I will also try the chat user hack a few posts up and see if that works. I don't have an egg bot, maybe there is a way to alter that code.
Thanks,
TigerLily
PS If you are trying to integrate Jpilot and you're having trouble with the smilies showing up, put them in their own table. I don't know why it makes a difference, but it works!