Changeset 5406 for branches/2.0/wp-admin/import/greymatter.php
- Timestamp:
- 05/07/2007 04:10:20 PM (19 years ago)
- File:
-
- 1 edited
-
branches/2.0/wp-admin/import/greymatter.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/wp-admin/import/greymatter.php
r4239 r5406 7 7 function header() { 8 8 echo '<div class="wrap">'; 9 echo '<h2>'.__('Import Grey matter').'</h2>';9 echo '<h2>'.__('Import GreyMatter').'</h2>'; 10 10 } 11 11 … … 35 35 <input type="hidden" name="import" value="greymatter" /> 36 36 <input type="hidden" name="step" value="1" /> 37 <?php wp_nonce_field('import-greymatter'); ?> 37 38 <h3><?php _e('Second step: GreyMatter details:') ?></h3> 38 39 <p><table cellpadding="0"> … … 67 68 return($string); 68 69 } 69 70 70 71 function import() { 71 72 global $wpdb; 72 73 73 74 $wpvarstoreset = array('gmpath', 'archivespath', 'lastentry'); 74 75 for ($i=0; $i<count($wpvarstoreset); $i += 1) { … … 88 89 89 90 if (!chdir($archivespath)) 90 die(sprintf(__("Wrong path, %s\ndoesn't exist\non the server"), $archivespath));91 wp_die(__("Wrong path, the path to the GM entries does not exist on the server")); 91 92 92 93 if (!chdir($gmpath)) 93 die(sprintf(__("Wrong path, %s\ndoesn't exist\non the server"), $gmpath)); 94 94 wp_die(__("Wrong path, the path to the GM files does not exist on the server")); 95 96 $lastentry = (int) $lastentry; 97 95 98 $this->header(); 96 99 ?> … … 129 132 $user_id = wp_insert_user($user_info); 130 133 $this->gmnames[$userdata[0]] = $user_id; 131 134 132 135 printf('<li>'.__('user %s...').' <strong>'.__('Done').'</strong></li>', "<em>$user_login</em>"); 133 136 } … … 137 140 138 141 chdir($archivespath); 139 142 140 143 for($i = 0; $i <= $lastentry; $i = $i + 1) { 141 144 142 145 $entryfile = ""; 143 146 144 147 if ($i<10000000) { 145 148 $entryfile .= "0"; … … 195 198 $comment_status = 'open'; 196 199 $ping_status = 'closed'; 197 200 198 201 if ($post_ID = post_exists($post_title, '', $post_date)) { 199 202 echo ' '; … … 214 217 $user_url=$wpdb->escape(""); 215 218 $user_joindate=$wpdb->escape($user_joindate); 216 219 217 220 $user_info = array("user_login"=>$user_login, "user_pass"=>$pass1, "user_nickname"=>$user_nickname, "user_email"=>$user_email, "user_url"=>$user_url, "user_ip"=>$user_ip, "user_domain"=>$user_domain, "user_browser"=>$user_browser, "dateYMDhour"=>$user_joindate, "user_level"=>0, "user_idmode"=>"nickname"); 218 221 $user_id = wp_insert_user($user_info); 219 222 $this->gmnames[$postinfo[1]] = $user_id; 220 223 221 224 echo ': '; 222 225 printf(__('registered deleted user %s at level 0 '), "<em>$user_login</em>"); 223 226 } 224 227 225 228 if (array_key_exists($postinfo[1], $this->gmnames)) { 226 229 $post_author = $this->gmnames[$postinfo[1]]; … … 228 231 $post_author = $user_id; 229 232 } 230 233 231 234 $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'); 232 235 $post_ID = wp_insert_post($postdata); … … 282 285 </ul><strong><?php _e('Done') ?></strong></li></ul> 283 286 <p> </p> 284 <p><?php _e('Completed Grey matter import!') ?></p>287 <p><?php _e('Completed GreyMatter import!') ?></p> 285 288 <?php 286 289 $this->footer(); … … 298 301 break; 299 302 case 1: 303 check_admin_referer('import-greymatter'); 300 304 $this->import(); 301 305 break; … … 304 308 305 309 function GM_Import() { 306 // Nothing. 310 // Nothing. 307 311 } 308 312 } … … 310 314 $gm_import = new GM_Import(); 311 315 312 register_importer('greymatter', __('Grey matter'), __('Import posts and comments from yourGreymatter blog'), array ($gm_import, 'dispatch'));316 register_importer('greymatter', __('GreyMatter'), __('Import users, posts, and comments from a Greymatter blog'), array ($gm_import, 'dispatch')); 313 317 ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)