Author Topic: Online and Offline button indicator  (Read 11808 times)

0 Members and 1 Guest are viewing this topic.

scko

  • Jr. Member
  • **
  • Posts: 1
Online and Offline button indicator
« 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!


John Carter

  • Jr. Member
  • **
  • Posts: 2
Re: Online and Offline button indicator
« Reply #1 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.

dan

  • Jr. Member
  • **
  • Posts: 2
    • deniol.co.uk
Re: Online and Offline button indicator
« Reply #2 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 "";

?>



maitane

  • Full Member
  • ***
  • Posts: 7
Re: Online and Offline button indicator
« Reply #3 on: October 25, 2013, 01:20:31 PM »
Thanks for the code, it helped so much!! :)
« Last Edit: October 25, 2013, 02:03:28 PM by maitane »