FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Error in maillist.php,v 1.38
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Error in maillist.php,v 1.38 [message #16499] Tue, 03 February 2004 04:18 Go to next message
Squeebee is currently offline  Squeebee   Canada
Messages: 110
Registered: November 2003
Karma: 0
Senior Member
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);
		}
	}
Re: Error in maillist.php,v 1.38 [message #16629 is a reply to message #16499] Tue, 10 February 2004 14:08 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Thanks, fixed in CVS.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ERROR: Unable to identify a prefix operator '!' for type 'integer'
Next Topic: admin rights - error
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 07:39:38 GMT 2024

Total time taken to generate the page: 0.02275 seconds