PDA

View Full Version : Show "who's in chat room" on forum home page with integrated phpmychat!


Velocd
04-11-2002, 03:38 AM
This would greatly help getting more people into my integrated phpmychat room, since when users are on the main forum page they can see who's online in the chat room.

Currently I'm only asking for a number (digit) of the people who are in the chat room, but if it were somehow possible to get it displaying the usernames, that would be really sweet. I know this isn't a Vbulletin hack, but in a sense it is since you are modifying/adding code to Vbulletin templates and php files. (it would also be really cool if done).

thanks :D

mem
04-11-2002, 04:06 AM
DO you want attachment ?? :p


sorry , my english is poll !! :paranoid:

Velocd
04-11-2002, 04:20 AM
You bet I do! In..uh, english that is http://www.diffusion4.com/images/smilies/sweatdroplaugh.gif

mem
04-11-2002, 04:31 AM
DO you want attachment ?? :p

if you want it . you need to


Looking for:
====================
index.php


} else {
$pminfo='';
}


Add the string after it....:
========================

//END CHAT HACK
// Cleanup Old Users First!
// 240 = Wait 4 mins before deleteing inactive users
$DB_site->query("DELETE from c_users where u_time < ".(time() - 240)." and u_time > 0");
$numchattersa = $DB_site->query_first("SELECT count(username) AS username FROM c_users");
// Ok Get Users and Stats
if ($bbuserinfo['userid']!=0) {
$chat_name = $DB_site->query("SELECT username FROM c_users");
while ( $chat_names=$DB_site->fetch_array($chat_name)) {
$chat_username .= "&nbsp;$chat_names[username]&nbsp;";
}
$numchatters = $numchattersa[username];
eval("\$chatinfo .= \"".gettemplate("chatlogged")."\";");
}



ADD chatlogged template
<font color=red> $numchatters</font> member<font color=green>$chat_username</font> in<a href="/green/chat/index.php3?
U=$username&PASSWORD=&N=20&D=10" target="_new" title="go to chat"> <font color=#B50101>your chat</font></a>
==========================

sorry , my english is poll !! :paranoid:

Velocd
04-11-2002, 06:04 PM
I hate to say it but that didn't work at all! I tried it and it simply gave me an error when I loaded up my forums. Are you talking about forum/index.php for another index.php? I can't see how the code above references to the chat log. Please help me out :D

almightyone
04-12-2002, 12:54 AM
well i agree a hack of this nature would be nice hopefully someone can get soemthing that works for us who would like to have it

mem
04-12-2002, 01:46 AM
i think about your database !!

beacause my chat install database the same vbb

and i do it (https://vborg.vbsupport.ru/showthread.php?s=&threadid=21329)

you can try again ;)

Velocd
04-12-2002, 02:10 AM
What Vbulletin version do you have mem? I tried to install it on 2.2.4 and just gave me errors. I'll try again though, hey what is the link to your forums mem? I wanna see the hack :D

mem
04-12-2002, 02:26 AM
Originally posted by Velocd
What Vbulletin version do you have mem? I tried to install it on 2.2.4 and just gave me errors. I'll try again though, hey what is the link to your forums mem? I wanna see the hack :D

i used vbb2.24 .

my forums http://www.greenkiss.com/green

;)

my chat http://www.greenkiss.com/green/chat/index.php3

Velocd
04-12-2002, 02:34 AM
Here is the error I get:

--------------------------------------------------------
Database error in vBulletin 2.2.4:

Invalid SQL: DELETE from c_users where u_time < 1018581979 and u_time > 0
mysql error: Table 'velocd_Vbulletin.c_users' doesn't exist

mysql error number: 1146

Date: Thursday 11th of April 2002 11:30:19 PM
Script: http://www.diffusion4.com/index.php?
Referer: http://www.diffusion4.com/admin/index.php?action=head
--------------------------------------------------------

Are there any values that I should be changing from your code??

mem
04-12-2002, 02:44 AM
the install of the datebase between the chat and vbb shold be in the same datebase

Velocd
04-12-2002, 03:13 AM
Same database..?? Don't each require 1 database, of their own? Let me check this out really quick on my cpanel...

edit:

Is there a way I can switch over my phpmychat database to the one using vbb (ofcourse maintaining the vbb). What config file do I use or to modify to specify a different database? Anybody?

mem
04-12-2002, 05:11 AM
IT's my database

version
04-12-2002, 07:31 AM
Originally posted by Velocd
Is there a way I can switch over my phpmychat database to the one using vbb (ofcourse maintaining the vbb). What config file do I use or to modify to specify a different database? Anybody?

https://vborg.vbsupport.ru/showthread.php?s=&threadid=37209

thehobbyforum
04-12-2002, 11:56 AM
I tried to install the hack as well on v2.2.5 - nothing - no error message or anything - I have already integrated vb and phpmychat - the template you have calls for others that are not automatically placed in the directory?

Velocd
04-12-2002, 04:18 PM
Originally posted by version


https://vborg.vbsupport.ru/showthread.php?s=&threadid=37209

That didn't help, I don't care for installing another hack. I think I know how to do this anyway now...

thehobbyforum
04-12-2002, 08:09 PM
OK got it working now - great hack - I changed a few things around to get it to wrok a little better - and read a little easier - outstanding!

Velocd
04-13-2002, 12:58 AM
I can tell you like airplanes THF. When I checked your hobby forums, I saw no reference whatsoever on the forum home page to how many users were currently online in the chat room, so I'm not sure where you put it or if you got it up. :/

thehobbyforum
04-13-2002, 01:01 AM
It is on the forums page under newest member!

Velocd
04-13-2002, 01:08 AM
???? Not seeing it.

(see attachment)

thehobbyforum
04-13-2002, 01:11 AM
Can you see the "store" info on the left side - I guess only members can see the who's chatting?

Velocd
04-13-2002, 01:59 AM
Sweet, I successfully (and very easily) moved my tables to another database, and now the hack works perfectly :D

thehobbyforum
04-13-2002, 02:03 AM
Glad you got it working - can you see it if you are not logged in?

Velocd
04-13-2002, 02:17 AM
Yeah, since I put it in my welcome panel that is viewable by all who come to the forums. Though I plan to move it elsewhere..

ONE problemo though, and thats that phpmychat at default clears the members inchat log every 4 minutes. Anyway to set this to possibly 1 minute? Since when a user leaves the chat it still shows up on the forum as him/her being in the chat.

I'm sure its some file in the chat directory, just not sure which..