Changes in trunk/wp-admin/import/livejournal.php [4349:3405]
- File:
-
- 1 edited
-
trunk/wp-admin/import/livejournal.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import/livejournal.php
r4349 r3405 19 19 return strtr($string, $trans_tbl); 20 20 } 21 21 22 22 function greet() { 23 echo '<div class="narrow">';24 23 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>'; 25 24 wp_import_upload_form("admin.php?import=livejournal&step=1"); 26 echo '</div>';27 25 } 28 26 29 27 function import_posts() { 30 28 global $wpdb, $current_user; 31 29 32 30 set_magic_quotes_runtime(0); 33 31 $importdata = file($this->file); // Read the file into an array … … 38 36 $posts = $posts[1]; 39 37 unset($importdata); 40 echo '<ol>'; 38 echo '<ol>'; 41 39 foreach ($posts as $post) { 40 flush(); 42 41 preg_match('|<subject>(.*?)</subject>|is', $post, $post_title); 43 42 $post_title = $wpdb->escape(trim($post_title[1])); … … 80 79 preg_match_all('|<comment>(.*?)</comment>|is', $post, $comments); 81 80 $comments = $comments[1]; 82 81 83 82 if ( $comments ) { 84 83 $comment_post_ID = $post_id; … … 120 119 } 121 120 echo '</li>'; 121 flush(); 122 ob_flush(); 122 123 } 123 124 echo '</ol>'; … … 134 135 $this->import_posts(); 135 136 wp_import_cleanup($file['id']); 136 137 137 138 echo '<h3>'; 138 139 printf(__('All done. <a href="%s">Have fun!</a>'), get_option('home')); … … 147 148 148 149 $this->header(); 149 150 150 151 switch ($step) { 151 152 case 0 : … … 156 157 break; 157 158 } 158 159 159 160 $this->footer(); 160 161 } 161 162 162 163 function LJ_Import() { 163 // Nothing. 164 // Nothing. 164 165 } 165 166 } … … 167 168 $livejournal_import = new LJ_Import(); 168 169 169 register_importer('livejournal', __('LiveJournal'), __('Import posts from LiveJournal'), array ($livejournal_import, 'dispatch'));170 register_importer('livejournal', 'LiveJournal', __('Import posts from LiveJournal'), array ($livejournal_import, 'dispatch')); 170 171 ?>
Note: See TracChangeset
for help on using the changeset viewer.