X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7688c6ba71852cd89123b62b2d57683535e4702a..refs/tags/wordpress-2.9:/wp-admin/import/blogware.php diff --git a/wp-admin/import/blogware.php b/wp-admin/import/blogware.php index d85fd921..531ceddc 100644 --- a/wp-admin/import/blogware.php +++ b/wp-admin/import/blogware.php @@ -1,13 +1,27 @@ '; + screen_icon(); echo '

'.__('Import Blogware').'

'; } @@ -28,6 +42,10 @@ class BW_Import { echo ''; } + function _normalize_tag( $matches ) { + return '<' . strtolower( $matches[1] ); + } + function import_posts() { global $wpdb, $current_user; @@ -75,7 +93,7 @@ class BW_Import { } // Clean up content - $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content); + $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content); $post_content = str_replace('
', '
', $post_content); $post_content = str_replace('
', '
', $post_content); $post_content = $wpdb->escape($post_content); @@ -86,16 +104,16 @@ class BW_Import { echo '
  • '; if ($post_id = post_exists($post_title, $post_content, $post_date)) { - printf(__('Post %s already exists.'), stripslashes($post_title)); + printf(__('Post %s already exists.'), stripslashes($post_title)); } else { - printf(__('Importing post %s...'), stripslashes($post_title)); + printf(__('Importing post %s...'), stripslashes($post_title)); $postdata = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status'); $post_id = wp_insert_post($postdata); if ( is_wp_error( $post_id ) ) { return $post_id; } if (!$post_id) { - _e("Couldn't get post ID"); + _e('Couldn’t get post ID'); echo '
  • '; break; } @@ -115,7 +133,7 @@ class BW_Import { $comment_content = $this->unhtmlentities($comment_content); // Clean up content - $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content); + $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content); $comment_content = str_replace('
    ', '
    ', $comment_content); $comment_content = str_replace('
    ', '
    ', $comment_content); $comment_content = $wpdb->escape($comment_content); @@ -141,7 +159,7 @@ class BW_Import { } if ( $num_comments ) { echo ' '; - printf(__('(%s comments)'), $num_comments); + printf( _n('%s comment', '%s comments', $num_comments), $num_comments ); } echo ''; flush(); @@ -162,7 +180,7 @@ class BW_Import { if ( is_wp_error( $result ) ) return $result; wp_import_cleanup($file['id']); - + do_action('import_done', 'blogware'); echo '

    '; printf(__('All done. Have fun!'), get_option('home')); echo '

    '; @@ -197,5 +215,5 @@ class BW_Import { $blogware_import = new BW_Import(); -register_importer('blogware', __('Blogware'), __('Import posts from Blogware'), array ($blogware_import, 'dispatch')); +register_importer('blogware', __('Blogware'), __('Import posts from Blogware.'), array ($blogware_import, 'dispatch')); ?>