Index: wordpress/wp-mail.php =================================================================== RCS file: /cvsroot/cafelog/wordpress/wp-mail.php,v retrieving revision 1.21 diff -U3 -r1.21 wp-mail.php --- wordpress/wp-mail.php 8 Sep 2004 08:57:52 -0000 1.21 +++ wordpress/wp-mail.php 24 Nov 2004 11:13:22 -0000 @@ -17,7 +17,11 @@ endif; $count = $pop3->login(get_settings('mailserver_login'), get_settings('mailserver_pass')); -if (0 == $count) die(__('There doesn’t seem to be any new mail.')); +if (0 == $count) +{ + $pop3->quit(); + die(__('There does not seem to be any new mail.')); +} for ($i=1; $i <= $count; $i++) : @@ -140,9 +144,11 @@ $post_category = $post_categories; - $post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category'); + $post_status = 'publish'; - wp_insert_post($post_data); + $post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category', 'post_status'); + + $post_ID = wp_insert_post($post_data); do_action('publish_phone', $post_ID); @@ -150,23 +156,6 @@ echo "\n

Posted title: $post_title
"; echo "\nPosted content:

".$content.'

'; - if (!$post_categories) $post_categories[] = 1; - foreach ($post_categories as $post_category) : - $post_category = intval($post_category); - - // Double check it's not there already - $exists = $wpdb->get_row("SELECT * FROM $wpdb->post2cat WHERE post_id = $post_ID AND category_id = $post_category"); - - if (!$exists && $result) { - $wpdb->query(" - INSERT INTO $wpdb->post2cat - (post_id, category_id) - VALUES - ($post_ID, $post_category) - "); - } -endforeach; - endfor; $pop3->quit();