PDA

View Full Version : Forumhome Chat Bar


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.

DemiNeo0101
08-29-2002, 07:53 PM
nice job. Im gona install You hack AND JJR512's hack. What step should i stop at thoughin JJR512's hack to start installing yours?

FASherman
08-29-2002, 07:55 PM
Originally posted by DemiNeo0101
nice job. Im gona install You hack AND JJR512's hack. What step should i stop at thoughin JJR512's hack to start installing yours?

;) The last one

His (damned good) entire hack is a prereq.

gc1
09-15-2002, 06:02 PM
I have only one little problem

I have several networked computers here I log on when I log on as the administrator and go to the chat it lists me in the user count

But when I log onto another pc as just a reg user it does not count them, I do have show online activated for that usergroup.

Overall fantastic mod, and I really appreciate the efforts of all the people here for their fantastic work.

Jeff

NexDog
09-15-2002, 10:04 PM
I guess this won't work with SigmaChat and wot-Mike's hack?

Larry@IOG
09-16-2002, 11:02 PM
2 things when someone is in the chat room it does not show it on Users chatting:0 when you clisk the link it shows where all of the users are. And the light bulb is always off. I also have a registered copy of IRC Chat that is registered on the same website just not inside the forums how do I get my registered copy to show up?

Thanks

Larry

mackers8923
01-27-2003, 01:48 AM
Is it possible to show the users in chat in the template postbit by adding a href="online.php?s=$session[sessionhash]">Users in chatroom: $chatters[results]</a>

I have tried the text and link come up but no results ever show.

Any idea's

mackers8923
01-27-2003, 11:23 AM
Everything seems to be fine until this morning when I read my email and I received about 20 database error's. As soon as I get the error again I will post the code as it has went clean out of my head.

Still a damm good hack though

Invalid SQL: SELECT count(*) as results from session where lastactivity> AND location=concat('/forums/chat.php?s=',sessionhash)
mysql error:

This is the error I get! ANy Idea's