vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Forumhome Chat Bar (https://vborg.vbsupport.ru/showthread.php?t=42915)

FASherman 08-28-2002 10:00 PM

Forumhome Chat Bar
 
First, giving credit...
This hack is an extension to [vB v2.2.1] Modification to the jpilot chat hack 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):

PHP Code:

eval("dooutput(\"".gettemplate('forumhome')."\");"); 

Above it, add:

PHP Code:

//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

Quote:

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


All times are GMT. The time now is 12:34 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01049 seconds
  • Memory Usage 1,742KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete