[wp-cvs] wordpress wp-mail.php,1.16,1.17

Ryan Boren rboren at users.sourceforge.net
Mon Jul 26 15:57:35 UTC 2004


Update of /cvsroot/cafelog/wordpress
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2144

Modified Files:
	wp-mail.php 
Log Message:
Queue, SMS, timezone, and permalink fixes for wp-mail from MooKitty.

Index: wp-mail.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-mail.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** wp-mail.php	31 May 2004 15:44:32 -0000	1.16
--- wp-mail.php	26 Jul 2004 15:57:32 -0000	1.17
***************
*** 6,10 ****
  error_reporting(2037);
  
! $time_difference = get_settings('gmt_offset');
  
  $pop3 = new POP3();
--- 6,10 ----
  error_reporting(2037);
  
! $time_difference = get_settings('gmt_offset') * 3600;
  
  $pop3 = new POP3();
***************
*** 60,63 ****
--- 60,67 ----
  				  $subject = wp_iso_descrambler($subject);
  				}
+ 				// Captures any text in the subject before :: as the subject
+ 				$subject = explode('::', $subject);
+ 				$subject = $subject[0];
+ 
  			}
  			if (preg_match('/Date: /i', $line)) { // of the form '20 Mar 2002 20:32:37'
***************
*** 77,88 ****
  				$ddate_d = $date_arr[0];
  				$ddate_Y = $date_arr[2];
! 				for ($i=0; $i<12; $i++) {
! 					if ($ddate_m == $dmonths[$i]) {
! 						$ddate_m = $i+1;
  					}
  				}
- 				$ddate_U = mktime($ddate_H, $ddate_i, $ddate_s, $ddate_m, $ddate_d, $ddate_Y);
  
! 				$post_date = gmdate('Y-m-d H:i:s', $ddate_U + ($time_difference * 3600));
  				$post_date_gmt = gmdate('Y-m-d H:i:s', $ddate_U);
  			}
--- 81,105 ----
  				$ddate_d = $date_arr[0];
  				$ddate_Y = $date_arr[2];
! 
! 				for ($j=0; $j<12; $j++) {
! 					if ($ddate_m == $dmonths[$j]) {
! 						$ddate_m = $j+1;
  					}
  				}
  
! 				$time_zn = intval($date_arr[4]) * 36;
! 				if ( $time_zn < 0 ) {
! 					if (abs($time_difference) > abs($time_zn)) {
! 						$time_zn = abs($time_difference) - abs($time_zn);
! 					} else {
! 						$time_zn = abs($time_zn) - abs($time_difference);
! 					}
! 				} else {
! 					$time_zn = abs($time_zn) + abs($time_difference);
! 				}
! 
! 				$ddate_U = mktime($ddate_H, $ddate_i, $ddate_s, $ddate_m, $ddate_d, $ddate_Y);
! 				$ddate_U = $ddate_U - $time_zn;
! 				$post_date = gmdate('Y-m-d H:i:s', $ddate_U + $time_difference);
  				$post_date_gmt = gmdate('Y-m-d H:i:s', $ddate_U);
  			}
***************
*** 90,97 ****
  	endforeach;
  
- 	$ddate_today = time() + ($time_difference * 3600);
- 	$ddate_difference_days = ($ddate_today - $ddate_U) / 86400;
- 
- 
  	$subject = trim(str_replace(get_settings('subjectprefix'), '', $subject));
  
--- 107,110 ----
***************
*** 103,106 ****
--- 116,122 ----
  	}
  	$content = trim($content);
+ 	// Captures any text in the body after :: as the body
+ 	$content = explode('::', $content);
+ 	$content = $content[1];
  
  	echo "<p><b>Content-type:</b> $content_type, <b>boundary:</b> $boundary</p>\n";
***************
*** 118,126 ****
  
  	$post_title = addslashes(trim($post_title));
  	$content = preg_replace("|\n([^\n])|", " $1", $content);
  	$content = addslashes(trim($content));
  
  
! 	$sql = "INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_title, post_modified, post_modified_gmt) VALUES (1, '$post_date', '$post_date_gmt', '$content', '$post_title', '$post_date', '$post_date_gmt')";
  
  	$result = $wpdb->query($sql);
--- 134,144 ----
  
  	$post_title = addslashes(trim($post_title));
+ 	// Make sure that we get a nice post-slug
+ 	$post_name = sanitize_title( $post_title );
  	$content = preg_replace("|\n([^\n])|", " $1", $content);
  	$content = addslashes(trim($content));
  
  
! 	$sql = "INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_title, post_name, post_modified, post_modified_gmt) VALUES (1, '$post_date', '$post_date_gmt', '$content', '$post_title', '$post_name', '$post_date', '$post_date_gmt')";
  
  	$result = $wpdb->query($sql);
***************
*** 134,139 ****
  	echo "\n<b>Posted content:</b><br /><pre>".$content.'</pre></p>';
  
! if (!$post_categories) $post_categories[] = 1;
! foreach ($post_categories as $post_category) :
  	$post_category = intval($post_category);
  
--- 152,157 ----
  	echo "\n<b>Posted content:</b><br /><pre>".$content.'</pre></p>';
  
! 	if (!$post_categories) $post_categories[] = 1;
! 	foreach ($post_categories as $post_category) :
  	$post_category = intval($post_category);
  




More information about the cvs mailing list