{"id":624,"date":"2016-10-13T07:28:06","date_gmt":"2016-10-13T07:28:06","guid":{"rendered":"http:\/\/hoyasupport.co.za\/main\/?page_id=624"},"modified":"2016-10-13T09:37:21","modified_gmt":"2016-10-13T09:37:21","slug":"test-chat","status":"publish","type":"page","link":"https:\/\/hoyasupport.co.za\/main\/index.php\/test-chat\/","title":{"rendered":"Test Chat"},"content":{"rendered":"[insert_php]\n$livezillaURL = &#8220;http:\/\/www.hoyasupport.co.za\/chat\/&#8221;;<br \/>\n$apiURL = $livezillaURL . &#8220;api\/v2\/api.php&#8221;;<\/p>\n<p>\/\/ authentication parameters<br \/>\n$postd[&#8220;p_user&#8221;]='{administrator}&#8217;;<br \/>\n$postd[&#8220;p_pass&#8221;]='{Am!kaJacobs1}&#8217;;<\/p>\n<p>\/\/ function parameter<br \/>\n$postd[&#8220;p_operators_list&#8221;]=1;<br \/>\n$postd[&#8220;p_json_pretty&#8221;]=1;<\/p>\n<p>$ch = curl_init();<br \/>\ncurl_setopt($ch, CURLOPT_URL,$apiURL);<br \/>\ncurl_setopt($ch, CURLOPT_POST, 1);<br \/>\ncurl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($postd));<br \/>\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br \/>\n$server_output = curl_exec($ch);<\/p>\n<p>if($server_output === false)<br \/>\n\texit(curl_error($ch));<\/p>\n<p>echo $server_output;<br \/>\necho &#8220;<\/p>\n<hr>\n<p>&#8220;;<br \/>\ncurl_close($ch);<\/p>\n<p>$response = json_decode($server_output);<\/p>\n<p>if(count($response)==0)<br \/>\n\texit(&#8220;No operators found&#8221;);<\/p>\n<p>foreach($response->Operators as $obj)<br \/>\n{<br \/>\n\tif($obj->Operator->Status < 2 &#038;&#038; !$obj->Operator->IsBot)<br \/>\n\t{<br \/>\n\t\techo &#8220;<img src=\\\"\" . $livezillaURL . $obj->Operator->PictureFile . &#8220;\\&#8221;> &#8220;;<br \/>\n\t\techo $obj->Operator->Fullname . &#8221; is online &#8220;;<br \/>\n\t\techo &#8220;<a href=\\\"\" . $livezillaURL . $obj->Operator->ChatFile . &#8220;\\&#8221; >Chat<\/a><br \/>&#8220;;<br \/>\n\t}<br \/>\n}<\/p>\n[\/insert_php]\n","protected":false},"excerpt":{"rendered":"<p>[insert_php] $livezillaURL = &#8220;http:\/\/www.hoyasupport.co.za\/chat\/&#8221;; $apiURL = $livezillaURL . &#8220;api\/v2\/api.php&#8221;; \/\/ authentication parameters $postd[&#8220;p_user&#8221;]='{administrator}&#8217;; $postd[&#8220;p_pass&#8221;]='{Am!kaJacobs1}&#8217;; \/\/ function parameter $postd[&#8220;p_operators_list&#8221;]=1; $postd[&#8220;p_json_pretty&#8221;]=1; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$apiURL); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($postd)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<a class=\"moretag\" href=\"https:\/\/hoyasupport.co.za\/main\/index.php\/test-chat\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-624","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/hoyasupport.co.za\/main\/index.php\/wp-json\/wp\/v2\/pages\/624","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hoyasupport.co.za\/main\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/hoyasupport.co.za\/main\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/hoyasupport.co.za\/main\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hoyasupport.co.za\/main\/index.php\/wp-json\/wp\/v2\/comments?post=624"}],"version-history":[{"count":0,"href":"https:\/\/hoyasupport.co.za\/main\/index.php\/wp-json\/wp\/v2\/pages\/624\/revisions"}],"wp:attachment":[{"href":"https:\/\/hoyasupport.co.za\/main\/index.php\/wp-json\/wp\/v2\/media?parent=624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}