The Arcive of vBulletin Modifications Site. |
|
phpMyChat - # of users in CHAT Details »»
|
|||||||||||||||||||||||||
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. Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
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. |
|
#4
|
||||
|
||||
|
Don't get touchy about it, I was just saying. Its nicer to put things in templates then headers, easy to modify.
|
![]() |
|
|