Mibew Messenger Community

General => Support => Topic started by: Patmac on August 25, 2017, 08:32:41 PM

Title: Get the online off line status on homepage
Post by: Patmac on August 25, 2017, 08:32:41 PM
What I mean by that is text instead instead of just the picture (at the moment my picture is just swapping pictures)

Thanks
Title: Re: Get the online off line status on homepage
Post by: faf on August 25, 2017, 11:31:22 PM
You already know the answer. There is a plugin (https://github.com/Mibew/mibew-operator-status-plugin) for that. And it works well provided that you've installed it properly (https://github.com/Mibew/mibew-operator-status-plugin#install).

But if you think you've found a bug in the plugin, you could open an issue in its repo at Github. But make sure that you've posted all details (i.e. what you're doing, what you're expecting to see, what you're actually seeing, all details about your system). Only it that case one would be able to help you.
Title: Re: Get the online off line status on homepage
Post by: Patmac on August 27, 2017, 01:56:06 PM
The plugin seems to be working in the control panel. I just have no idea what this means..

    * request URL: `<MIBEW-BASE-URL>/opstatus`.
    * return `true` when any operators is online and `false` when not.

Also do I make changes to the routing.yml file?
It's just hocus pocus to me this...

Title: Re: Get the online off line status on homepage
Post by: faf on August 28, 2017, 06:35:14 PM
The plugin seems to be working in the control panel.

So, on the Plugins page you see the state of the plugin as 'working', right?

I just have no idea what this means..

    * request URL: `<MIBEW-BASE-URL>/opstatus`.
    * return `true` when any operators is online and `false` when not.

??? Say, your Mibew Messenger is available as https://example.com/mibew/ . In this case one could request https://example.com/mibew/opstatus to get response containing either 'true', or 'false' as a text.


Also do I make changes to the routing.yml file?

No, you should not alter the routes.
Title: Re: Get the online off line status on homepage
Post by: Patmac on September 01, 2017, 11:41:54 AM
Yes I did all that, Plugin state working version 0.4.0.
when I type in http://mysite/chat/opstatus I get page not found. I tried it on two different webservers, switched off htaccess in case that was interfering still nothing all I got once was a certificate warning, but I still get a 404 page.
Any ideas? Thanks
Title: Re: Get the online off line status on homepage
Post by: Patmac on September 01, 2017, 11:48:25 AM
Update, after examining the admin page URL, I typed this in. http://mysite/chat/index.php/opstatus and law and behold, IT WORKS...!!!!!!!!!
Thanks for all the help Regards Pat
Title: Re: Get the online off line status on homepage
Post by: Patmac on September 01, 2017, 01:17:13 PM
My Solution is as follows... in case it will help someone else in the future...

<?php
$contents = file_get_contents('http://mydomain/chat/index.php/opstatus');
if ($contents == "true")
{
   echo 'We are online!';   
}
else if ($contents == "false")
{
   echo 'We are Offline';
}
else
{
   echo 'chat unknown';
}
?>