From 6059f90ec6174f9390185b64f03bcd1f955a1b93 Mon Sep 17 00:00:00 2001 From: zero Date: Thu, 21 Jun 2007 09:45:41 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@1729 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/ttimporter/tpl/js/importer_admin.js | 2 -- .../ttimporter.admin.controller.php | 29 ++++++++++++++++--- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/modules/ttimporter/tpl/js/importer_admin.js b/modules/ttimporter/tpl/js/importer_admin.js index cbdd64b9c..cef481fb6 100644 --- a/modules/ttimporter/tpl/js/importer_admin.js +++ b/modules/ttimporter/tpl/js/importer_admin.js @@ -9,8 +9,6 @@ function completeImport(ret_obj) { var message = ret_obj['message']; var is_finished = ret_obj['is_finished']; var position = ret_obj['position']; - alert(message); - alert(position); xGetElementById("import_status").style.display = "block"; diff --git a/modules/ttimporter/ttimporter.admin.controller.php b/modules/ttimporter/ttimporter.admin.controller.php index 352be94ff..f5040ce9b 100644 --- a/modules/ttimporter/ttimporter.admin.controller.php +++ b/modules/ttimporter/ttimporter.admin.controller.php @@ -20,7 +20,6 @@ var $url = ''; var $module_srl = 0; - var $category_srl = 0; var $category_list = array(); /** @@ -165,8 +164,10 @@ $args->homepage = $logged_info->homepage; $tag_list = array(); - for($i=0;$ipost->tag);$i++) { - $tag_list[] = $xml_doc->post->tag[$i]->body; + $tags = $xml_doc->post->tag; + if($tags && !is_array($tags)) $tags = array($tags); + for($i=0;$ibody; } $args->tags = implode(',',$tag_list); $args->regdate = date("YmdHis", $xml_doc->post->created->body); @@ -198,6 +199,26 @@ $comment_args->regdate = date("YmdHis",$val->written->body); $comment_args->ipaddress = $val->commenter->ip->body; $this->oCommentController->insertComment($comment_args, true); + + if($val->comment) { + $val = $val->comment; + unset($child_comment_args); + $child_comment_args->document_srl = $args->document_srl; + $child_comment_args->comment_srl = getNextSequence(); + $child_comment_args->module_srl = $this->module_srl; + $child_comment_args->parent_srl = $comment_args->comment_srl; + $child_comment_args->content = $val->content->body; + $child_comment_args->password = ''; + $child_comment_args->nick_name = $val->commenter->name->body; + $child_comment_args->user_id = ''; + $child_comment_args->user_name = ''; + $child_comment_args->member_srl = 0; + $child_comment_args->email_address = ''; + $child_comment_args->regdate = date("YmdHis",$val->written->body); + $child_comment_args->ipaddress = $val->commenter->ip->body; + $this->oCommentController->insertComment($child_comment_args, true); + } + } } @@ -230,7 +251,7 @@ **/ function _parseCategoryInfo($matches) { $xml_doc = $this->oXml->parse($matches[0]); - if(!$xml_doc->category->priority) return; + if(!$xml_doc->category->priority) return $matches[0]; $title = trim($xml_doc->category->name->body); if(!$title || $this->category_list[$title]) return;