Author Topic: Is an online operator?  (Read 4407 times)

0 Members and 1 Guest are viewing this topic.

arakan

  • Jr. Member
  • **
  • Posts: 2
Is an online operator?
« on: May 05, 2016, 02:34:22 PM »
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

  • Jr. Member
  • **
  • Posts: 2
Re: Is an online operator?
« Reply #1 on: May 05, 2016, 04:45:46 PM »
Hi all,

I think this is the best way:

<?php

require('libs/init.php');

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

exit;

?>

scalior

  • Global Moderator
  • Native
  • *****
  • Posts: 106
  • Serve customers on mobile. Get Wurrd for Mibew app
    • Wurrd for Mibew
Re: Is an online operator?
« Reply #2 on: May 05, 2016, 06:31:01 PM »
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.