Jump to content


Photo

Checking to see if a user is connected every 5 minutes


  • Please log in to reply
3 replies to this topic

#1 predator12341

predator12341
  • Members
  • PipPipPip
  • Advanced Member
  • 87 posts
  • LocationCheshunt, Hertfordshire, England

Posted 03 May 2006 - 03:20 PM

Hi i was just wondering if i have a frame that is always open can i make it check for example every 5 minutes if a user is still logged on and if it is it plays a sound or something

thanks regards Mark
[a href="http://www.sloganizer.net/en/" target="_blank"][/a]

#2 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 03 May 2006 - 03:44 PM

If your database has an entry for activity that when ever a page is loaded the entry is updated with a timestamp.

To check if users online you would query the database for activity that is less than 5mins from present time.

If it doesnt make sense I can try and find my code that I use to show users that are actively online :)

#3 predator12341

predator12341
  • Members
  • PipPipPip
  • Advanced Member
  • 87 posts
  • LocationCheshunt, Hertfordshire, England

Posted 03 May 2006 - 03:58 PM

na i understand so each time a page is changed the db is updated with the new time stamp but that is not very acuate as if they are a slow reader and reading a long post then it will not be a possitive thing that is the only trouble there as i thought of something like that
[a href="http://www.sloganizer.net/en/" target="_blank"][/a]

#4 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 03 May 2006 - 04:01 PM

you have 2 options: make a seperate script that does the check and setup a cronjob to be executed every 5 minutes, but then this doesn't really solve your "slow reader" problem.

other option is to look into client side scripting such as javascript, where content can be updated "live" on their side, as php is dependent on the user clicking the next linkie or whatever.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users