Just wanted to update this for the current version of Mibew (1.6.9)
The provided code does still work perfectly, BUT the line numbers are different, and I also added my own touch.
In the root Mibew folder, open client.php.
The following code now gets added right after line 86. (after the userchangename function.)
$errors = NULL;
if( !$email ) {
$errors[] = no_field("form.field.email");
} else if( !$newname ) {
$errors[] = no_field("form.field.name");
} else if( !$firstmessage ) {
$errors[] = no_field("form.field.message");
} else {
if( !is_valid_email($email)) {
$errors[] = wrong_field("form.field.email");
}
}
After adding that, this second block of code goes right after line 141. (after the check multiple IP function.)
if( count($errors) > 0 ){
$page = array();
setup_logo();
setup_survey($visitor['name'], $email, $groupid, $info, $referrer);
expand("styles", getchatstyle(), "survey.tpl");
exit;
}
Not so different so far, BUT what the original author didn't consider is that the form auto-fills, at least in my case, the word 'Guest' as a placeholder. The problem there is that 'Guest' passes the validation! D'oh! But no worries, there is a super simple solution. Bby the way, this applies specifically to the English localization, but probably also applies to other languages as well.
Open mibew/locales/en/properties (note the lack of an extension, make sure your editor doesn't add an extension when saving!)
On line 44, find:
chat.default.username=Guest
and change it to:
chat.default.username=
This keeps it from auto-filling the word 'guest', and forces the user to enter SOMETHING.
Otherwise the original poster had it all perfect for his version of Mibew, and I am just adapting it to my needs. I was getting driven crazy by people entering guest and talking to us as if we knew who they were, such as: "Did my order ship?" and we would have to always ask them to identify themselves.