Version: 1.00, by EvilLS1
Developer Last Online: May 2021
Version: 3.0.6
Rating:
Released: 05-13-2004
Last Update: 05-14-2004
Installs: 13
DB Changes
No support by the author.
I don't know if any of you will find this useful but its something that I've wanted for a while. For me, the problem with all of the other "who's in chat" hacks is that most of them require something crazy to work (I have no idea what an eggdrop is). Anyway, this one is php/mysql based and should be easy to install.
Description: This will add a new section to your "What's going on?" block which will display a list of users who are currently chatting or viewing the included chat.php page (see screenshot). The list of current chatters is updated every 60 seconds by an auto-refreshing (hidden) iframe in the chat page.
This hack should work with any embedded (web based) IRC chat.
Installation overview:
*Files to edit: (1) -index.php
*Files to upload: (2) -chat.php & icon_chat.gif
*Templates to edit: (1) -FORUMHOME
*Templates to add: (3) -chat_main, chat_chatters, & chat_chatbit
*Queries to run: (1) Adds the chatters table.
After that you simply add the html code to embed your chat applet in the chat_chatbit template. You can then view your chatroom by going to yoursite.com/forums/chat.php.
Note: The list of chatters is updated every 60 seconds, so usernames will still be listed in the "who's in chat" box for up to a minute after they leave the chat page.
Credits: The idea for refreshing the iframe to update the chattime came from John's "extend session" feature in his V3Arcade hack. So thanks John.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
// Who's in chat
$chatdatecut = TIMENOW - 65;
$inchat=$DB_site->query("SELECT *
FROM " . TABLE_PREFIX . "chatters
WHERE chattime > $chatdatecut
ORDER BY username ASC");
if ($DB_site->num_rows($inchat)==0) {
$nobody = "No users are chatting.";
}
while ($chatting=$DB_site->fetch_array($inchat)) {
I've just added this and it works well ... except if a member has elected to be hidden he/she is still showing as online in the chatroom.
Amy ideas?
Yeah thats not a bug. I just didn't bother adding it because the hidden users will be listed in the chat's userlist anyway, so why hide them on forumhome? I didn't think it was necessary.
Moonclamp,
I can give you a quick fix which will make it so that hidden users are never shown in chat (even to those who have permission to see invisible users).
In chat.php find:
Code:
$somestuff = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "chatters WHERE userid=$userid");
if ($DB_site->num_rows($somestuff)!=0)
{
$DB_site->query("UPDATE " . TABLE_PREFIX . "chatters SET chattime = $time WHERE userid = $userid");
} else {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "chatters (username,chattime,userid) VALUES ('".addslashes($chatuser)."','$time','".intval($userid)."')");
}
Replace it with:
Code:
if ($bbuserinfo[invisible]!=1) {
$somestuff = $DB_site->query("SELECT * FROM " . TABLE_PREFIX . "chatters WHERE userid=$userid");
if ($DB_site->num_rows($somestuff)!=0)
{
$DB_site->query("UPDATE " . TABLE_PREFIX . "chatters SET chattime = $time WHERE userid = $userid");
} else {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "chatters (username,chattime,userid) VALUES ('".addslashes($chatuser)."','$time','".intval($userid)."')");
}
}