From: garvinhicking Date: Thu, 16 Mar 2006 16:15:50 +0000 (+0000) Subject: accept multiple categories X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=98226288751af6bd923441b4233bcb2e5d518e7d;p=s9y.git accept multiple categories --- diff --git a/include/admin/importers/movabletype.inc.php b/include/admin/importers/movabletype.inc.php index b33c918..7acfc4d 100644 --- a/include/admin/importers/movabletype.inc.php +++ b/include/admin/importers/movabletype.inc.php @@ -101,7 +101,7 @@ class Serendipity_Import_MovableType extends Serendipity_Import { // Post mediam, add 12 hours. $match[4] = $match[4] + 12; } - + $ts = mktime($match[4], $match[5], $match[6], $match[1], $match[2], $match[3]); $this->debug('Matched string date format: ' . $ts); } @@ -110,7 +110,7 @@ class Serendipity_Import_MovableType extends Serendipity_Import { if ($ts <= 1) { $ts = time(); } - + return $ts; } @@ -176,24 +176,28 @@ class Serendipity_Import_MovableType extends Serendipity_Import { case 'PRIMARY CATEGORY': case 'CATEGORY': - $cat_found = false; - if ( is_array($this->categories) ) { - for ( $y=0 ; $ycategories) ; $y++ ) { - if ( $this->categories[$y]['category_name'] == $data ) { - $cat_found = true; - break; - } - } - if ( $cat_found){ - if (!in_array($this->categories[$y]['categoryid'], $entry['categories']) ) { - //$entries[$n]['categories'][] = $categories[$y]['categoryid']; - $entry['categories'][] = $this->categories[$y]['categoryid']; - } - }else { - $tasks[] = sprintf(CREATE_CATEGORY, htmlspecialchars($data)); - } - } - break; + $categories = explode("\0", $data); + foreach($categories AS $data) { + $data = trim($data); + $cat_found = false; + if (is_array($this->categories)) { + for ( $y=0 ; $ycategories) ; $y++ ) { + if ( $this->categories[$y]['category_name'] == $data ) { + $cat_found = true; + break; + } + } + if ($cat_found) { + if (!in_array($this->categories[$y]['categoryid'], $entry['categories']) ) { + //$entries[$n]['categories'][] = $categories[$y]['categoryid']; + $entry['categories'][] = $this->categories[$y]['categoryid']; + } + } else { + $tasks[] = sprintf(CREATE_CATEGORY, htmlspecialchars($data)); + } + } + } + break; } } $entry['props'] = $entryprops; @@ -399,7 +403,11 @@ class Serendipity_Import_MovableType extends Serendipity_Import { $comment[$c_el] = $content; } else { $this->debug("Appending to entry: $line"); - $entry[$c_el] = $content; + if (isset($entry[$c_el])) { + $entry[$c_el] .= "\0" . $content; + } else { + $entry[$c_el] = $content; + } } } } elseif ($is_comment || $is_trackback) { @@ -419,7 +427,7 @@ class Serendipity_Import_MovableType extends Serendipity_Import { $entry['authorid'] = $serendipity['authorid']; $entry['author'] = $serendipity['realname']; } - + if (!isset($entry['isdraft'])) { $entry['isdraft'] = 'false'; }