Not sure if this has been done, but I came up with some JavaScript to automatically refresh the Chat Image: so if user is on page with chat icon when chat admin changes chat status, the chat icon is updated accordingly as it displays to user. Pretty cool.
1. Add the following JavaScript code between the <head> and </head> tags:
<script type="text/javascript">
setInterval(function() {
if (document.getElementById('chatimg') != null) {
var myImageElement = document.getElementById('chatimg');
myImageElement.src = '/chat/b.php?i=mgreen&lang=en&?rand=' + Math.random();
}
}, 30000);
</javascript>
2. Add id="chatimg" to the chat image IMG tag.
* Change /chat/b.php in the Javascript to the relative or absolute URL of your chat.php script.
* Refresh time is 30000 ms or 30 seconds. Feel free to change, but I would not recommend setting too low as it will increase load on the web server.