MT import fixes from cubex.
git-svn-id: https://develop.svn.wordpress.org/trunk@3387 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
946cae67f4
commit
7b1816ee53
@ -54,7 +54,7 @@ class MT_Import {
|
|||||||
if (!(in_array($author, $this->mtnames))) { //a new mt author name is found
|
if (!(in_array($author, $this->mtnames))) { //a new mt author name is found
|
||||||
++ $this->j;
|
++ $this->j;
|
||||||
$this->mtnames[$this->j] = $author; //add that new mt author name to an array
|
$this->mtnames[$this->j] = $author; //add that new mt author name to an array
|
||||||
$user_id = username_exists($this->newauthornames[$j]); //check if the new author name defined by the user is a pre-existing wp user
|
$user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user
|
||||||
if (!$user_id) { //banging my head against the desk now.
|
if (!$user_id) { //banging my head against the desk now.
|
||||||
if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname
|
if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname
|
||||||
$user_id = wp_create_user($author, $pass);
|
$user_id = wp_create_user($author, $pass);
|
||||||
@ -243,11 +243,11 @@ class MT_Import {
|
|||||||
$post_convert_breaks = $value;
|
$post_convert_breaks = $value;
|
||||||
break;
|
break;
|
||||||
case 'ALLOW PINGS' :
|
case 'ALLOW PINGS' :
|
||||||
$post_allow_pings = trim($meta[2][0]);
|
$ping_status = trim($meta[2][0]);
|
||||||
if ($post_allow_pings == 1) {
|
if ($ping_status == 1) {
|
||||||
$post_allow_pings = 'open';
|
$ping_status = 'open';
|
||||||
} else {
|
} else {
|
||||||
$post_allow_pings = 'closed';
|
$ping_status = 'closed';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'PRIMARY CATEGORY' :
|
case 'PRIMARY CATEGORY' :
|
||||||
@ -290,6 +290,7 @@ class MT_Import {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$comment_post_ID = $post_id;
|
$comment_post_ID = $post_id;
|
||||||
|
$comment_approved = 1;
|
||||||
|
|
||||||
// Now for comments
|
// Now for comments
|
||||||
$comments = explode("-----\nCOMMENT:", $comments[0]);
|
$comments = explode("-----\nCOMMENT:", $comments[0]);
|
||||||
@ -321,7 +322,7 @@ class MT_Import {
|
|||||||
$comment_content = str_replace('-----', '', $comment_content);
|
$comment_content = str_replace('-----', '', $comment_content);
|
||||||
// Check if it's already there
|
// Check if it's already there
|
||||||
if (!comment_exists($comment_author, $comment_date)) {
|
if (!comment_exists($comment_author, $comment_date)) {
|
||||||
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_content');
|
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_content', 'comment_approved');
|
||||||
$commentdata = wp_filter_comment($commentdata);
|
$commentdata = wp_filter_comment($commentdata);
|
||||||
wp_insert_comment($commentdata);
|
wp_insert_comment($commentdata);
|
||||||
$num_comments++;
|
$num_comments++;
|
||||||
@ -369,7 +370,7 @@ class MT_Import {
|
|||||||
|
|
||||||
// Check if it's already there
|
// Check if it's already there
|
||||||
if (!comment_exists($comment_author, $comment_date)) {
|
if (!comment_exists($comment_author, $comment_date)) {
|
||||||
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_content', 'comment_type');
|
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_content', 'comment_type', 'comment_approved');
|
||||||
$commentdata = wp_filter_comment($commentdata);
|
$commentdata = wp_filter_comment($commentdata);
|
||||||
wp_insert_comment($commentdata);
|
wp_insert_comment($commentdata);
|
||||||
$num_pings++;
|
$num_pings++;
|
||||||
|
Loading…
Reference in New Issue
Block a user