Mibew Messenger Community

General => Support => Topic started by: scko on July 25, 2011, 08:24:15 AM

Title: Online and Offline button indicator
Post by: scko on July 25, 2011, 08:24:15 AM
Hi! I would like to ask how could I disable the Offline button. So the only online button would be shown when operator is online. When operator is offline, the button for offline is not shown.

Thanks!
Title: Re: Online and Offline button indicator
Post by: John Carter on August 26, 2011, 07:19:02 AM
How about just displaying a blank image - ie plain white or whatever. Replace the existing one in the files.
Title: Re: Online and Offline button indicator
Post by: dan on November 09, 2011, 03:01:12 PM

To use it without the image use the below code...make certain the file locations are correct for your install.

<?php
require_once('libs/common.php');
require_once('libs/chat.php');
require_once('libs/operator.php');
require_once('libs/groups.php');

$groupid = verifyparam( "group", "/^\d{1,8}$/", "");
if($groupid) {
   loadsettings();
   if($settings['enablegroups'] == '1') {
      $group = group_by_id($groupid);
      if(!$group) {
         $groupid = "";
      }
   } else {
      $groupid = "";
   }
}
$image_postfix = has_online_operators($groupid) ? "on" : "off";

if ( $image_postfix == "on" ) {

   echo "<a class=\"button\" href=\"/wordpressmwl/chat/client.php?locale=en\" target=\"_blank\" onclick=\"if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 &amp;&amp; window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open('/wordpressmwl/chat/client.php?locale=en&amp;url='+escape(document.location.href)+'&amp;referrer='+escape(document.referrer), 'webim', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;\"><img src=\"\locales\en\button\webmin_on.gif\" /></a>";
}
echo "";
if ( $image_postfix == "off" ) {
   echo "";
}
echo "";

?>


Title: Re: Online and Offline button indicator
Post by: maitane on October 25, 2013, 01:20:31 PM
Thanks for the code, it helped so much!! :)