Thanks Matteo.
The instructions where to put it in a html file after the heading, but as I don't want to mess with moodle files, I have created a HTML block in the home page (?redirect=0) and made that HTML block to be seen though the whole site.
The whole code in that block is:
<script type="text/javascript">// <![CDATA[
window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
_.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8');
$.src='//cdn.zopim.com/?18U7FwTSpLh07khZcWYifxyRtW9MuelG';z.t=+new Date;$.
type='text/javascript';e.parentNode.insertBefore($,e)})(document,'script');
// ]]></script>
<script type="text/javascript">// <![CDATA[
<?php
global $USER;
?>
$zopim(function() {
$zopim.livechat.setName('<?php p(fullname($USER)); ?>');
$zopim.livechat.setEmail('<?php p($USER->email); ?>');
});
// ]]></script>
<script type="text/javascript">// <![CDATA[
$zopim(function() {
$zopim.livechat.setOnStatus(change_chat_img);
});
function change_chat_img(status) {
var img = document.getElementById('chat_img');
if (status=='online')
img.src = https:/ /dl.dropbox.com/u/1704220/icons/Online-chat-icon.png;
else if (status=='away')
img.src = https:/ /dl.dropbox.com/u/1704220/icons/Online-chat-icon.png;
else if (stats=='offline')
img.src = https:/ /dl.dropbox.com/u/1704220/icons/Offline-chat-icon.png;
}
// ]]></script>
<p><a href="javascript:$zopim.livechat.window.show()"><img.src></a></p>
1) First block is to enable the chat tab at the bottom right side of the screen.
2) Second block should pick up the logged in user from Moodle.
3) Third block should put a variable image (online/offline) in the block so it doesn't look empty.
So far only (1) is working. (2) and (3) are not
I'm not a developer so I don't undertand the code. I appreciate any input you can give me.
(note that I have added extra space in the url for the image, just for this msg, so it doesn't show the image but the code.