Topic: Registration language in confirmation email
This might be a boundary case of a bug versus feature, but I'll post it here (in bugs) anyway. I have a bi-lingual forum. When registering, the new user can select a language. However, the confirmation email is in the default language set for the board. That wouldn't be a big problem if it weren't for the fact that a foreign-language email is much more likely to end up in the spam filter of the recipient than when in his/her native language, as is evidenced by the large number of hotmail addresses that signed up but never logged in.
Here's the fix (for punbb 1.2.11; it doesn't seem to be addressed in the updates up to 1.2.15).
File: register.php
// Add the user
$db->query('INSERT INTO '.$db->prefix.'users (username, group_id, password, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit) VALUES(\''.$db->escape($username).'\', '.$intial_group_id.', \''.$password_hash.'\', \''.$email1.'\', '.$email_setting.', '.$save_pass.', '.$timezone.' , \''.$db->escape($language).'\', \''.$pun_config['o_default_style'].'\', '.$now.', \''.get_remote_address().'\', '.$now.')') or error('Unable to create user', __FILE__, __LINE__, $db->error());
$new_uid = $db->insert_id();
+
+ // Reset language if different from current default language (affecting email and result page)
+ if ($pun_user['language'] != $language) {
+ global $pun_user, $lang_common, $lang_register;
+ $pun_user['language'] = $language;
+ include PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
+ include PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
+ }
Lines with a '+' are new. (I can't provide line numbers since my version already differs quite a bit from the original).