General > Support

Is an online operator?

(1/1)

arakan:
Hello guys, I need to show on my site if an operator with a specific code is online or not.
How to do this?

best regards

arakan:
Hi all,

I think this is the best way:

<?php

require('libs/init.php');

echo is_operator_online(1)?'online':'offline';

exit;

?>

scalior:
Hello,

is_operator_online() would work just as you have described. However, this id (or 'code') that is passed into the function is a database id, which is not something that is easily exposed to a user interface.

On that admin panel under "Operators -> [username] -> General", there is a code field there. I have never tried to use it so I don't know how it works. Not sure what your use case is, but it may be worth plugging into that such that you rely on a user defined value rather than a database id.

Navigation

[0] Message Index

Go to full version