Thread: Who's Online
View Single Post
  #14  
Old 01-26-2011, 08:57 AM
Kaeliah's Avatar
Kaeliah Kaeliah is offline
Premium Member
 
Join Date: Sep 2010
Location: Pennsylvania, United States
Posts: 485
Gender: Female
Credits: 33,249
Kaeliah will become famous soon enough
Send a message via AIM to Kaeliah Send a message via MSN to Kaeliah
Default

Quote:
Originally Posted by Forsaken View Post
ok so why not add something to the header that just adds say a one to the a cell in the user table everytime the header loads and then make a cron that takes away the one each minute.

It would be off by 59 seconds give or take but but if a person just wanted an idea of the useage that would work.

Or make it add the new time stamp to header so each time it loaded they put in a new time stamp.

My game shows the users online and it shows the number of seconds since they made their last click.

if something like this is still wanted I can make it work but I don't want to put a lot of time into something that people don't really want.

I'll be honest tho this script is written in a code that I don't really work with a lot, I was playing with it just to see and I got the cron 1 minute thing working, that is pretty simple but i was having a problem getting it to read the time stamp right.

I work in php but this thing is totally different from the way that I write. I am sure I can get the time stamp to go but like i said i don't want to spend a lot of time if really isn't wanted.
I fixed the posts. ^.^

Anyway, some of your suggestions might work, but they'd take up a lot of resources. Redoing a timestamp EVERY time someone loaded a page? I had a small site that got over 2000 page loads a day. I can't imagine how much it would be for a larger site.

Maybe make the session time out shorter, then everytime someone logs in record in it a new table and have a cron run by every hour to check to see if they're still logged in.
__________________
[My Shop] ♥ [My Blog] ♥ [Subscribe] ♥ [My Mods] ♥ [Mod TOS]
Reply With Quote