Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,683 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,232 people online right now. Registration is fast and FREE... Join Now!




live support online chat

 
Reply to this topicStart new topic

live support online chat

kavikavi
post 2 Jun, 2008 - 05:41 AM
Post #1


New D.I.C Head

*
Joined: 2 Jun, 2008
Posts: 1

how to setup in php Online/Offline Indicator image for site for live support Chat
User is offlineProfile CardPM

Go to the top of the page

quim
post 2 Jun, 2008 - 06:15 AM
Post #2


D.I.C Head

Group Icon
Joined: 11 Dec, 2005
Posts: 145



Thanked 2 times

Dream Kudos: 350
My Contributions


QUOTE(kavikavi @ 2 Jun, 2008 - 09:41 AM) *

how to setup in php Online/Offline Indicator image for site for live support Chat


An if statement to whatever indicated that you are online or offline: example

CODE
if( session == 'online' )
{
    $statusImg = 'onlineImage.png';
}
else
{
   $statusImg = 'offlineImage.png';
}
User is offlineProfile CardPM

Go to the top of the page

akozlik
post 2 Jun, 2008 - 10:06 AM
Post #3


D.I.C Addict

Group Icon
Joined: 25 Feb, 2008
Posts: 596



Thanked 22 times

Dream Kudos: 750
My Contributions


QUOTE(kavikavi @ 2 Jun, 2008 - 06:41 AM) *

how to setup in php Online/Offline Indicator image for site for live support Chat


Keep a table that holds all the users that are current logged in, and delete them from the table as they're logged out. Basically, when they log in, you insert their information into the database. When they log out, you delete them from the database.

Then, wherever you want to check for online/offline status, check if they're in that database. If they are, they're online. If they're not, they're offline. It's a pretty easy way to keep track of people's status on the site.

Hope that helps. Let us know if you have anymore questions.
User is offlineProfile CardPM

Go to the top of the page

JBrace1990
post 2 Jun, 2008 - 11:36 AM
Post #4


D.I.C Regular

Group Icon
Joined: 9 Mar, 2008
Posts: 474



Thanked 21 times

Dream Kudos: 350
My Contributions


akozlik, as nice as a suggestion as that is, there's a slightly better one... see, with yours, someone has to logout to be marked offline.... well, what if they never logout, but close the browser instead?

my suggestion is to add in a column in the user database that has "last_active." all you need to do is set up the time from now to the time from the column, and if it';s a certain amount, mark them online.
User is offlineProfile CardPM

Go to the top of the page

akozlik
post 2 Jun, 2008 - 11:47 AM
Post #5


D.I.C Addict

Group Icon
Joined: 25 Feb, 2008
Posts: 596



Thanked 22 times

Dream Kudos: 750
My Contributions


QUOTE(JBrace1990 @ 2 Jun, 2008 - 12:36 PM) *

akozlik, as nice as a suggestion as that is, there's a slightly better one... see, with yours, someone has to logout to be marked offline.... well, what if they never logout, but close the browser instead?

my suggestion is to add in a column in the user database that has "last_active." all you need to do is set up the time from now to the time from the column, and if it';s a certain amount, mark them online.


I definitely see what you mean. You could do something like that for sure. I actually believe MySpace runs similar to what I suggested, because you are always logged in unless you log out manually. That's why you can log into Myspace, not visit for a few days, but still receive all the spam. I think it all depends on how he wants to be set up. I figured that since it was a live chat, my suggestions should work. Either way should be alright though.
User is offlineProfile CardPM

Go to the top of the page

JBrace1990
post 2 Jun, 2008 - 01:17 PM
Post #6


D.I.C Regular

Group Icon
Joined: 9 Mar, 2008
Posts: 474



Thanked 21 times

Dream Kudos: 350
My Contributions


on myspace though, you're marked offline if you're not on for (i believe) 15 minutes...
User is offlineProfile CardPM

Go to the top of the page

akozlik
post 2 Jun, 2008 - 01:18 PM
Post #7


D.I.C Addict

Group Icon
Joined: 25 Feb, 2008
Posts: 596



Thanked 22 times

Dream Kudos: 750
My Contributions


QUOTE(JBrace1990 @ 2 Jun, 2008 - 02:17 PM) *

on myspace though, you're marked offline if you're not on for (i believe) 15 minutes...


Yeah I think they fixed that. You used to stay in indefinitely. A lot of the spammers would go through and look for males between 18-30 and spam them with those fake girl profiles. If you were online you would get one because you were more likely to check it out. Lame.
User is offlineProfile CardPM

Go to the top of the page

quim
post 2 Jun, 2008 - 01:48 PM
Post #8


D.I.C Head

Group Icon
Joined: 11 Dec, 2005
Posts: 145



Thanked 2 times

Dream Kudos: 350
My Contributions


QUOTE
site for live support Chat

I thought that he was asking about the admin stand of point like, if you have a web service and you want your costumers to see when your are online/offline.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 06:54AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month