PDA

View Full Version : show usercount in nav bar, how?


masons_mum
09-24-2008, 12:08 PM
I have a custom page that my chatroom is on. I would like to have it so that it shows the number of users browsing the chatroom page in the nav bar...like this:

Chatroom (2)

Does anyone know how i can do this?

Lynne
09-24-2008, 03:41 PM
You should ask this in the modification thread since they know the database structure for the chatroom and know what query to make.

masons_mum
09-25-2008, 10:15 AM
ah i dont have a chatroom on my server, because i found no matter what chatroom modification i added, it kept hanging if any more than 4 users joined it. The chatroom is a big feature on my site. So basically i have a free hosted chatbox, from xat.com on a custom page, and so its how to add the amount of users browsing that page that i need to know.

Lynne
09-25-2008, 02:36 PM
ah i dont have a chatroom on my server, because i found no matter what chatroom modification i added, it kept hanging if any more than 4 users joined it. The chatroom is a big feature on my site. So basically i have a free hosted chatbox, from xat.com on a custom page, and so its how to add the amount of users browsing that page that i need to know.
There is no way for us to just guess how to write a query to grab the number of users when we have no idea how that chatbox works.

masons_mum
09-25-2008, 06:58 PM
its not to show whom is in the chatroom, its to show the count of whom is browsing the page itself that the chatroom is on. :)

Lynne
09-25-2008, 07:29 PM
Well, a good place to start for that would be to copy the code in the showthread.php page that grabs the users browsing the thread (or the forumdisplay.php page which does the same only for the forum). It starts around line 1728. If all you want is the number, you can probably simplify that quite a bit - like you won't need all the stuff to do with the forumdisplay_loggedinuser template. The query gets it's data from the session table, so you'll want to modify the query to grab just sessions where the user has that page in the location field. I'm terrible at writing queries to work on live sites where I can only try it on a test site so I won't try with this one. Perhaps you can do it or someone else will wander in and try.

masons_mum
09-25-2008, 09:28 PM
eek sounds complex! Mind you i like a challenge so may have a look myself. Thanks for taking the time to help me :)