X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/022dfbbbe3215917d84708eb09acca93b21ae9e0..refs/tags/wordpress-2.9:/wp-admin/import/greymatter.php diff --git a/wp-admin/import/greymatter.php b/wp-admin/import/greymatter.php index 4305cd18..47c15d4b 100644 --- a/wp-admin/import/greymatter.php +++ b/wp-admin/import/greymatter.php @@ -1,11 +1,26 @@ '; + screen_icon(); echo '

'.__('Import GreyMatter').'

'; } @@ -31,32 +46,28 @@ class GM_Import {

 

-
+

-

- - - - +
- - + + - + + - - + +

so you need to enter the number of the last GM post here.
(if you don't know that number, just log into your FTP and look it out
in the entries' folder)") ?>

+ so you need to enter the number of the last GM post here.
(if you don’t know that number, just log in to your FTP and look it out
in the entries’ folder)') ?>
-

-

+

-

 

footer(); } @@ -233,6 +244,8 @@ class GM_Import { $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt'); $post_ID = wp_insert_post($postdata); + if ( is_wp_error( $post_ID ) ) + return $post_ID; } $c=count($entry); @@ -270,23 +283,25 @@ class GM_Import { } if ($numAddedComments > 0) { echo ': '; - printf(__('imported %d comment(s)'), $numAddedComments); + printf( _n('imported %s comment', 'imported %s comments', $numAddedComments) , $numAddedComments); } $preExisting = $numComments - numAddedComments; if ($preExisting > 0) { echo ' '; - printf(__('ignored %d pre-existing comments'), $preExisting); + printf( _n( 'ignored %s pre-existing comment', 'ignored %s pre-existing comments', $preExisting ) , $preExisting); } } echo '... '.__('Done').''; } } + do_action('import_done', 'greymatter'); ?>

 

footer(); + return; } function dispatch() { @@ -301,7 +316,9 @@ class GM_Import { break; case 1: check_admin_referer('import-greymatter'); - $this->import(); + $result = $this->import(); + if ( is_wp_error( $result ) ) + echo $result->get_error_message(); break; } } @@ -313,5 +330,5 @@ class GM_Import { $gm_import = new GM_Import(); -register_importer('greymatter', __('GreyMatter'), __('Import users, posts, and comments from a Greymatter blog'), array ($gm_import, 'dispatch')); +register_importer('greymatter', __('GreyMatter'), __('Import users, posts, and comments from a Greymatter blog.'), array ($gm_import, 'dispatch')); ?>