Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import/mt.php

    r4370 r3387  
    1212    function header() {
    1313        echo '<div class="wrap">';
    14         echo '<h2>'.__('Import Movable Type and TypePad').'</h2>';
     14        echo '<h2>'.__('Import Movable Type').'</h2>';
    1515    }
    1616
     
    2222        $this->header();
    2323?>
    24 <div class="narrow">
    2524<p><?php _e('Howdy! We&#8217;re about to begin the process to import all of your Movable Type entries into WordPress. To begin, select a file to upload and click Import.'); ?></p>
    2625<?php wp_import_upload_form( add_query_arg('step', 1) ); ?>
    2726    <p><?php _e('The importer is smart enough not to import duplicates, so you can run this multiple times without worry if&#8212;for whatever reason&#8212;it doesn\'t finish. If you get an <strong>out of memory</strong> error try splitting up the import file into pieces.'); ?> </p>
    28 </div>
    2927<?php
    3028        $this->footer();
     
    3533        $users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY ID");
    3634?><select name="userselect[<?php echo $n; ?>]">
    37     <option value="#NONE#"><?php _e('- Select -') ?></option>
     35    <option value="#NONE#">- Select -</option>
    3836    <?php
    3937
     
    137135    function mt_authors_form() {
    138136?>
    139 <div class="wrap">
    140 <h2><?php _e('Assign Authors'); ?></h2>
    141137<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.'); ?></p>
    142138<p><?php _e('Below, you can see the names of the authors of the MovableType posts in <i>italics</i>. For each of these names, you can either pick an author in your WordPress installation from the menu, or enter a name for the author in the textbox.'); ?></p>
     
    151147        foreach ($authors as $author) {
    152148            ++ $j;
    153             echo '<li>'.__('Current author:').' <strong>'.$author.'</strong><br />'.sprintf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30"> <br />');
     149            echo '<li><i>'.$author.'</i><br />'.'<input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30">';
    154150            $this->users_form($j);
    155151            echo '</li>';
    156152        }
    157153
    158         echo '<input type="submit" value="'.__('Submit').'">'.'<br/>';
     154        echo '<input type="submit" value="Submit">'.'<br/>';
    159155        echo '</form>';
    160         echo '</ol></div>';
    161 
     156        echo '</ol>';
     157
     158        flush();
    162159    }
    163160
     
    165162        $file = wp_import_handle_upload();
    166163        if ( isset($file['error']) ) {
    167             $this->header();
    168             echo '<p>'.__('Sorry, there has been an error').'.</p>';
    169             echo '<p><strong>' . $file['error'] . '</strong></p>';
    170             $this->footer();
     164            echo $file['error'];
    171165            return;
    172166        }
     
    181175        global $wpdb;
    182176        $i = -1;
    183         echo "<div class='wrap'><ol>";
     177        echo "<ol>";
    184178        foreach ($this->posts as $post) {
    185179            if ('' != trim($post)) {
     
    200194                // We want the excerpt
    201195                preg_match("|-----\nEXCERPT:(.*)|s", $post, $excerpt);
    202                 $post_excerpt = $wpdb->escape(trim($excerpt[1]));
     196                $excerpt = $wpdb->escape(trim($excerpt[1]));
    203197                $post = preg_replace("|(-----\nEXCERPT:.*)|s", '', $post);
    204198
     
    337331                }
    338332                if ( $num_comments )
    339                     printf(' '.__('(%s comments)'), $num_comments);
     333                    printf(__('(%s comments)'), $num_comments);
    340334
    341335                // Finally the pings
     
    385379                }
    386380                if ( $num_pings )
    387                     printf(' '.__('(%s pings)'), $num_pings);
    388 
     381                    printf(__('(%s pings)'), $num_pings);
     382               
    389383                echo "</li>";
    390384            }
     385            flush();
    391386        }
    392387
     
    395390        wp_import_cleanup($this->id);
    396391
    397         echo '<h3>'.sprintf(__('All done. <a href="%s">Have fun!</a>'), get_option('home')).'</h3></div>';
     392        echo '<h3>'.sprintf(__('All done. <a href="%s">Have fun!</a>'), get_option('home')).'</h3>';
    398393    }
    399394
    400395    function import() {
    401396        $this->id = (int) $_GET['id'];
    402        
    403397        $this->file = get_attached_file($this->id);
    404398        $this->get_authors_from_post();
     
    427421
    428422    function MT_Import() {
    429         // Nothing.
     423        // Nothing. 
    430424    }
    431425}
     
    433427$mt_import = new MT_Import();
    434428
    435 register_importer('mt', __('Movable Type and TypePad'), __('Imports <strong>posts and comments</strong> from your Movable Type or TypePad blog'), array ($mt_import, 'dispatch'));
     429register_importer('mt', 'Movable Type', __('Import posts and comments from your Movable Type blog'), array ($mt_import, 'dispatch'));
    436430?>
Note: See TracChangeset for help on using the changeset viewer.