Jump to content


Operator Box - Livezilla API


7 replies to this topic

#1 begreat

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts

Posted 03 November 2010 - 12:15 AM

Hi, i have made some changes to the demo of the operators box from livezilla:

You can check the original file here: http://picomatica.in.../api_sample.php

And my modified version here: http://picomatica.in.../picomatica.php

As you can see, what i did was changed the code so it would only show the operators that are connected and their current states.

This way i can let people know whitch operators are connected, and it hides the offline operators, that way i think it's better organized.

I still need some help with the code, to check if this is the best way to do this, and to fine tune some other things, but for now i post the code for what i've done:

GetOperators() as $operador)
{
	if(!$operador->Status == USER_STATUS_OFFLINE)
	echo "
	
	GetOperatorPictureFile() ."\" width=\"60\" height=\"45\" style=\"border:solid 1px gray;\">
	
	" . utf8_decode($operador->Fullname) . "
". utf8_decode($operador->Description) ."
Estado:
	Disponivel

	Iniciar Chat
	 | Email ."\">Enviar Email";
	else if($operador->Status == USER_STATUS_BUSY)
	echo "
	
	GetOperatorPictureFile() ."\" width=\"60\" height=\"45\" style=\"border:solid 1px gray;\">
	
	" . utf8_decode($operador->Fullname) . "
". utf8_decode($operador->Description) ."
Estado:
	Ocupado

	Iniciar Chat
	 | Email ."\">Enviar Email";
	else if($operador->Status == USER_STATUS_AWAY)
	echo "
	
	GetOperatorPictureFile() ."\" width=\"60\" height=\"45\" style=\"border:solid 1px gray;\">
	
	" . utf8_decode($operador->Fullname) . "
". utf8_decode($operador->Description) ."
Estado:
	Ausente

	Iniciar Chat
	 | Email ."\">Enviar Email";
}

?>

Best regards, Paulo Brinca
http://www.picomatica.info

#2 begreat

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts

Posted 04 November 2010 - 04:00 PM

Is it possible to connect to the livezilla server from a diferent domain?

Let's supose this scenario:

Livezilla server is installed on domain : http://www.domain1.com/livezilla/

And i also want to display the livezilla support buton on domain: http://www.domain2.com/

#3 Derek Punzova

    Support Team Member

  • Moderators
  • 6057 posts

Posted 04 November 2010 - 04:17 PM

Are both domains on the same webserver?
If yes, no problem at all.
If not, you cannot use the API BUT you can use a common live chat button.
- If you like to suggest a new feature, please click here.
Kind Regards,
Derek

#4 begreat

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts

Posted 04 November 2010 - 04:28 PM

Not on the same webserver.

The problem is not the chat button, i would like to display the online operators on all the domains...

Could i create another API to accept connection from the other external domains and then connect my API to Livezilla API ?

Also i'm having a small problem on the Joomla Module i'm creating, i have already created the chat button successfully, but i just can't get the online operators box to be loaded, probably because i used the $urlbase = JURI::base(); to return my domain address, and it returns it with http://, and that way the connection is refused because the require stance prevents external connections, is that right?

If i place the php alone inside the module folder, it works, but as soon as i integrate that code in the module's php file, it stops working

http://www.picomatica.info/modules/mod_ ... matica.php

#5 begreat

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts

Posted 05 November 2010 - 03:38 PM

I'm really stuck on the module problem.

hou can i place this:
GetOperators() as $operador)
{
	if($operador->Status == USER_STATUS_ONLINE)
	echo "
	
	GetOperatorPictureFile() ."\" width=\"60\" height=\"45\" style=\"border:solid 1px gray;\">
	
	" . utf8_decode($operador->Fullname) . "
". utf8_decode($operador->Description) ."
Estado:
	Disponivel

	Iniciar Chat
	 | Email ."\">Enviar Email";
	else if($operador->Status == USER_STATUS_BUSY)
	echo "
	
	GetOperatorPictureFile() ."\" width=\"60\" height=\"45\" style=\"border:solid 1px gray;\">
	
	" . utf8_decode($operador->Fullname) . "
". utf8_decode($operador->Description) ."
Estado:
	Ocupado

	Iniciar Chat
	 | Email ."\">Enviar Email";
	else if($operador->Status == USER_STATUS_AWAY)
	echo "
	
	GetOperatorPictureFile() ."\" width=\"60\" height=\"45\" style=\"border:solid 1px gray;\">
	
	" . utf8_decode($operador->Fullname) . "
". utf8_decode($operador->Description) ."
Estado:
	Ausente

	Iniciar Chat
	 | Email ."\">Enviar Email";
}

?>
inside a joomla's site module that is on the same webserver ?!?

if i create an extrenal php file, place it on http://www.picomatica.info/modules/mod_ ... matica.php and change this:
define("LIVEZILLA_PATH","./../../suporte/");
require(LIVEZILLA_PATH."api.php");
$API = new LiveZillaAPI();
and then call that file on an iframe, it works.
If i place that code inside the joomla module http://www.picomatica.info/modules/mod_ ... uporte.php , it stops working...

#6 Trubadix

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 20 November 2010 - 03:47 AM

Feel free to use and make finetuning on Joomla 1.5.x "mod_livezilla_operators_box"

There you can download, have fun ;)

There you can view a working version

#7 ctcdev

    Member

  • Members
  • PipPip
  • 18 posts

Posted 08 May 2012 - 07:57 AM

 Derek Punzova, on 04 November 2010 - 04:17 PM, said:

Are both domains on the same webserver?
If yes, no problem at all.
If not, you cannot use the API BUT you can use a common live chat button.


In our case, it's different webservers. How to use a common live chat button in place of the API as you mentioned?

We need to make a condition to check whether at least one agent is online (so chat link will be displayed) or if not, display a message stating operation hours.

Thanks.

#8 Patrick Keil

    Administrator

  • Administrators
  • 632 posts
  • LocationSingen, Germany

Posted 08 May 2012 - 08:32 AM

Quote

In our case, it's different webservers. How to use a common live chat button in place of the API as you mentioned?

Unfortunately, Derek was not very clear at this point.

A common chat button / text link is no alternative to the API. It will show an image or text but you cannot realize custom functionality. If you need to check the online status from a remote server, you will need to write your own Javascript / AJAX / JQuery module that accesses the LiveZilla API on the remote webserver and displayes the opening hours on your website according to the API response.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users