Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r4349 r3405  
    1919        return strtr($string, $trans_tbl);
    2020    }
    21 
     21   
    2222    function greet() {
    23         echo '<div class="narrow">';
    2423        echo '<p>'.__('Howdy! This importer allows you to extract posts from LiveJournal XML export file into your blog.  Pick a LiveJournal file to upload and click Import.').'</p>';
    2524        wp_import_upload_form("admin.php?import=livejournal&amp;step=1");
    26         echo '</div>';
    2725    }
    2826
    2927    function import_posts() {
    3028        global $wpdb, $current_user;
    31 
     29       
    3230        set_magic_quotes_runtime(0);
    3331        $importdata = file($this->file); // Read the file into an array
     
    3836        $posts = $posts[1];
    3937        unset($importdata);
    40         echo '<ol>';
     38        echo '<ol>';       
    4139        foreach ($posts as $post) {
     40            flush();
    4241            preg_match('|<subject>(.*?)</subject>|is', $post, $post_title);
    4342            $post_title = $wpdb->escape(trim($post_title[1]));
     
    8079            preg_match_all('|<comment>(.*?)</comment>|is', $post, $comments);
    8180            $comments = $comments[1];
    82 
     81           
    8382            if ( $comments ) {
    8483                $comment_post_ID = $post_id;
     
    120119            }
    121120            echo '</li>';
     121            flush();
     122            ob_flush();
    122123        }
    123124        echo '</ol>';
     
    134135        $this->import_posts();
    135136        wp_import_cleanup($file['id']);
    136 
     137       
    137138        echo '<h3>';
    138139        printf(__('All done. <a href="%s">Have fun!</a>'), get_option('home'));
     
    147148
    148149        $this->header();
    149 
     150       
    150151        switch ($step) {
    151152            case 0 :
     
    156157                break;
    157158        }
    158 
     159       
    159160        $this->footer();
    160161    }
    161162
    162163    function LJ_Import() {
    163         // Nothing.
     164        // Nothing. 
    164165    }
    165166}
     
    167168$livejournal_import = new LJ_Import();
    168169
    169 register_importer('livejournal', __('LiveJournal'), __('Import posts from LiveJournal'), array ($livejournal_import, 'dispatch'));
     170register_importer('livejournal', 'LiveJournal', __('Import posts from LiveJournal'), array ($livejournal_import, 'dispatch'));
    170171?>
Note: See TracChangeset for help on using the changeset viewer.