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
Base64UrlEncode($operador->UserId)."&mp=true','','width=600,height=600,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes'))\">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
Base64UrlEncode($operador->UserId)."&mp=true','','width=600,height=600,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes'))\">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
Base64UrlEncode($operador->UserId)."&mp=true','','width=600,height=600,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes'))\">Iniciar Chat
| Email ."\">Enviar Email";
}
?>
Best regards, Paulo Brinca
http://www.picomatica.info
#2
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
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.
#4
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
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
Base64UrlEncode($operador->UserId)."&mp=true','','width=600,height=600,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes'))\">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
Base64UrlEncode($operador->UserId)."&mp=true','','width=600,height=600,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes'))\">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
Base64UrlEncode($operador->UserId)."&mp=true','','width=600,height=600,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes'))\">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
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
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
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













