PDA

View Full Version : [Request] Cool PHP ChatHack


09-02-2000, 03:25 PM
Hi all!

I need the ChatHack, which show me on the forum index page how many users in the chat.
All in one hack pls with ZIP file .. and so ...

Please .. i search all day long 4 it ...

ThX

09-02-2000, 03:36 PM
I don't know if I ever have posted this but it is what I use for phpMyChat. This code goes in $index.php. Just make sure to insert this code before the section in index.php that relates to 'loggedinusers'


// Chatters Hack

// Cleanup Old Users First!
// 240 = Wait 4 mins before deleteing inactive users

$DB_site->query("DELETE from c_users where u_time < ".(time() - 120)." and u_time > 0");

// Ok Get Users and Stats
$chatusers=$DB_site->query("SELECT username from c_users");
if ($chatuser=$DB_site->fetch_array($chatusers))
{

$numchatusers = $DB_site->query_first("SELECT COUNT(username) as chatcount from c_users");
$numchatuser = $numchatusers[chatcount];

$chatusername=$chatuser[username];
$activechatusers=$chatusername;
while ($chatuser=$DB_site->fetch_array($chatusers))
{
$chatusername=$chatuser[username];
$activechatusers.=", ".$chatusername;
}
if ($numchatuser == 1)
{
$numchatuser = "1 User";
}
else
{
$numchatuser = $numchatuser . " Users";
}
}
else
{
$numchatuser = "No Users";
}


$numchatuser will either be 1 User, X Users (more than 1), No Users
$activechatusers will be be the list of user names.

I access these two variables from the loggedinusers template.

09-02-2000, 03:55 PM
hmm..

where can i find phpmychat ???
and , i have to install it normaly?
then your source in index.php ,
and all must work ?

09-02-2000, 04:02 PM
Here ; http://www.phpheaven.net/phpmychat.php3

09-02-2000, 04:14 PM
oh man,
that site doesn´t work .... blank site

shit .. where can i get the chat zip file....

09-02-2000, 04:19 PM
Works for me but here is the file http://www.phpheaven.net/download.php3?f=phpMyChat-0.13.1.zip

09-02-2000, 05:01 PM
thx ! :)

09-02-2000, 05:12 PM
one question after all..

i have vbulletin installed in my mysql
can i install phpmychat in the same mysql?
without errors?

thx 4 answer!

09-02-2000, 05:26 PM
yes

09-02-2000, 05:27 PM
forget the question above.

so i installed the chat.

so now i desided, to insert the code in index.php
but if i do, i get an database error ! :(

and also i wondering, where the code is to login in the chat ! ?

please help ! thx

09-04-2000, 07:13 AM
After all... i inserted the code in index.php
and edited the templates...
but now, where is the text says " Click here to login chat" (if you are registered)
and "You must register to login the chat" (if you are a guest)

Sorry ´bout my bad english...
Please help me!
Thank you very much!

09-04-2000, 07:19 AM
I'm afriad that phpMyChat, due to the refreshing of the chat page, takes up a ton of system resources on high usage. Does anyone have test results of 100 users or more on the same chat for example?

10-19-2000, 06:46 PM
Thanks, that was useful! ;)

Mrd
08-07-2001, 04:33 PM
Him,
I use this hack, but by displayed on the main, the line was clear an no user are online.
In real there are 3 user online :(
Can anyone help me?

sorry for my bad english


Greetz MrD

I Use vb 1.15 and phpmy chat the last version