Online Offline

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.

Online Offline

Postby Epiales » Wed Oct 08, 2014 8:05 pm

Me again lol...

Been thinking of having an icon in a users profile that would show it they are online or offline. If it's online, then the icon would show colored, if offline, then it would show black or something. I can probably figure out the icon in php but have no idea where to begin to setup the online/offline in php. Any ideas?
Nothing fancy, but a work in progress!

http://gameplaytoday.net
User avatar
Epiales
 
Posts: 1119
Joined: Wed Aug 14, 2013 8:38 pm
Has thanked: 62 times
Been thanked: 6 times

Re: Online Offline

Postby MikuzA » Thu Oct 09, 2014 12:47 am

A simple solution would be that you store some kind of 'last_activity' timestamp, and if that timestamp is over 5-10 minutes old, that would mark the user offline. Otherwise Online.
Why so serious?

Business Intelligence, Data Engineering, Data Mining
PHP, HTML, JavaScript, Bash/KornShell, Python, C#, PL/SQL
MySQL, DB2, Oracle, Snowflake
Pentaho, DataStage, Matillion, Unity3D, Blender
User avatar
MikuzA
 
Posts: 395
Joined: Thu Aug 08, 2013 3:57 am
Location: Helsinki, Finland
Has thanked: 0 time
Been thanked: 21 times


Return to Beginner Help and Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron

x