Version Description
- String updates
Download this release
Release Info
Developer | nacin |
Plugin | Movable Type and TypePad Importer |
Version | 0.4 |
Comparing to | |
See all releases |
Code changes from version 0.3 to 0.4
- languages/movabletype-importer.pot +1 -1
- movabletype-importer.php +32 -31
- readme.txt +15 -4
languages/movabletype-importer.pot
CHANGED
@@ -64,7 +64,7 @@ msgstr ""
|
|
64 |
|
65 |
#: movabletype-importer.php:209
|
66 |
msgid ""
|
67 |
-
"Below, you can see the names of the authors of the
|
68 |
"<em>italics</em>. For each of these names, you can either pick an author in "
|
69 |
"your WordPress installation from the menu, or enter a name for the author in "
|
70 |
"the textbox."
|
64 |
|
65 |
#: movabletype-importer.php:209
|
66 |
msgid ""
|
67 |
+
"Below, you can see the names of the authors of the Movable Type posts in "
|
68 |
"<em>italics</em>. For each of these names, you can either pick an author in "
|
69 |
"your WordPress installation from the menu, or enter a name for the author in "
|
70 |
"the textbox."
|
movabletype-importer.php
CHANGED
@@ -5,9 +5,9 @@ Plugin URI: http://wordpress.org/extend/plugins/movabletype-importer/
|
|
5 |
Description: Import posts and comments from a Movable Type or TypePad blog.
|
6 |
Author: wordpressdotorg
|
7 |
Author URI: http://wordpress.org/
|
8 |
-
Version: 0.
|
9 |
-
Stable tag: 0.
|
10 |
-
License: GPL
|
11 |
*/
|
12 |
|
13 |
if ( !defined('WP_LOAD_IMPORTERS') )
|
@@ -206,7 +206,7 @@ class MT_Import extends WP_Importer {
|
|
206 |
<?php screen_icon(); ?>
|
207 |
<h2><?php _e('Assign Authors', 'movabletype-importer'); ?></h2>
|
208 |
<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 admin’s entries.', 'movabletype-importer'); ?></p>
|
209 |
-
<p><?php _e('Below, you can see the names of the authors of the
|
210 |
<p><?php _e('If a new user is created by WordPress, a password will be randomly generated. Manually change the user’s details if necessary.', 'movabletype-importer'); ?></p>
|
211 |
<?php
|
212 |
|
@@ -372,45 +372,49 @@ class MT_Import extends WP_Importer {
|
|
372 |
$context = 'comment';
|
373 |
} else if ( 'PING:' == $line ) {
|
374 |
$context = 'ping';
|
375 |
-
} else if ( 0 === strpos($line,
|
376 |
-
$author = trim( substr($line, strlen(
|
377 |
if ( '' == $context )
|
378 |
$post->post_author = $author;
|
379 |
else if ( 'comment' == $context )
|
380 |
$comment->comment_author = $author;
|
381 |
-
} else if ( 0 === strpos($line,
|
382 |
-
$title = trim( substr($line, strlen(
|
383 |
if ( '' == $context )
|
384 |
$post->post_title = $title;
|
385 |
else if ( 'ping' == $context )
|
386 |
$ping->title = $title;
|
387 |
-
} else if ( 0 === strpos($line,
|
388 |
-
$
|
|
|
|
|
|
|
|
|
389 |
if ( empty($status) )
|
390 |
$status = 'publish';
|
391 |
$post->post_status = $status;
|
392 |
-
} else if ( 0 === strpos($line,
|
393 |
-
$allow = trim( substr($line, strlen(
|
394 |
if ( $allow == 1 )
|
395 |
$post->comment_status = 'open';
|
396 |
else
|
397 |
$post->comment_status = 'closed';
|
398 |
-
} else if ( 0 === strpos($line,
|
399 |
-
$allow = trim( substr($line, strlen(
|
400 |
if ( $allow == 1 )
|
401 |
$post->ping_status = 'open';
|
402 |
else
|
403 |
$post->ping_status = 'closed';
|
404 |
-
} else if ( 0 === strpos($line,
|
405 |
-
$category = trim( substr($line, strlen(
|
406 |
if ( '' != $category )
|
407 |
$post->categories[] = $category;
|
408 |
-
} else if ( 0 === strpos($line,
|
409 |
-
$category = trim( substr($line, strlen(
|
410 |
if ( '' != $category )
|
411 |
$post->categories[] = $category;
|
412 |
-
} else if ( 0 === strpos($line,
|
413 |
-
$date = trim( substr($line, strlen(
|
414 |
$date = strtotime($date);
|
415 |
$date = date('Y-m-d H:i:s', $date);
|
416 |
$date_gmt = get_gmt_from_date($date);
|
@@ -424,30 +428,27 @@ class MT_Import extends WP_Importer {
|
|
424 |
} else if ( 'ping' == $context ) {
|
425 |
$ping->comment_date = $date;
|
426 |
}
|
427 |
-
} else if ( 0 === strpos($line,
|
428 |
-
$email = trim( substr($line, strlen(
|
429 |
if ( 'comment' == $context )
|
430 |
$comment->comment_author_email = $email;
|
431 |
else
|
432 |
$ping->comment_author_email = '';
|
433 |
-
} else if ( 0 === strpos($line,
|
434 |
-
$ip = trim( substr($line, strlen(
|
435 |
if ( 'comment' == $context )
|
436 |
$comment->comment_author_IP = $ip;
|
437 |
else
|
438 |
$ping->comment_author_IP = $ip;
|
439 |
-
} else if ( 0 === strpos($line,
|
440 |
-
$url = trim( substr($line, strlen(
|
441 |
if ( 'comment' == $context )
|
442 |
$comment->comment_author_url = $url;
|
443 |
else
|
444 |
$ping->comment_author_url = $url;
|
445 |
-
} else if ( 0 === strpos($line,
|
446 |
-
$blog = trim( substr($line, strlen(
|
447 |
$ping->comment_author = $blog;
|
448 |
-
} else if ( 0 === strpos($line, "BASENAME:") ) {
|
449 |
-
$post_name = trim( substr($line, strlen("BASENAME:")) );
|
450 |
-
$post->post_name = $post_name;
|
451 |
} else {
|
452 |
// Processing multi-line field, check context.
|
453 |
|
5 |
Description: Import posts and comments from a Movable Type or TypePad blog.
|
6 |
Author: wordpressdotorg
|
7 |
Author URI: http://wordpress.org/
|
8 |
+
Version: 0.4
|
9 |
+
Stable tag: 0.4
|
10 |
+
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
11 |
*/
|
12 |
|
13 |
if ( !defined('WP_LOAD_IMPORTERS') )
|
206 |
<?php screen_icon(); ?>
|
207 |
<h2><?php _e('Assign Authors', 'movabletype-importer'); ?></h2>
|
208 |
<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 admin’s entries.', 'movabletype-importer'); ?></p>
|
209 |
+
<p><?php _e('Below, you can see the names of the authors of the Movable Type posts in <em>italics</em>. 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.', 'movabletype-importer'); ?></p>
|
210 |
<p><?php _e('If a new user is created by WordPress, a password will be randomly generated. Manually change the user’s details if necessary.', 'movabletype-importer'); ?></p>
|
211 |
<?php
|
212 |
|
372 |
$context = 'comment';
|
373 |
} else if ( 'PING:' == $line ) {
|
374 |
$context = 'ping';
|
375 |
+
} else if ( 0 === strpos($line, 'AUTHOR:') ) {
|
376 |
+
$author = trim( substr($line, strlen('AUTHOR:')) );
|
377 |
if ( '' == $context )
|
378 |
$post->post_author = $author;
|
379 |
else if ( 'comment' == $context )
|
380 |
$comment->comment_author = $author;
|
381 |
+
} else if ( 0 === strpos($line, 'TITLE:') ) {
|
382 |
+
$title = trim( substr($line, strlen('TITLE:')) );
|
383 |
if ( '' == $context )
|
384 |
$post->post_title = $title;
|
385 |
else if ( 'ping' == $context )
|
386 |
$ping->title = $title;
|
387 |
+
} else if ( 0 === strpos($line, 'BASENAME:') ) {
|
388 |
+
$slug = trim( substr($line, strlen('BASENAME:')) );
|
389 |
+
if ( !empty( $slug ) )
|
390 |
+
$post->post_name = $slug;
|
391 |
+
} else if ( 0 === strpos($line, 'STATUS:') ) {
|
392 |
+
$status = trim( strtolower( substr($line, strlen('STATUS:')) ) );
|
393 |
if ( empty($status) )
|
394 |
$status = 'publish';
|
395 |
$post->post_status = $status;
|
396 |
+
} else if ( 0 === strpos($line, 'ALLOW COMMENTS:') ) {
|
397 |
+
$allow = trim( substr($line, strlen('ALLOW COMMENTS:')) );
|
398 |
if ( $allow == 1 )
|
399 |
$post->comment_status = 'open';
|
400 |
else
|
401 |
$post->comment_status = 'closed';
|
402 |
+
} else if ( 0 === strpos($line, 'ALLOW PINGS:') ) {
|
403 |
+
$allow = trim( substr($line, strlen('ALLOW PINGS:')) );
|
404 |
if ( $allow == 1 )
|
405 |
$post->ping_status = 'open';
|
406 |
else
|
407 |
$post->ping_status = 'closed';
|
408 |
+
} else if ( 0 === strpos($line, 'CATEGORY:') ) {
|
409 |
+
$category = trim( substr($line, strlen('CATEGORY:')) );
|
410 |
if ( '' != $category )
|
411 |
$post->categories[] = $category;
|
412 |
+
} else if ( 0 === strpos($line, 'PRIMARY CATEGORY:') ) {
|
413 |
+
$category = trim( substr($line, strlen('PRIMARY CATEGORY:')) );
|
414 |
if ( '' != $category )
|
415 |
$post->categories[] = $category;
|
416 |
+
} else if ( 0 === strpos($line, 'DATE:') ) {
|
417 |
+
$date = trim( substr($line, strlen('DATE:')) );
|
418 |
$date = strtotime($date);
|
419 |
$date = date('Y-m-d H:i:s', $date);
|
420 |
$date_gmt = get_gmt_from_date($date);
|
428 |
} else if ( 'ping' == $context ) {
|
429 |
$ping->comment_date = $date;
|
430 |
}
|
431 |
+
} else if ( 0 === strpos($line, 'EMAIL:') ) {
|
432 |
+
$email = trim( substr($line, strlen('EMAIL:')) );
|
433 |
if ( 'comment' == $context )
|
434 |
$comment->comment_author_email = $email;
|
435 |
else
|
436 |
$ping->comment_author_email = '';
|
437 |
+
} else if ( 0 === strpos($line, 'IP:') ) {
|
438 |
+
$ip = trim( substr($line, strlen('IP:')) );
|
439 |
if ( 'comment' == $context )
|
440 |
$comment->comment_author_IP = $ip;
|
441 |
else
|
442 |
$ping->comment_author_IP = $ip;
|
443 |
+
} else if ( 0 === strpos($line, 'URL:') ) {
|
444 |
+
$url = trim( substr($line, strlen('URL:')) );
|
445 |
if ( 'comment' == $context )
|
446 |
$comment->comment_author_url = $url;
|
447 |
else
|
448 |
$ping->comment_author_url = $url;
|
449 |
+
} else if ( 0 === strpos($line, 'BLOG NAME:') ) {
|
450 |
+
$blog = trim( substr($line, strlen('BLOG NAME:')) );
|
451 |
$ping->comment_author = $blog;
|
|
|
|
|
|
|
452 |
} else {
|
453 |
// Processing multi-line field, check context.
|
454 |
|
readme.txt
CHANGED
@@ -3,8 +3,10 @@ Contributors: wordpressdotorg
|
|
3 |
Donate link:
|
4 |
Tags: importer, movable type, typepad
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to:
|
7 |
-
Stable tag: 0.
|
|
|
|
|
8 |
|
9 |
Import posts and comments from a Movable Type or TypePad blog.
|
10 |
|
@@ -24,13 +26,22 @@ Import posts and comments from a Movable Type or TypePad blog.
|
|
24 |
|
25 |
== Changelog ==
|
26 |
|
27 |
-
= 0.
|
28 |
-
*
|
29 |
|
30 |
= 0.3 =
|
31 |
* Use BASENAME, if present, as the slug for the post.
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
== Upgrade Notice ==
|
34 |
|
|
|
|
|
|
|
35 |
= 0.3 =
|
36 |
Use BASENAME for post slugs.
|
3 |
Donate link:
|
4 |
Tags: importer, movable type, typepad
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 4.1
|
7 |
+
Stable tag: 0.4
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
Import posts and comments from a Movable Type or TypePad blog.
|
12 |
|
26 |
|
27 |
== Changelog ==
|
28 |
|
29 |
+
= 0.4 =
|
30 |
+
* String updates
|
31 |
|
32 |
= 0.3 =
|
33 |
* Use BASENAME, if present, as the slug for the post.
|
34 |
|
35 |
+
= 0.2 =
|
36 |
+
* Add check for WP_LOAD_IMPORTERS
|
37 |
+
|
38 |
+
= 0.1 =
|
39 |
+
* Initial release
|
40 |
+
|
41 |
== Upgrade Notice ==
|
42 |
|
43 |
+
= 0.4 =
|
44 |
+
Import post slugs to make URL transition easier.
|
45 |
+
|
46 |
= 0.3 =
|
47 |
Use BASENAME for post slugs.
|