Hi!
One of the things I wanted to have, was a sound when a user logs in. We have only a few users, and the idea is that when you're the first user, you can leave the chat open and will hear when someone else drops in.
What you need is a line with a sound file in the html page:
<embed src="bell.wav" autostart="false" width="0" height="0" name="logon" enablejavascript="true">
(bell.wav obviously needs to be on your server in the same path as the chat page)
In parseAndPost look for
var fromtoday = msgs[mid][6];
var oldmsg = msgs[mid][7];
and add
var connectmsg = false;
Also look for
if (cmd == 'cmd_notice' || cmd == 'cmd_me')
and change into
if (cmd == 'cmd_notice' || cmd == 'cmd_me') {
line += '<span class="<?php echo $prefix; ?>words">* '+ this.parseMessage(words) +'</span> ';
if ( oldmsg != 1 && words.indexOf('is connected') != -1) {
connectmsg = 1;
}
}
and finally at the end of parseAndPost add
if (connectmsg == 1) {
document.logon.Play();
}
This is for the 0.9 version and possibly language specific (checking for he "is connected" message). May possibly be done more elegant (for example with a sound switch), but maybe someone can use it.
Markus