Couple of things with the new anonymous poster ID code:
if (!$emsg->from_email || !$emsg->from_name) {
$msg_post->poster_id = 0;
} else {
$msg_post->poster_id = match_user_to_post($emsg->from_email, $emsg->from_name, $mlist->mlist_opt & 64, $emsg->user_id);
}
/* for anonymous users prefix 'contact' link */
if (!$msg_post->poster_id) {
if ($frm->forum_opt & 16) {
$msg_post->body = "[b]Originally posted by:[/b] [email={(!empty($this->from_name) ? $this->from_name : '')}]{$this->from_email}[/email]\n\n".$msg_post->body;
} else {
$msg_post->body = "Originally posted by: ".str_replace('@', '@', $this->from_email)."\n\n".$msg_post->body;
}
}
$msg_post->body = apply_custom_replace($emsg->body);
if (!($mlist->mlist_opt & 16)) {
if ($frm->forum_opt & 16) {
$msg_post->body = tags_to_html($msg_post->body, 0);
} else {
$msg_post->body = nl2br($msg_post->body);
}
}
1) This code occurs in the procedural code at the bottom of the file, after the object declarations. This the use of $this causes an error and needs to be changed to $emsg
2) [email={(!empty($this->from_name) ? $this->from_name : '')}]{$this->from_email}[/email]
Code has potentially redundant {} characters (I removed them and it still works), code is arranged so user sees email address, click address and it tries to send email to poster's name.
3) Call to apply_custom_replace blows away poster information. Poster information needs to come after this.
Changes I made to get this working:
if (!$emsg->from_email || !$emsg->from_name) {
$msg_post->poster_id = 0;
} else {
$msg_post->poster_id = match_user_to_post($emsg->from_email, $emsg->from_name, $mlist->mlist_opt & 64, $emsg->user_id);
}
$msg_post->body = apply_custom_replace($emsg->body);
/* for anonymous users prefix 'contact' link */
if (!$msg_post->poster_id) {
if ($frm->forum_opt & 16) {
$msg_post->body = "[b]Originally posted by:[/b] [email=$emsg->from_email](!empty($emsg->from_name) ? $emsg->from_name : '')[/email]\n\n".$msg_post->body;
} else {
$msg_post->body = "Originally posted by: ".str_replace('@', '@', $emsg->from_email)."\n\n".$msg_post->body;
}
}
if (!($mlist->mlist_opt & 16)) {
if ($frm->forum_opt & 16) {
$msg_post->body = tags_to_html($msg_post->body, 0);
} else {
$msg_post->body = nl2br($msg_post->body);
}
}