Patch further
This commit is contained in:
@@ -167,8 +167,31 @@ class Serendipity_Import {
|
|||||||
global $serendipity;
|
global $serendipity;
|
||||||
|
|
||||||
mysql_select_db($this->data['name'], $db);
|
mysql_select_db($this->data['name'], $db);
|
||||||
|
$dbn = false;
|
||||||
|
|
||||||
|
$target = $this->data['charset'];
|
||||||
|
|
||||||
|
switch($target) {
|
||||||
|
case 'native':
|
||||||
|
$dbn = SQL_CHARSET;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'ISO-8859-1':
|
||||||
|
$dbn = 'latin1';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'UTF-8':
|
||||||
|
$dbn = 'utf8';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($dbn && $serendipity['dbNames']) {
|
||||||
|
mysql_query("SET NAMES " . $dbn, $db);
|
||||||
|
}
|
||||||
|
|
||||||
$return = &mysql_query($query, $db);
|
$return = &mysql_query($query, $db);
|
||||||
mysql_select_db($serendipity['dbName'], $serendipity['dbConn']); $return = &mysql_query($query, $db);
|
mysql_select_db($serendipity['dbName'], $serendipity['dbConn']);
|
||||||
|
serendipity_db_reconnect();
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
|||||||
ON taxonomy.term_id = terms.term_id
|
ON taxonomy.term_id = terms.term_id
|
||||||
|
|
||||||
WHERE taxonomy.taxonomy = 'category'
|
WHERE taxonomy.taxonomy = 'category'
|
||||||
ORDER BY taxonomy.parent, taxonomy.term_taxonomy", $wpdb);
|
ORDER BY taxonomy.parent, taxonomy.term_taxonomy_id", $wpdb);
|
||||||
if (!$res && !$no_cat) {
|
if (!$res && !$no_cat) {
|
||||||
$no_cat = mysql_error($wpdb);
|
$no_cat = mysql_error($wpdb);
|
||||||
} elseif ($res) {
|
} elseif ($res) {
|
||||||
@@ -332,8 +332,9 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
|||||||
rel.term_taxonomy_id AS category_id
|
rel.term_taxonomy_id AS category_id
|
||||||
FROM {$this->data['prefix']}term_relationships AS rel;", $wpdb);
|
FROM {$this->data['prefix']}term_relationships AS rel;", $wpdb);
|
||||||
if (!$res && !$no_entrycat) {
|
if (!$res && !$no_entrycat) {
|
||||||
printf(COULDNT_SELECT_ENTRY_INFO, mysql_error($wpdb));
|
$no_entrycat = mysql_error($wpdb);
|
||||||
} elseif ($res) {
|
} elseif ($res) {
|
||||||
|
$no_entrycat = false;
|
||||||
if ($debug) echo "Importing category associations (WP 2.3 style)...<br />\n";
|
if ($debug) echo "Importing category associations (WP 2.3 style)...<br />\n";
|
||||||
while ($a = mysql_fetch_assoc($res)) {
|
while ($a = mysql_fetch_assoc($res)) {
|
||||||
$data = array('entryid' => $assoc['entries'][$a['post_id']],
|
$data = array('entryid' => $assoc['entries'][$a['post_id']],
|
||||||
@@ -344,7 +345,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($no_entrycat) {
|
if ($no_entrycat) {
|
||||||
printf(COULDNT_SELECT_ENTRY_INFO, mysql_error($wpdb));
|
printf(COULDNT_SELECT_ENTRY_INFO, $no_entrycat);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Comments */
|
/* Comments */
|
||||||
@@ -366,11 +367,10 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
|
|||||||
'subscribed'=> 'false',
|
'subscribed'=> 'false',
|
||||||
'body' => $a['comment_content'],
|
'body' => $a['comment_content'],
|
||||||
'type' => 'NORMAL');
|
'type' => 'NORMAL');
|
||||||
|
|
||||||
serendipity_db_insert('comments', $this->strtrRecursive($comment));
|
serendipity_db_insert('comments', $this->strtrRecursive($comment));
|
||||||
if ($comment['status'] == 'approved') {
|
if ($comment['status'] == 'approved') {
|
||||||
$cid = serendipity_db_insert_id('comments', 'id');
|
$cid = serendipity_db_insert_id('comments', 'id');
|
||||||
serendipity_approveComment($cid, $comment['entry_id'], true);
|
serendipity_approveComment($cid, $assoc['entries'][$a['comment_post_ID']], true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($debug) echo "Imported comments.<br />\n";
|
if ($debug) echo "Imported comments.<br />\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user