FASherman
08-28-2002, 10:00 PM
First, giving credit...
This hack is an extension to [vB v2.2.1] Modification to the jpilot chat hack (https://vborg.vbsupport.ru/showthread.php?s=&threadid=33050&highlight=jpilot) by JJR512 which is a " modification to Trog's original hack integrating jpilot into vBulletin, as seen here: http://www.vbulletin.com/forum/show...&threadid=17866"
Enough for the intros...
There are about a million of these kind of things and I wasn't even going to release this except I was asked to via email.
Here is the demo sight: http://www.fasherman.com/forums
Its short, sweet and simple. Its a table that sits on forumhome. The main line is a link to main_chat.php
It shows how many people are in the chat room. Instead of wasting precious queries trying to list who is in the room, the entire line is link to "Who's Online" page which will show that info. Why reinvent the wheel?
If even one person is in the chat room, the "lightbulb" is on.
These instructions assume you have JJR512's hack installed. If you don't start there, then come back.
The instructions are simple: in index.php, find (near the very end):
eval("dooutput(\"".gettemplate('forumhome')."\");");
Above it, add:
//CHAT BANNER
$chatters=$DB_site->query_first("SELECT count(*) as results from session where lastactivity>$datecut AND location=concat('/forums/main_chat.php?s=',sessionhash)");
if ($chatters[results]!=0) {
$chatonoff="on.gif";
} else {
$chatonoff="off.gif";
}
eval("\$chatdisplay = \"".gettemplate('chatdisplay')."\";");
//CHAT BANNER END
Thats it for program mods.
Add a new template [b]chatdisplay[b] with the contents:
<table cellSpacing="0" cellPadding="0" width="100%" align="center" bgColor="{tableheadbgcolor}" border="0">
<tr>
<td>
<table cellSpacing="1" cellPadding="4" width="100%" border="0">
<tr id="cat">
<td bgColor="{categorybackcolor}" colSpan="2">
<normalfont color="{categoryfontcolor}"> <b>Chat</b></font></a></td>
</tr>
<tr align="middle">
<td vAlign="top" bgColor="{secondaltcolor}" width="15">
<img alt src="images/$chatonoff" border="0" width="15" height="15"></td>
<td align="left" bgColor="{firstaltcolor}">
<normalfont>
<img alt src="images/forum-icons/chat.gif" border="0" width="32" height="32"><b>
<a href="main_chat.php?s=$session[sessionhash]" style="color: #000020">
Forum Chat Room</a></b></font> <br>
<smallfont>The Forum Chat Room is a
Java-based chat room for the members of forums. You may<br> be asked to grant permissions to the chatroom software; please do so.
<br><a href="online.php?s=$session[sessionhash]">Users in chatroom: $chatters[results]</a>
</font></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
Modify template forumhome
Find:
<!-- main -->
Above it add:
$chatdisplay
Thats the whole thing, folks. Remember, this is subject to the same timeout considerations as the "user's online" list. It is possible that it may show users in chat who aren't actually there, but have left with the number of seconds set by the cookie timeout.
Attached in the GIF I use for completeness. Feel free to use yor own.
This hack is an extension to [vB v2.2.1] Modification to the jpilot chat hack (https://vborg.vbsupport.ru/showthread.php?s=&threadid=33050&highlight=jpilot) by JJR512 which is a " modification to Trog's original hack integrating jpilot into vBulletin, as seen here: http://www.vbulletin.com/forum/show...&threadid=17866"
Enough for the intros...
There are about a million of these kind of things and I wasn't even going to release this except I was asked to via email.
Here is the demo sight: http://www.fasherman.com/forums
Its short, sweet and simple. Its a table that sits on forumhome. The main line is a link to main_chat.php
It shows how many people are in the chat room. Instead of wasting precious queries trying to list who is in the room, the entire line is link to "Who's Online" page which will show that info. Why reinvent the wheel?
If even one person is in the chat room, the "lightbulb" is on.
These instructions assume you have JJR512's hack installed. If you don't start there, then come back.
The instructions are simple: in index.php, find (near the very end):
eval("dooutput(\"".gettemplate('forumhome')."\");");
Above it, add:
//CHAT BANNER
$chatters=$DB_site->query_first("SELECT count(*) as results from session where lastactivity>$datecut AND location=concat('/forums/main_chat.php?s=',sessionhash)");
if ($chatters[results]!=0) {
$chatonoff="on.gif";
} else {
$chatonoff="off.gif";
}
eval("\$chatdisplay = \"".gettemplate('chatdisplay')."\";");
//CHAT BANNER END
Thats it for program mods.
Add a new template [b]chatdisplay[b] with the contents:
<table cellSpacing="0" cellPadding="0" width="100%" align="center" bgColor="{tableheadbgcolor}" border="0">
<tr>
<td>
<table cellSpacing="1" cellPadding="4" width="100%" border="0">
<tr id="cat">
<td bgColor="{categorybackcolor}" colSpan="2">
<normalfont color="{categoryfontcolor}"> <b>Chat</b></font></a></td>
</tr>
<tr align="middle">
<td vAlign="top" bgColor="{secondaltcolor}" width="15">
<img alt src="images/$chatonoff" border="0" width="15" height="15"></td>
<td align="left" bgColor="{firstaltcolor}">
<normalfont>
<img alt src="images/forum-icons/chat.gif" border="0" width="32" height="32"><b>
<a href="main_chat.php?s=$session[sessionhash]" style="color: #000020">
Forum Chat Room</a></b></font> <br>
<smallfont>The Forum Chat Room is a
Java-based chat room for the members of forums. You may<br> be asked to grant permissions to the chatroom software; please do so.
<br><a href="online.php?s=$session[sessionhash]">Users in chatroom: $chatters[results]</a>
</font></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
Modify template forumhome
Find:
<!-- main -->
Above it add:
$chatdisplay
Thats the whole thing, folks. Remember, this is subject to the same timeout considerations as the "user's online" list. It is possible that it may show users in chat who aren't actually there, but have left with the number of seconds set by the cookie timeout.
Attached in the GIF I use for completeness. Feel free to use yor own.