Compare: (<)Original wp-mail.php (8465 bytes)
   with: (>)Modified by Brint wp-mail.php (9088 bytes)

14a14,16
> * Version 0.2.1
> * - Modified by Brint E. Kriebel (http://bekit.net) for added functionality.
> *


*** Allow unrecognized email addresses to post, making the posts from a default user ID configured here.
33a36,38
> 	//uncomment the following line to allow unregistered email addresses to post under a default id
> 	//$default_posterid = '1';
> 
122c133
< 		if (!$poster = $wpdb->get_var($sql))
---
> 		if ((!$poster = $wpdb->get_var($sql)) && (!$poster = $default_posterid))

*** Changes from nate (http://www.project222.com/nate) to get comment/ping status as well as a call to check deafult pingback.
40a46,50
> 	//default comment/ping status
> 	$comment_status = get_settings('default_comment_status');
> 	$ping_status = get_settings('default_ping_status');
> 	$post_pingback = get_settings('default_pingback_flag');
> 	


*** The original version would miss an email that had the email address in <> but did not have a name. This should allow for both.
86c97
< 		if (preg_match('/^[^<>]+<([^<>]+)>$/',$from,$matches))
---
> 		if (preg_match('/^[^<>]*<([^<>]+)>$/',$from,$matches))


*** The time() function only pulls the current time. strtotime() takes a variable. There is also no need to adjust for time difference - the date() and gmdate() functions handle that.
93,94c104,105
< 		$post_date = date('Y-m-d H:i:s', time($ddate) + ($time_difference * 3600));
< 		$post_date_gmt = gmdate('Y-m-d H:i:s', time($ddate) );
---
> 		$post_date = date('Y-m-d H:i:s', strtotime($ddate));
> 		$post_date_gmt = gmdate('Y-m-d H:i:s', strtotime($ddate) );

*** This creates the post name - or the post slug, used for permalinking.
128a139,141
> 		//create post name from title
> 		$post_name = sanitize_title($subject);
> 

*** Add the extra variables into the array for posting.
135a149,151
> 			'comment_status'	=> $comment_status,
> 			'ping_status'	=> $ping_status,
> 			'post_name'	=> $post_name,

*** Only pingback if that is the default. (REALLY slows down posting on Sprint Picture Shares).
146c163,166
< 		pingback($content, $post_ID);
---
> 
> 		if ($post_pingback) {
> 			pingback($content, $post_ID);
> 		}

