Author Topic: Get the online off line status on homepage  (Read 7420 times)

0 Members and 1 Guest are viewing this topic.

Patmac

  • Full Member
  • ***
  • Posts: 6
Get the online off line status on homepage
« 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

faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 951
    • Mibew Messenger
Re: Get the online off line status on homepage
« Reply #1 on: August 25, 2017, 11:31:22 PM »
You already know the answer. There is a plugin for that. And it works well provided that you've installed it properly.

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.

Patmac

  • Full Member
  • ***
  • Posts: 6
Re: Get the online off line status on homepage
« Reply #2 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...


faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 951
    • Mibew Messenger
Re: Get the online off line status on homepage
« Reply #3 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.

Patmac

  • Full Member
  • ***
  • Posts: 6
Re: Get the online off line status on homepage
« Reply #4 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

Patmac

  • Full Member
  • ***
  • Posts: 6
Re: Get the online off line status on homepage
« Reply #5 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

Patmac

  • Full Member
  • ***
  • Posts: 6
Re: Get the online off line status on homepage
« Reply #6 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';
}
?>