From ca3c28ccb8e720b5942450c387980d981dcf1ce3 Mon Sep 17 00:00:00 2001 From: zero Date: Fri, 31 Aug 2007 07:04:19 +0000 Subject: [PATCH] =?UTF-8?q?ttimporter=20=C3=AB=C2=AA=C2=A8=C3=AB=C2=93?= =?UTF-8?q?=C2=88=C3=AC=C2=9D=C2=80=20=C3=AB=C2=AF=C2=B8=C3=AC=C2=99=C2=84?= =?UTF-8?q?=C3=AC=C2=84=C2=B1=20=C3=AC=C2=83=C2=81=C3=AD=C2=83=C2=9C=C3=AB?= =?UTF-8?q?=C2=9D=C2=BC=20trunk=C3=AC=C2=97=C2=90=C3=AC=C2=84=C2=9C=20?= =?UTF-8?q?=C3=AC=C2=A0=C2=9C=C3=AC=C2=99=C2=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/trunk@2452 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/ttimporter/conf/info.xml | 31 -- modules/ttimporter/conf/module.xml | 7 - modules/ttimporter/lang/en.lang.php | 21 -- modules/ttimporter/lang/jp.lang.php | 21 -- modules/ttimporter/lang/ko.lang.php | 21 -- modules/ttimporter/lang/zh-CN.lang.php | 21 -- modules/ttimporter/tpl/filter/import_tt.xml | 14 - modules/ttimporter/tpl/index.html | 46 --- modules/ttimporter/tpl/js/importer_admin.js | 29 -- .../ttimporter.admin.controller.php | 264 ------------------ modules/ttimporter/ttimporter.admin.view.php | 32 --- modules/ttimporter/ttimporter.class.php | 36 --- 12 files changed, 543 deletions(-) delete mode 100644 modules/ttimporter/conf/info.xml delete mode 100644 modules/ttimporter/conf/module.xml delete mode 100644 modules/ttimporter/lang/en.lang.php delete mode 100644 modules/ttimporter/lang/jp.lang.php delete mode 100644 modules/ttimporter/lang/ko.lang.php delete mode 100644 modules/ttimporter/lang/zh-CN.lang.php delete mode 100644 modules/ttimporter/tpl/filter/import_tt.xml delete mode 100644 modules/ttimporter/tpl/index.html delete mode 100644 modules/ttimporter/tpl/js/importer_admin.js delete mode 100644 modules/ttimporter/ttimporter.admin.controller.php delete mode 100644 modules/ttimporter/ttimporter.admin.view.php delete mode 100644 modules/ttimporter/ttimporter.class.php diff --git a/modules/ttimporter/conf/info.xml b/modules/ttimporter/conf/info.xml deleted file mode 100644 index 4ce566322..000000000 --- a/modules/ttimporter/conf/info.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - TatterTools 데이터 이전 - TatterTools 数据导入 - TTデータ移転 - Transfer data from TatterTools - - 제로 - zero - Zero - Zero - - 태터툴즈의 백업파일을 제로보드XE에 입력을 하는 모듈입니다. - 첨부파일 포함하지 않은 백업파일이 필요합니다. - 첨부파일은 원주소에서 직접 다운로드를 하게 됩니다. - - - 导入TatterTools的备份文件到Zeroboard XE的模块。 - 需要不包含附件的备份文件。 - 附件将在原地址直接下载。 - - - TatterToolsのバックアップファイルをゼロボードXE用にデータの変換を行うモジュールです。添付ファイルを含まないバックアップファイルが必要です。添付ファイルは、元のアドレスからダウンロードします。 - - - Module for inputting TattertTools' backup file to ZeroboardXE. - Backup file without attachment is required. - Attachments will be downloaded from the original address. - - - diff --git a/modules/ttimporter/conf/module.xml b/modules/ttimporter/conf/module.xml deleted file mode 100644 index a0047cc78..000000000 --- a/modules/ttimporter/conf/module.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/modules/ttimporter/lang/en.lang.php b/modules/ttimporter/lang/en.lang.php deleted file mode 100644 index b31110e03..000000000 --- a/modules/ttimporter/lang/en.lang.php +++ /dev/null @@ -1,21 +0,0 @@ -ttimporter = "Import Tetter Tools data"; - $lang->about_tt_importer = "You can input the Tetter Tools data into the module you want.\n The attached file will be directly downloaded via web, so please be sure to enable the original Tetter Tools blog."; - - $lang->target_module = "Target module"; - $lang->target_file = "Target xml file"; - $lang->target_url = "Blog URL"; - - $lang->cmd_continue = 'Continue'; - - $lang->msg_no_xml_file = 'Could not find the XML file! Please check the URL.'; - $lang->msg_invalid_xml_file = 'Invalid XML file type!'; - $lang->msg_importing = 'No. of importing: %d (if stopped long time, please click the "Continue" button.)'; - $lang->msg_import_finished = 'No. of imported: %d (according to condition, some data may not be imported properly.)'; -?> diff --git a/modules/ttimporter/lang/jp.lang.php b/modules/ttimporter/lang/jp.lang.php deleted file mode 100644 index 96c389050..000000000 --- a/modules/ttimporter/lang/jp.lang.php +++ /dev/null @@ -1,21 +0,0 @@ -ttimporter = "TTデータの移転"; - $lang->about_tt_importer = "TatterTools データを希望するモジュールへデータを変換し、入力を行います。添付ファイルは、元のURLから直接ダウンロードするため、元のTatterTools が作動するようにしておいてください。"; - - $lang->target_module = "対象モジュール"; - $lang->target_file = "対象XMLファイル"; - $lang->target_url = "ブログURL"; - - $lang->cmd_continue = '続ける'; - - $lang->msg_no_xml_file = 'XMLファイルが見つかりません。パスを確認してください。'; - $lang->msg_invalid_xml_file = '正しくないフォーマットのXMLファイルです。'; - $lang->msg_importing = '%d個を変換・入力中です。止まっている場合は「続ける」ボタンをクリックしてください。'; - $lang->msg_import_finished = '%d個のデータを変換し、入力が完了しました。正しく変換入力されていないデータがある場合もあります。'; -?> diff --git a/modules/ttimporter/lang/ko.lang.php b/modules/ttimporter/lang/ko.lang.php deleted file mode 100644 index 92eb2b85b..000000000 --- a/modules/ttimporter/lang/ko.lang.php +++ /dev/null @@ -1,21 +0,0 @@ -ttimporter = "태터툴즈 데이터 이전"; - $lang->about_tt_importer = "태터툴즈 데이터를 원하는 모듈에 입력을 할 수 있습니다.\n첨부파일은 웹으로 직접 다운로드를 받으니 꼭 원래 태터툴즈 블로그를 활성화 시켜 주셔야 합니다."; - - $lang->target_module = "대상 모듈"; - $lang->target_file = "대상 xml파일"; - $lang->target_url = "블로그URL"; - - $lang->cmd_continue = '계속진행'; - - $lang->msg_no_xml_file = 'XML파일을 찾을 수 없습니다. 경로를 다시 확인해주세요'; - $lang->msg_invalid_xml_file = '잘못된 형식의 XML파일입니다'; - $lang->msg_importing = '%d개를 입력중입니다. (계속 멈추어 있으면 "계속진행" 버튼을 클릭해주세요)'; - $lang->msg_import_finished = '%d개의 데이터 입력이 완료되었습니다. 상황에 따라 입력되지 못한 데이터가 있을 수 있습니다.'; -?> diff --git a/modules/ttimporter/lang/zh-CN.lang.php b/modules/ttimporter/lang/zh-CN.lang.php deleted file mode 100644 index a6361511f..000000000 --- a/modules/ttimporter/lang/zh-CN.lang.php +++ /dev/null @@ -1,21 +0,0 @@ -ttimporter = "TatterTools 数据导入"; - $lang->about_tt_importer = "可以把TatterTools 的数据导入到指定的模块当中。\n因附件要在网站直接下载,所以导入前必须先激活原TatterTools 博客。"; - - $lang->target_module = "对象模块"; - $lang->target_file = "对象xml文件"; - $lang->target_url = "博客URL"; - - $lang->cmd_continue = '继续进行'; - - $lang->msg_no_xml_file = '找不到XML文件。请重新确认路径'; - $lang->msg_invalid_xml_file = '错误的XML文件格式。'; - $lang->msg_importing = '正在输入%d个。(长时间停止响应时请按“继续进行”按钮)'; - $lang->msg_import_finished = '已完成%d个数据导入。根据情况可能会有没有被导入的数据。'; -?> diff --git a/modules/ttimporter/tpl/filter/import_tt.xml b/modules/ttimporter/tpl/filter/import_tt.xml deleted file mode 100644 index cf5182a1c..000000000 --- a/modules/ttimporter/tpl/filter/import_tt.xml +++ /dev/null @@ -1,14 +0,0 @@ - -
- - - - - - - - - - - -
diff --git a/modules/ttimporter/tpl/index.html b/modules/ttimporter/tpl/index.html deleted file mode 100644 index bd8b1cc96..000000000 --- a/modules/ttimporter/tpl/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - - -

{$lang->ttimporter} {$lang->cmd_management}

- - -
{nl2br($lang->about_tt_importer)}
- -
- - - - - - - - - - - - - - - - - -
{$lang->target_module} - -
{$lang->target_file}
{$lang->target_url}
- -
- -
- - - -
diff --git a/modules/ttimporter/tpl/js/importer_admin.js b/modules/ttimporter/tpl/js/importer_admin.js deleted file mode 100644 index cef481fb6..000000000 --- a/modules/ttimporter/tpl/js/importer_admin.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @file modules/ttimporter/js/importer_admin.js - * @author zero (zero@nzeo.com) - * @brief importer에서 사용하는 javascript - **/ - -/* Step Complete Import */ -function completeImport(ret_obj) { - var message = ret_obj['message']; - var is_finished = ret_obj['is_finished']; - var position = ret_obj['position']; - - xGetElementById("import_status").style.display = "block"; - - if(is_finished=='Y') { - alert(ret_obj["message"]); - location.href = location.href; - } else { - var fo_obj = xGetElementById('fo_import'); - fo_obj.position.value = position; - xInnerHtml('import_status', message); - procFilter(fo_obj, import_tt); - } -} - -function doManualProcess() { - var fo_obj = xGetElementById('fo_import'); - procFilter(fo_obj, import_tt); -} diff --git a/modules/ttimporter/ttimporter.admin.controller.php b/modules/ttimporter/ttimporter.admin.controller.php deleted file mode 100644 index f5040ce9b..000000000 --- a/modules/ttimporter/ttimporter.admin.controller.php +++ /dev/null @@ -1,264 +0,0 @@ -module_srl = Context::get('module_srl'); - $xml_file = Context::get('xml_file'); - $this->url = Context::get('url'); - $this->position = (int)Context::get('position'); - if(substr($this->url,-1)!='/') $this->url .= '/'; - - // 파일을 찾을 수 없으면 에러 표시 - if(!file_exists($xml_file)) return new Object(-1,'msg_no_xml_file'); - - $this->oXml = new XmlParser(); - - $oDocumentModel = &getModel('document'); - $tmp_category_list = $oDocumentModel->getCategoryList($this->module_srl); - if(count($tmp_category_list)) { - foreach($tmp_category_list as $key => $val) $this->category_list[$val->title] = $key; - } else { - $this->category_list = array(); - } - - // module_srl이 있으면 module데이터로 판단하여 처리, 아니면 회원정보로.. - $is_finished = $this->importDocument($xml_file); - - if($is_finished) { - $this->add('is_finished', 'Y'); - $this->setMessage( sprintf(Context::getLang('msg_import_finished'), $this->imported_count) ); - } else { - $this->add('position', $this->imported_count); - $this->add('is_finished', 'N'); - $this->setMessage( sprintf(Context::getLang('msg_importing'), $this->imported_count) ); - } - } - - /** - * @brief 게시물정보 import - **/ - function importDocument($xml_file) { - $filesize = filesize($xml_file); - - if($filesize<1) return; - - $this->oDocumentController = &getController('document'); - $this->oFileController = &getController('file'); - $this->oCommentController = &getController('comment'); - $this->oTrackbackController = &getController('trackback'); - - $is_finished = true; - - $fp = @fopen($xml_file, "r"); - if($fp) { - $buff = ''; - while(!feof($fp)) { - $str = fread($fp,1024); - $buff .= $str; - - $buff = preg_replace_callback("!(.*?)<\/category>!is", array($this, '_parseCategoryInfo'), trim($buff)); - $buff = preg_replace_callback("!!is", array($this, '_importDocument'), trim($buff)); - - if($this->position+$this->limit_count <= $this->imported_count) { - $is_finished = false; - break; - } - } - fclose($fp); - } - - return $is_finished; - } - - function _insertAttachment($matches) { - $xml_doc = $this->oXml->parse($matches[0]); - - $filename = $xml_doc->attachment->name->body; - $url = sprintf("%sattach/1/%s", $this->url, $filename); - - $tmp_filename = './files/cache/tmp_uploaded_file'; - if(FileHandler::getRemoteFile($url, $tmp_filename)) { - $file_info['tmp_name'] = $tmp_filename; - $file_info['name'] = $filename; - $this->oFileController->insertFile($file_info, $this->module_srl, $this->document_srl, 0, true); - $this->uploaded_count++; - } - @unlink($tmp_filename); - } - - function _importDocument($matches) { - if($this->position > $this->imported_count) { - $this->imported_count++; - return; - } - - $this->uploaded_count = 0; - - $xml_doc = $this->oXml->parse($matches[0]); - - // 문서 번호와 내용 미리 구해 놓기 - $this->document_srl = $args->document_srl = getNextSequence(); - $args->content = $xml_doc->post->content->body; - - // 첨부파일 미리 등록 - preg_replace_callback("!!is", array($this, '_insertAttachment'), $matches[0]); - - // 컨텐츠의 내용 수정 (이미지 첨부파일 관련) - $args->content = preg_replace("!(\[##\_1)([a-zA-Z]){1}\|([^\|]*)\|([^\|]*)\|([^\]]*)\]!is", sprintf('', $this->module_srl, $args->document_srl), $args->content); - - if($xml_doc->post->comment && !is_array($xml_doc->post->comment)) $xml_doc->post->comment = array($xml_doc->post->comment); - - $logged_info = Context::get('logged_info'); - - // 문서 입력 - $args->module_srl = $this->module_srl; - $args->category_srl = $this->category_list[$xml_doc->post->category->body]; - $args->is_notice = 'N'; - $args->is_secret = 'N'; - $args->title = $xml_doc->post->title->body; - $args->readed_count = 0; - $args->voted_count = 0; - $args->comment_count = count($xml_doc->post->comment); - $args->trackback_count = 0; - $args->uploaded_count = $this->uploaded_count; - $args->password = ''; - $args->nick_name = $logged_info->nick_name; - $args->member_srl = $logged_info->member_srl; - $args->user_id = $logged_info->user_id; - $args->user_name = $logged_info->user_name; - $args->email_address = $logged_info->email_address; - $args->homepage = $logged_info->homepage; - - $tag_list = array(); - $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); - $args->ipaddress = ''; - $args->allow_comment = $xml_doc->post->acceptcomment->body?'Y':'N'; - $args->lock_comment = 'N'; - $args->allow_trackback = $xml_doc->post->accepttrackback->body?'Y':'N'; - - $output = $this->oDocumentController->insertDocument($args, true); - - if($output->toBool()) { - - // 코멘트 입력 - $comments = $xml_doc->post->comment; - if(count($comments)) { - foreach($comments as $key => $val) { - unset($comment_args); - $comment_args->document_srl = $args->document_srl; - $comment_args->comment_srl = getNextSequence(); - $comment_args->module_srl = $this->module_srl; - $comment_args->parent_srl = 0; - $comment_args->content = $val->content->body; - $comment_args->password = ''; - $comment_args->nick_name = $val->commenter->name->body; - $comment_args->user_id = ''; - $comment_args->user_name = ''; - $comment_args->member_srl = 0; - $comment_args->email_address = ''; - $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); - } - - } - } - - /* - // 트랙백 입력 - $trackbacks = $xml_doc->document->trackbacks->trackback; - if($trackbacks && !is_array($trackbacks)) $trackbacks = array($trackbacks); - if(count($trackbacks)) { - foreach($trackbacks as $key => $val) { - $trackback_args->document_srl = $args->document_srl; - $trackback_args->module_srl = $this->module_srl; - $trackback_args->url = $val->url->body; - $trackback_args->title = $val->title->body; - $trackback_args->blog_name = $val->blog_name->body; - $trackback_args->excerpt = $val->excerpt->body; - $trackback_args->regdate = $val->regdate->body; - $trackback_args->ipaddress = $val->ipaddress->body; - $this->oTrackbackController->insertTrackback($trackback_args, true); - } - } - */ - } - - $this->imported_count ++; - return ''; - } - - /** - * @brief 정보를 읽어서 정보를 구함 - **/ - function _parseCategoryInfo($matches) { - $xml_doc = $this->oXml->parse($matches[0]); - if(!$xml_doc->category->priority) return $matches[0]; - - $title = trim($xml_doc->category->name->body); - if(!$title || $this->category_list[$title]) return; - - $oDocumentController = &getAdminController('document'); - $output = $oDocumentController->insertCategory($this->module_srl, $title); - $this->category_list[$title] = $output->get('category_srl'); - } - } -?> diff --git a/modules/ttimporter/ttimporter.admin.view.php b/modules/ttimporter/ttimporter.admin.view.php deleted file mode 100644 index 921196a25..000000000 --- a/modules/ttimporter/ttimporter.admin.view.php +++ /dev/null @@ -1,32 +0,0 @@ -getMidList(); - Context::set('module_list', $module_list); - - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('index'); - } - - } -?> diff --git a/modules/ttimporter/ttimporter.class.php b/modules/ttimporter/ttimporter.class.php deleted file mode 100644 index 1d099d7dc..000000000 --- a/modules/ttimporter/ttimporter.class.php +++ /dev/null @@ -1,36 +0,0 @@ -insertActionForward('ttimporter', 'view', 'dispTtimporterAdminContent'); - - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - return new Object(); - } - - } -?>