Changeset 1484
- Timestamp:
- 07/26/04 15:57:32 (4 years ago)
- Files:
-
- trunk/wp-mail.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-mail.php
r1371 r1484 6 6 error_reporting(2037); 7 7 8 $time_difference = get_settings('gmt_offset') ;8 $time_difference = get_settings('gmt_offset') * 3600; 9 9 10 10 $pop3 = new POP3(); … … 60 60 $subject = wp_iso_descrambler($subject); 61 61 } 62 // Captures any text in the subject before :: as the subject 63 $subject = explode('::', $subject); 64 $subject = $subject[0]; 65 62 66 } 63 67 if (preg_match('/Date: /i', $line)) { // of the form '20 Mar 2002 20:32:37' … … 77 81 $ddate_d = $date_arr[0]; 78 82 $ddate_Y = $date_arr[2]; 79 for ($i=0; $i<12; $i++) { 80 if ($ddate_m == $dmonths[$i]) { 81 $ddate_m = $i+1; 83 84 for ($j=0; $j<12; $j++) { 85 if ($ddate_m == $dmonths[$j]) { 86 $ddate_m = $j+1; 82 87 } 83 88 } 89 90 $time_zn = intval($date_arr[4]) * 36; 91 if ( $time_zn < 0 ) { 92 if (abs($time_difference) > abs($time_zn)) { 93 $time_zn = abs($time_difference) - abs($time_zn); 94 } else { 95 $time_zn = abs($time_zn) - abs($time_difference); 96 } 97 } else { 98 $time_zn = abs($time_zn) + abs($time_difference); 99 } 100 84 101 $ddate_U = mktime($ddate_H, $ddate_i, $ddate_s, $ddate_m, $ddate_d, $ddate_Y); 85 86 $post_date = gmdate('Y-m-d H:i:s', $ddate_U + ($time_difference * 3600));102 $ddate_U = $ddate_U - $time_zn; 103 $post_date = gmdate('Y-m-d H:i:s', $ddate_U + $time_difference); 87 104 $post_date_gmt = gmdate('Y-m-d H:i:s', $ddate_U); 88 105 } 89 106 } 90 107 endforeach; 91 92 $ddate_today = time() + ($time_difference * 3600);93 $ddate_difference_days = ($ddate_today - $ddate_U) / 86400;94 95 108 96 109 $subject = trim(str_replace(get_settings('subjectprefix'), '', $subject)); … … 103 116 } 104 117 $content = trim($content); 118 // Captures any text in the body after :: as the body 119 $content = explode('::', $content); 120 $content = $content[1]; 105 121 106 122 echo "<p><b>Content-type:</b> $content_type, <b>boundary:</b> $boundary</p>\n"; … … 118 134 119 135 $post_title = addslashes(trim($post_title)); 136 // Make sure that we get a nice post-slug 137 $post_name = sanitize_title( $post_title ); 120 138 $content = preg_replace("|\n([^\n])|", " $1", $content); 121 139 $content = addslashes(trim($content)); 122 140 123 141 124 $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')";142 $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')"; 125 143 126 144 $result = $wpdb->query($sql); … … 134 152 echo "\n<b>Posted content:</b><br /><pre>".$content.'</pre></p>'; 135 153 136 if (!$post_categories) $post_categories[] = 1;137 foreach ($post_categories as $post_category) :154 if (!$post_categories) $post_categories[] = 1; 155 foreach ($post_categories as $post_category) : 138 156 $post_category = intval($post_category); 139 157
