![]() |
phpMyChat - # of users in CHAT
Below is a hack I modified to show the number of users in your integrated phpMyChat.
Requirements: phpMyChat tables must be in the same database as vBulletin tables! 1. Add this code... * If you want this to show up in your HEADER, you must add it to global.php * If you want this to show up on the body of your home page, add it to index.php ~~~~~~~~~~~~~~~~ //CHAT USER COUNT // Cleanup Old Users // 240 = Wait 4 mins before deleteing inactive users //CHAT DIRECTORY GOES HERE $chatdir='./chat' $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"); $numchatters = $numchattersa[username]; if ($numchatters==1) { $membertext="member"; $istext="is"; } else { $membertext="members"; $istext="are"; } $chatinfo = " There $istext <font color=red>$numchatters</font> $membertext in <a href=$chatdir/index.php3 >CHAT</a>"; //END CHAT USERS ~~~~~~~~~~~~~~~~ 2. Add the variable $chatinfo in whatever template (spot) you want to put this phrase. NOTES: * It will use the correct english for all numbers - example: There are 0 members in chat There is 1 member in chat There are 43 members in chat * Example on http://www.babynames.com/boards Cheers! Jennifer. |
Sorry, but this has already been released by Mem and me sometime before, so its not needed.
Reference: https://vborg.vbsupport.ru/showthrea...threadid=37397 |
I said in my original message that it was a hack I **MODIFIED**
This version explains how to put it into the HEADER, it eliminates the need to create a custom template, and also puts in the correct English for all situations. Jennifer. |
Don't get touchy about it, I was just saying. Its nicer to put things in templates then headers, easy to modify. ;)
|
All times are GMT. The time now is 11:19 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|