Jump to content

Some simple (I think) codes! Please help!


maximator5

Recommended Posts

Hello and thank you for you're time!

 

I am developing a pbbg and I have a few issues:

 

1) How can I display the current users connected (ONLY the users logged in, not all the IP's connected to the site).

 

2) How can I do a code to display the ranking for the users (in the users table, the name is stored and on a different table, stats, the level and cash [just an example] is stored).

 

3) How can I display a current users online (not a number of total like in my first issue), with the name and level... something like this:

Online Players: MaximatoR (Level 5) | John (Level 10) | etc. .

 

Thank you again for you're time given ;):D !

Link to comment
https://forums.phpfreaks.com/topic/149674-some-simple-i-think-codes-please-help/
Share on other sites

simple no, not exactly..

 

depends on the exact way you have the tables set up, what the unique identifier is for the rows of the table so you know what rank goes with what user..

 

getting the number of online users.. is not an exact science but to get a general count I would say set up another table with ip's or usernames if they have to log in, and track the motion everytime the user moves around the site they stay active and update the table that tracks them with a timestamp or something and then you take the timestamps and have it check against the current time, any timestamps that fall active within the last x mins would count as a active member any not active or active longer then x ammount of mins is inactive..

 

as far as displaying the information it all depends on what you pull how you pull it and then how you want to display it. Unfortunately as little as this makes sence the possibilities are for a lack of better words endless.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.