mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
css 및 js 호출순서 조정기능 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5785 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
4f380d9c48
commit
61851f1dfe
2149 changed files with 109090 additions and 18689 deletions
|
|
@ -1,11 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="0.2">
|
||||
<title xml:lang="ko">XE 데이터 이전</title>
|
||||
<title xml:lang="en">XE data transferation</title>
|
||||
<title xml:lang="ko">데이터 이전</title>
|
||||
<title xml:lang="en">data transferation</title>
|
||||
<title xml:lang="zh-CN">数据导入</title>
|
||||
<title xml:lang="jp">XEデータ移転</title>
|
||||
<title xml:lang="es">Transferencia de los datos de XE</title>
|
||||
<title xml:lang="ru">Трансферинг данных XE</title>
|
||||
<title xml:lang="jp">ータ移転</title>
|
||||
<title xml:lang="es">Transferencia de los datos</title>
|
||||
<title xml:lang="ru">Трансферинг</title>
|
||||
<title xml:lang="zh-TW">資料匯入</title>
|
||||
<description xml:lang="ko">XML파일을 이용하여 회원정보 또는 게시판등의 데이터를 입력합니다.</description>
|
||||
<description xml:lang="en">Inputting member information or board's data using XML file.</description>
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
<description xml:lang="zh-TW">利用XML檔案匯入會員或討論板資料。</description>
|
||||
<version>0.2</version>
|
||||
<date>2007-12-13</date>
|
||||
<category>accessory</category>
|
||||
<category>migration</category>
|
||||
|
||||
<author email_address="zero@zeroboard.com" link="http://blog.nzeo.com">
|
||||
<name xml:lang="ko">zero</name>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<module>
|
||||
<grants />
|
||||
<permissions />
|
||||
<actions>
|
||||
<action name="dispImporterAdminContent" type="view" standalone="true" admin_index="true" />
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
**/
|
||||
class extract {
|
||||
var $key = '';
|
||||
var $cache_path = './files/cache/tmp';
|
||||
var $cache_index_file = './files/cache/tmp';
|
||||
var $cache_path = './files/cache/importer';
|
||||
var $cache_index_file = './files/cache/importer';
|
||||
|
||||
var $filename = null;
|
||||
var $startTag = '';
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
$this->key = md5($filename);
|
||||
|
||||
$this->cache_path = './files/cache/tmp/'.$this->key;
|
||||
$this->cache_path = './files/cache/importer/'.$this->key;
|
||||
$this->cache_index_file = $this->cache_path.'/index';
|
||||
|
||||
if(!is_dir($this->cache_path)) FileHandler::makeDir($this->cache_path);
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
* @brief XML파일을 미리 분석하여 개발 단위로 캐싱
|
||||
**/
|
||||
function procImporterAdminPreProcessing() {
|
||||
DebugPrint('procImporterAdminPreProcessing...');
|
||||
// 이전할 대상 xml파일을 구함
|
||||
$xml_file = Context::get('xml_file');
|
||||
|
||||
|
|
@ -55,33 +56,62 @@
|
|||
if($output->toBool()) $oExtract->saveItems();
|
||||
break;
|
||||
case 'ttxml' :
|
||||
// 카테고리 정보를 먼저 구함
|
||||
$output = $oExtract->set($xml_file,'','<author', '<category>', '<post ');
|
||||
if($output->toBool()) {
|
||||
DebugPrint('preprocessing ttxml started.');
|
||||
// 카테고리 정보를 구함
|
||||
$output = $oExtract->set($xml_file, '', '', '', '');
|
||||
if ($output->toBool()) {
|
||||
// ttxml 카테고리는 별도로 구함
|
||||
$started = false;
|
||||
$buff = '';
|
||||
while(!feof($oExtract->fd)) {
|
||||
while (!feof($oExtract->fd)) {
|
||||
$str = fgets($oExtract->fd, 1024);
|
||||
if(substr($str,0,strlen('<category>'))=='<category>') $started = true;
|
||||
if(substr($str,0,strlen('<post '))=='<post ') break;
|
||||
if($started) $buff .= $str;
|
||||
if(substr($str,0,strlen('<post ')) == '<post ') break;
|
||||
if ($started) $buff .= $str;
|
||||
}
|
||||
$buff = '<items>'.$buff.'</items>';
|
||||
$buff = '<categories>'.$buff.'</categories>';
|
||||
$oExtract->closeFile();
|
||||
$category_filename = sprintf('%s/%s', $oExtract->cache_path, 'category');
|
||||
$category_filename = sprintf('%s/%s', $oExtract->cache_path, 'category.xml');
|
||||
FileHandler::writeFile($category_filename, $buff);
|
||||
|
||||
// 개별 아이템 구함
|
||||
$output = $oExtract->set($xml_file,'<blog', '</blog>', '<post ', '</post>');
|
||||
if($output->toBool()) $oExtract->saveItems();
|
||||
DebugPrint('category finished.');
|
||||
|
||||
// 방명록 정보를 구함
|
||||
$output = $oExtract->set($xml_file, '', '', '', '');
|
||||
if ($output->toBool()) {
|
||||
$started = false;
|
||||
$buff = '';
|
||||
while (!feof($oExtract->fd)) {
|
||||
$str = fgets($oExtract->fd, 1024);
|
||||
if(substr($str,0,strlen('<guestbook>'))=='<guestbook>') $started = true;
|
||||
if ($started) {
|
||||
$pos = strpos($str, '</guestbook>');
|
||||
if ($pos !== false) {
|
||||
$buff .= substr($str, 0, $pos + strlen('</guestbook>'));
|
||||
break;
|
||||
}
|
||||
$buff .= $str;
|
||||
}
|
||||
}
|
||||
$oExtract->closeFile();
|
||||
$guestbook_filename = sprintf('%s/%s', $oExtract->cache_path, 'guestbook.xml');
|
||||
FileHandler::writeFile($guestbook_filename, $buff);
|
||||
|
||||
DebugPrint('guestbook finished.');
|
||||
|
||||
// 개별 아이템 구함
|
||||
$output = $oExtract->set($xml_file,'<blog', '</blog>', '<post ', '</post>');
|
||||
if($output->toBool()) $oExtract->saveItems();
|
||||
|
||||
DebugPrint('data finished.');
|
||||
}
|
||||
}
|
||||
break;
|
||||
default :
|
||||
// 카테고리 정보를 먼저 구함
|
||||
$output = $oExtract->set($xml_file,'<categories>', '</categories>', '<category','</category>');
|
||||
if($output->toBool()) {
|
||||
$oExtract->mergeItems('category');
|
||||
$oExtract->mergeItems('category.xml');
|
||||
|
||||
// 개별 아이템 구함
|
||||
$output = $oExtract->set($xml_file,'<posts ', '</posts>', '<post>', '</post>');
|
||||
|
|
@ -110,6 +140,7 @@
|
|||
* @brief xml파일의 내용이 extract되고 난후 차례대로 마이그레이션
|
||||
**/
|
||||
function procImporterAdminImport() {
|
||||
|
||||
// 변수 설정
|
||||
$type = Context::get('type');
|
||||
$total = Context::get('total');
|
||||
|
|
@ -117,10 +148,11 @@
|
|||
$key = Context::get('key');
|
||||
$user_id = Context::get('user_id');
|
||||
$target_module = Context::get('target_module');
|
||||
$guestbook_target_module = Context::get('guestbook_target_module');
|
||||
$this->unit_count = Context::get('unit_count');
|
||||
|
||||
// index파일이 있는지 확인
|
||||
$index_file = './files/cache/tmp/'.$key.'/index';
|
||||
$index_file = './files/cache/importer/'.$key.'/index';
|
||||
if(!file_exists($index_file)) return new Object(-1, 'msg_invalid_xml_file');
|
||||
|
||||
switch($type) {
|
||||
|
|
@ -129,7 +161,7 @@
|
|||
|
||||
require_once('./modules/importer/ttimport.class.php');
|
||||
$oTT = new ttimport();
|
||||
$cur = $oTT->importModule($key, $cur, $index_file, $this->unit_count, $target_module, $user_id);
|
||||
$cur = $oTT->importModule($key, $cur, $index_file, $this->unit_count, $target_module, $guestbook_target_module, $user_id);
|
||||
break;
|
||||
case 'message' :
|
||||
$cur = $this->importMessage($key, $cur, $index_file);
|
||||
|
|
@ -154,7 +186,7 @@
|
|||
// 모두 입력시 성공 메세지 출력하고 cache 파일제거
|
||||
if($total <= $cur) {
|
||||
$this->setMessage( sprintf(Context::getLang('msg_import_finished'), $cur, $total) );
|
||||
FileHandler::removeFilesInDir('./files/cache/tmp/');
|
||||
FileHandler::removeFilesInDir('./files/cache/importer/'.$key);
|
||||
} else $this->setMessage( sprintf(Context::getLang('msg_importing'), $total, $cur) );
|
||||
}
|
||||
|
||||
|
|
@ -404,7 +436,7 @@
|
|||
if(count($category_list)) foreach($category_list as $key => $val) $category_titles[$val->title] = $val->category_srl;
|
||||
|
||||
// 먼저 카테고리 정보를 입력함
|
||||
$category_file = preg_replace('/index$/i', 'category', $index_file);
|
||||
$category_file = preg_replace('/index$/i', 'category.xml', $index_file);
|
||||
if(file_exists($category_file)) {
|
||||
$buff = FileHandler::readFile($category_file);
|
||||
|
||||
|
|
@ -793,7 +825,7 @@
|
|||
// 디렉토리 생성
|
||||
if(!FileHandler::makeDir($path)) continue;
|
||||
|
||||
if(preg_match('/^\.\/files\/cache\/tmp/i',$file_obj->file)) FileHandler::rename($file_obj->file, $filename);
|
||||
if(preg_match('/^\.\/files\/cache\/importer/i',$file_obj->file)) FileHandler::rename($file_obj->file, $filename);
|
||||
else @copy($file_obj->file, $filename);
|
||||
|
||||
// DB입력
|
||||
|
|
@ -825,7 +857,7 @@
|
|||
* @biref 임의로 사용할 파일이름을 return
|
||||
**/
|
||||
function getTmpFilename() {
|
||||
$path = "./files/cache/tmp";
|
||||
$path = "./files/cache/importer";
|
||||
if(!is_dir($path)) FileHandler::makeDir($path);
|
||||
$filename = sprintf("%s/%d", $path, rand(11111111,99999999));
|
||||
if(file_exists($filename)) $filename .= rand(111,999);
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@
|
|||
* @brief 설치시 추가 작업이 필요할시 구현
|
||||
**/
|
||||
function moduleInstall() {
|
||||
// action forward에 등록 (관리자 모드에서 사용하기 위함)
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertActionForward('importer', 'view', 'dispImporterAdminContent');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,14 +27,18 @@
|
|||
13 => 'Step 1-3. Select target category',
|
||||
2 => 'Step 2. Upload XML file',
|
||||
3 => 'Step 2. Synchronize member data and article data',
|
||||
99 => 'Transferring data',
|
||||
);
|
||||
|
||||
$lang->import_step_desc = array(
|
||||
1 => 'Please select the XML file\'s type you wish to transfer.',
|
||||
12 => 'Please select the module you wish to transfer datas.',
|
||||
121 => 'Posts:',
|
||||
122 => 'Guestbook:',
|
||||
13 => 'Please select the target category you wish to tranfer datas.',
|
||||
2 => "Please input the XML file's location you wish to tranfer datas.\nIf it is located in the same account, input absolute/relative path. If not, input the url starting with http://..",
|
||||
3 => 'The member data and article data may not be correct after the transferation. If that is the case, synchronize to repair it based on user_id.',
|
||||
99 => 'Transferring data in progress.',
|
||||
);
|
||||
|
||||
// guide/alert
|
||||
|
|
|
|||
|
|
@ -27,14 +27,18 @@
|
|||
13 => 'Paso 1-3. Seleccione la categoría del módulo',
|
||||
2 => 'Paso 2. Subir el archivo XML',
|
||||
3 => 'Paso 2. Sincronizar las informaciones del usuario y la del documento',
|
||||
99 => '데이터 이전',
|
||||
);
|
||||
|
||||
$lang->import_step_desc = array(
|
||||
1 => 'Seleccione el tipo de archivo XML a transfrerir.',
|
||||
12 => 'Seleccione el módulo para transferir los datos.',
|
||||
121 => '글:',
|
||||
122 => '방명록:',
|
||||
13 => 'Seleccione la categoría para transferir los datos.',
|
||||
2 => "Ingrese la ubicación del archivo XML para transfer los datos.\nPuede ser ruta absoluto o relativo.",
|
||||
3 => 'La información del usuario y del documento podría ser incorrecto luego de la transferencia. Si ese es el caso, sincroniza para la corrección basado a la ID del usuario.',
|
||||
99 => '데이터를 이전중입니다',
|
||||
);
|
||||
|
||||
// Guía/ Alerta
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@
|
|||
$lang->import_step_desc = array(
|
||||
1 => 'Choisissez la sorte du fichier en XML que vous voulez transférer.',
|
||||
12 => 'Choisissez le module objectif dans lequel vous voulez tranférer les données.',
|
||||
121 => '글:',
|
||||
122 => '방명록:',
|
||||
13 => 'Choisissez la catégorie objective dans laquelle vous voulez transférer les données.',
|
||||
2 => "Entrez le chemin du fichier en XML pour transférer les données.\nS'il est localisé dans le même compte, entréz le chemin absolut ou relatif. Sinon, entrez l'URL commençant avec http://..",
|
||||
3 => 'Les données des membres et ceux des articles peuvent ne pas s\'accorder après la transfèrement. Dans ce cas, synchronisez S.V.P. Ça arrangera les données en étant basé sur le compte d\'utilisateur.',
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@
|
|||
$lang->import_step_desc = array(
|
||||
1 => '変換するXMLファイルの種類を選択してください。',
|
||||
12 => 'データ変換を行う対象モジュールを選択してください。',
|
||||
121 => '글:',
|
||||
122 => '방명록:',
|
||||
13 => 'データ変換を行う対象カテゴリを選択してください。',
|
||||
2 => "データ変換を行うXMLファイルパスを入力してください。同じアカウントのサーバ上では、相対または絶対パスを、異なるサーバにアップロードされている場合は「http://アドレス..」を入力してください。",
|
||||
3 => '会員情報と書き込みデータの情報の変換を行った後、データが合わない場合があります。この時に同期化を行うと「user_id」をもとに正しく動作するようにします。',
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@
|
|||
$lang->import_step_desc = array(
|
||||
1 => '이전을 하려는 XML파일의 종류를 선택해주세요.',
|
||||
12 => '데이터 이전을 할 대상 모듈을 선택해주세요.',
|
||||
121 => '글:',
|
||||
122 => '방명록:',
|
||||
13 => '데이터 이전을 할 대상 분류를 선택해주세요.',
|
||||
2 => "데이터 이전을 할 XML파일의 경로를 입력해주세요.\n상대 또는 절대 경로를 입력하시면 됩니다",
|
||||
3 => '회원정보와 게시물의 정보가 이전후에 맞지 않을 수 있습니다. 이 때 동기화를 하시면 user_id를 기반으로 올바르게 동작하도록 합니다.',
|
||||
|
|
|
|||
|
|
@ -27,14 +27,18 @@
|
|||
13 => 'Шаг 1-3. Выберите категорию назначения',
|
||||
2 => 'Шаг 2. Загрузить XML файл',
|
||||
3 => 'Шаг 2. Синхронизировать данные пользователей и статей',
|
||||
99 => '데이터 이전',
|
||||
);
|
||||
|
||||
$lang->import_step_desc = array(
|
||||
1 => 'Пожалуйста, выберите тип XML файла, который Вы хотите импортировать.',
|
||||
12 => 'Пожалуйста, выберите модуль, в который Вы хотите импортировать данные.',
|
||||
121 => '글:',
|
||||
122 => '방명록:',
|
||||
13 => 'Пожалуйста, выберите категорию назначения, в которую Вы хотите импортировать данные.',
|
||||
2 => "Пожайлуста, введите расположение XML файла, который Вы хотите импортировать.\nЕсли он находится в одном аккаунте, то введите абсолютный/относительный путь. Если нет, то введите URL, начинающийся с http://...",
|
||||
3 => 'Данные пользователей и статей могут быть некорректны после импорта. В таком случае, выполните синхронизацию для восстановления, основанного на user_id.',
|
||||
99 => '데이터를 이전중입니다',
|
||||
);
|
||||
|
||||
// гид/алерт
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@
|
|||
$lang->import_step_desc = array(
|
||||
1 => '请选择要导入的XML文件种类。',
|
||||
12 => '请选择要导入的对象模块。',
|
||||
121 => '主题:',
|
||||
122 => '留言本:',
|
||||
13 => '请选择要导入的对象分类。',
|
||||
2 => "请输入要导入的XML文件的位置。\n可输入相对或绝对路径。",
|
||||
3 => '数据导入后可能会导致会员信息和文章内容信息的误差。这时以user_id进行同步即可解决问题。',
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
/**
|
||||
* @file zh-TW.lang.php
|
||||
* @author zero (zero@nzeo.com) 翻譯:royallin
|
||||
* @brief 匯入模組語言
|
||||
* @brief 匯入(importer)模組語言
|
||||
**/
|
||||
|
||||
// 按鈕上使用的語言
|
||||
// 按鈕語言
|
||||
$lang->cmd_sync_member = '同步';
|
||||
$lang->cmd_continue = '繼續進行';
|
||||
$lang->preprocessing = '準備匯入資料...';
|
||||
|
|
@ -33,9 +33,11 @@
|
|||
$lang->import_step_desc = array(
|
||||
1 => '請選擇要匯入的XML檔案類型。',
|
||||
12 => '請選擇要匯入的目標模組。',
|
||||
121 => '文章:',
|
||||
122 => '討論板:',
|
||||
13 => '請選擇要匯入的目標分類。',
|
||||
2 => "請輸入要匯入的XML檔案位置。\n可輸入相對或絕對路徑。",
|
||||
3 => '資料匯入後,可能會導致會員資料和文章內容產生誤差。請以user_id進行同步即可解決。',
|
||||
3 => '資料匯入後,可能會導致會員資料和文章內容產生誤差。請以『user_id』進行同步即可解決。',
|
||||
99 => '資料匯入中...',
|
||||
);
|
||||
|
||||
|
|
@ -43,17 +45,17 @@
|
|||
$lang->msg_sync_member = '按同步按鈕,即可開始進行會員資料和文章的同步。';
|
||||
$lang->msg_no_xml_file = '找不到XML檔案,請重新確認路徑。';
|
||||
$lang->msg_invalid_xml_file = 'XML檔案格式錯誤!';
|
||||
$lang->msg_importing = '%d個的資料中正在輸入 %d個。 (長時間沒有回應時,請按「繼續進行」按鈕)';
|
||||
$lang->msg_importing = '%d個的資料中正在輸入 %d個。(長時間沒有回應時,請按「繼續進行」按鈕)';
|
||||
$lang->msg_import_finished = '已完成輸入%d/%d個資料。根據情況的不同,可能會出現沒有被匯入的資料。';
|
||||
$lang->msg_sync_completed = '已完成會員和文章,評論的同步。';
|
||||
|
||||
// 說明
|
||||
// 其他
|
||||
$lang->about_type_member = '資料匯入目標為會員資料時,請選擇此項。';
|
||||
$lang->about_type_message = '資料匯入目標為短信息(MemoBox)時,請選擇此項。';
|
||||
$lang->about_type_ttxml = '資料匯入目標為TTXML(textcube系列)時,請選擇此項。';
|
||||
$lang->about_ttxml_user_id = '請輸入匯入TTXML資料時,指定為主題發表者的ID(必須是已註冊會員)。';
|
||||
$lang->about_type_module = '資料匯入目標為討論板主題時,請選擇此項。';
|
||||
$lang->about_type_syncmember = '匯入會員和文章資料後,需要同步會員資料時,請選擇此項。';
|
||||
$lang->about_importer = "不僅可以匯入Zeroboard 4,Zb5beta的資料,也能夠把其他程式資料匯入到XE當中。\n匯入資料時,請利用 <a href=\"http://svn.zeroboard.com/zeroboard_xe/migration_tools/\" onclick=\"winopen(this.href);return false;\">XML Exporter</a>建立XML檔案後再上傳。";
|
||||
$lang->about_target_path = "為了下載附件請輸入Zeroboard 4的安裝位置。\n位置在同一個主機時,請輸入如 /home/id/public_html/bbs的路徑,在不同主機時,請輸入如 http://域名/bbs的url地址。";
|
||||
$lang->about_importer = "不僅可以匯入Zeroboard 4,Zb5beta的資料,也能夠把其他程式資料匯入到XE當中。\n匯入資料時,請利用<a href=\"http://svn.zeroboard.com/zeroboard_xe/migration_tools/\" onclick=\"winopen(this.href);return false;\">XML Exporter</a>建立XML檔案後再上傳。";
|
||||
$lang->about_target_path = "為了下載附檔請輸入Zeroboard 4的安裝位置。\n位置在同一個主機時,請輸入如『/home/id/public_html/bbs』的路徑,在不同主機時,請輸入如『http://域名/bbs』的URL網址。";
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{@ $type_list = array('module'=>$lang->type_module, 'ttxml'=>$lang->type_ttxml, 'member'=>$lang->type_member, 'sync'=>$lang->type_syncmember, 'message'=>$lang->type_message) }
|
||||
|
||||
<h3>{$lang->importer} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
<h3 class="xeAdmin">{$lang->importer} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
|
||||
<!-- 설명 -->
|
||||
<div class="infoText">{nl2br($lang->about_importer)}</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<!--%import("js/importer_admin.js")-->
|
||||
<!--%import("css/importer.css")-->
|
||||
|
||||
<h3>{$lang->importer} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
<h3 class="xeAdmin">{$lang->importer} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
|
||||
<!-- 설명 -->
|
||||
<div class="infoText">{nl2br($lang->about_importer)}</div>
|
||||
|
|
@ -11,11 +11,12 @@
|
|||
<form action="./" method="get">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<caption>{$lang->import_step_title[1]} - {$lang->import_step_desc[1]}</caption>
|
||||
|
||||
<h4 class="xeAdmin">{$lang->import_step_title[1]} - {$lang->import_step_desc[1]}</h4>
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
<th scope="col"><div><label for="source_type_module">1. {$lang->type_module}</label></div></th>
|
||||
<td><input type="radio" name="source_type" value="module" id="source_type_module" /> <label for="source_type_module">{$lang->about_type_module}</label></td>
|
||||
<td class="wide"><input type="radio" name="source_type" value="module" id="source_type_module" /> <label for="source_type_module">{$lang->about_type_module}</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="col"><div><label for="source_type_ttxml">2. {$lang->type_ttxml}</label></div></th>
|
||||
|
|
@ -34,9 +35,9 @@
|
|||
<td><input type="radio" name="source_type" value="message" id="source_type_message" /> <label for="source_type_message">{$lang->about_type_message}</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="right">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_next}" /></span>
|
||||
</td>
|
||||
<th colspan="2" class="button">
|
||||
<span class="button black strong"><input type="submit" value="{$lang->cmd_next}" /></span>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ function doPreProcessing(fo_obj) {
|
|||
|
||||
var type = fo_obj.type.value;
|
||||
|
||||
xDisplay('importForm','none');
|
||||
xDisplay('process','block');
|
||||
xInnerHtml('status','');
|
||||
jQuery('#importForm').hide();
|
||||
jQuery('#process').show();
|
||||
jQuery('#status').empty();
|
||||
prepared = false;
|
||||
setTimeout(doPrepareDot, 50);
|
||||
|
||||
|
|
@ -48,17 +48,18 @@ function doPreProcessing(fo_obj) {
|
|||
function doPrepareDot() {
|
||||
if(prepared) return;
|
||||
|
||||
var str = xInnerHtml('status');
|
||||
if(str.length<1 || str.length - preProcessingMsg.length > 50) str = preProcessingMsg;
|
||||
var str = jQuery('#status').html();
|
||||
if(str.length < 1 || str.length - preProcessingMsg.length > 50) str = preProcessingMsg;
|
||||
else str += ".";
|
||||
xInnerHtml('status', str);
|
||||
|
||||
jQuery('#status').html(str);
|
||||
setTimeout(doPrepareDot, 50);
|
||||
}
|
||||
|
||||
/* 준비가 끝났을때 호출되는 함수 */
|
||||
function completePreProcessing(ret_obj, response_tags) {
|
||||
prepared = true;
|
||||
xInnerHtml('status','');
|
||||
jQuery('#status').empty();
|
||||
|
||||
var status = ret_obj['status'];
|
||||
var message = ret_obj['message'];
|
||||
|
|
@ -76,17 +77,18 @@ function completePreProcessing(ret_obj, response_tags) {
|
|||
return;
|
||||
}
|
||||
|
||||
xDisplay('btn_reload','none');
|
||||
xDisplay('btn_continue','block');
|
||||
jQuery('#btn_reload').hide();
|
||||
jQuery('#btn_continue').show();
|
||||
|
||||
var fo_obj = xGetElementById('fo_process');
|
||||
var fo_obj = jQuery('#fo_process').get(0);
|
||||
fo_obj.type.value = type;
|
||||
fo_obj.total.value = total;
|
||||
fo_obj.cur.value = cur;
|
||||
fo_obj.key.value = key;
|
||||
|
||||
var fo_import = xGetElementById('fo_import');
|
||||
var fo_import = jQuery('#fo_import').get(0);
|
||||
if(fo_import && fo_import.target_module) fo_obj.target_module.value = fo_import.target_module.value;
|
||||
if(fo_import && fo_import.guestbook_target_module) fo_obj.guestbook_target_module.value = fo_import.guestbook_target_module.value;
|
||||
if(fo_import && fo_import.user_id) fo_obj.user_id.value = fo_import.user_id.value;
|
||||
|
||||
fo_obj.unit_count.value = fo_import.unit_count.options[fo_import.unit_count.selectedIndex].value;
|
||||
|
|
@ -97,7 +99,7 @@ function completePreProcessing(ret_obj, response_tags) {
|
|||
|
||||
/* @brief 임포트 시작 */
|
||||
function doImport() {
|
||||
var fo_obj = xGetElementById('fo_process');
|
||||
var fo_obj = jQuery('#fo_process').get(0);
|
||||
|
||||
var params = new Array();
|
||||
params['type'] = fo_obj.type.value;
|
||||
|
|
@ -105,6 +107,7 @@ function doImport() {
|
|||
params['cur'] = fo_obj.cur.value;
|
||||
params['key'] = fo_obj.key.value;
|
||||
params['target_module'] = fo_obj.target_module.value;
|
||||
params['guestbook_target_module'] = fo_obj.guestbook_target_module.value;
|
||||
params['unit_count'] = fo_obj.unit_count.value;
|
||||
params['user_id'] = fo_obj.user_id.value;
|
||||
|
||||
|
|
@ -124,26 +127,26 @@ function doImport() {
|
|||
function completeImport(ret_obj, response_tags) {
|
||||
var message = ret_obj['message'];
|
||||
var type = ret_obj['type'];
|
||||
var total = parseInt(ret_obj['total'],10);
|
||||
var cur = parseInt(ret_obj['cur'],10);
|
||||
var total = parseInt(ret_obj['total'], 10);
|
||||
var cur = parseInt(ret_obj['cur'], 10);
|
||||
var key = ret_obj['key'];
|
||||
|
||||
displayProgress(total, cur);
|
||||
|
||||
var fo_obj = xGetElementById('fo_process');
|
||||
var fo_obj = jQuery('#fo_process').get(0);
|
||||
fo_obj.type.value = type;
|
||||
fo_obj.total.value = total;
|
||||
fo_obj.cur.value = cur;
|
||||
fo_obj.key.value = key;
|
||||
|
||||
// extract된 파일을 이용해서 import
|
||||
if(total>cur) doImport();
|
||||
if(total > cur) doImport();
|
||||
else {
|
||||
alert(message);
|
||||
fo_obj.reset();
|
||||
xDisplay('process','none');
|
||||
xDisplay('importForm','block');
|
||||
xGetElementById('fo_import').reset();
|
||||
jQuery('#process').hide();
|
||||
jQuery('#importForm').show();
|
||||
jQuery('#fo_import').get(0).reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -151,19 +154,17 @@ function completeImport(ret_obj, response_tags) {
|
|||
function displayProgress(total, cur) {
|
||||
// 진행률 구함
|
||||
var per = 0;
|
||||
if(total > 0) per = Math.round(cur/total*100);
|
||||
if(total > 0) per = Math.round(cur / total * 100);
|
||||
else per = 100;
|
||||
if(!per) per = 1;
|
||||
|
||||
var status = '<div class="progressBox"><div class="progress1" style="width:'+per+'%;">'+per+'% </div>';
|
||||
status += '<div class="progress2">'+cur+'/'+total+'</div>';
|
||||
status += '<div class="clear"></div></div>';
|
||||
xInnerHtml('status', status);
|
||||
jQuery('#status').html(status);
|
||||
}
|
||||
|
||||
function insertSelectedModule(id, module_srl, mid, browser_title) {
|
||||
var obj= xGetElementById('_'+id);
|
||||
var sObj = xGetElementById(id);
|
||||
sObj.value = module_srl;
|
||||
obj.value = browser_title+' ('+mid+')';
|
||||
jQuery('#' + id).val(module_srl);
|
||||
jQuery('#_' + id).val(browser_title+' ('+mid+')');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
<form action="./" method="get" onsubmit="return doPreProcessing(this)" id="fo_import">
|
||||
<input type="hidden" name="type" value="member" />
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<caption>{$lang->import_step_title[2]} - {$lang->import_step_desc[2]}</caption>
|
||||
<h4 class="xeAdmin">{$lang->import_step_title[2]} - {$lang->import_step_desc[2]}</h4>
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text" name="xml_file" value="./" class="inputTypeText w700" />
|
||||
<input type="text" name="xml_file" value="./" class="inputTypeText fullWidth" />
|
||||
<p>ex1) ../member.xml</p>
|
||||
<p>ex2) http://...../member.xml</p>
|
||||
</td>
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
<option value="500">500</option>
|
||||
<option value="1000">1000</option>
|
||||
</select>
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_next}" /></span>
|
||||
<span class="button black strong"><input type="submit" value="{$lang->cmd_next}" /></span>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
<form action="./" method="get" onsubmit="return doPreProcessing(this)" id="fo_import">
|
||||
<input type="hidden" name="type" value="message" />
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<caption>{$lang->import_step_title[2]} - {$lang->import_step_desc[2]}</caption>
|
||||
<h4 class="xeAdmin">{$lang->import_step_title[2]} - {$lang->import_step_desc[2]}</h4>
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text" name="xml_file" value="./" class="inputTypeText w700" />
|
||||
<input type="text" name="xml_file" value="./" class="inputTypeText fullWidth" />
|
||||
<p>ex1) ../message.xml</p>
|
||||
<p>ex2) http://...../message.xml</p>
|
||||
</td>
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
<option value="500">500</option>
|
||||
<option value="1000">1000</option>
|
||||
</select>
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_next}" /></span>
|
||||
<span class="button black strong"><input type="submit" value="{$lang->cmd_next}" /></span>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -6,26 +6,26 @@
|
|||
<input type="hidden" name="type" value="module" />
|
||||
<input type="hidden" name="target_module" value="" id="target_module" />
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<caption>{$lang->import_step_title[1]} - {$lang->import_step_desc[12]}</caption>
|
||||
<h4 class="xeAdmin">{$lang->import_step_title[1]} - {$lang->import_step_desc[12]}</h4>
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text" name="_target_module" id="_target_module" class="inputTypeText w300" readonly="readonly"><a href="{getUrl('','module','module','act','dispModuleAdminSelectList','id','target_module','type','single')}" onclick="popopen(this.href,'ModuleSelect');return false;" class="button green"><span>{$lang->cmd_select}</span></a>
|
||||
<input type="text" name="_target_module" id="_target_module" class="inputTypeText w300" readonly="readonly"><a href="{getUrl('','module','module','act','dispModuleSelectList','id','target_module','type','single')}" onclick="popopen(this.href,'ModuleSelect');return false;" class="button green"><span>{$lang->cmd_select}</span></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<caption>{$lang->import_step_title[2]} - {$lang->import_step_desc[2]}</caption>
|
||||
<h4 class="xeAdmin">{$lang->import_step_title[2]} - {$lang->import_step_desc[2]}</h4>
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text" name="xml_file" value="./" class="inputTypeText w700" />
|
||||
<input type="text" name="xml_file" value="./" class="inputTypeText fullWidth" />
|
||||
<p>ex1) ../module.xml</p>
|
||||
<p>ex2) http://...../module.xml</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<th>
|
||||
<select name="unit_count" class="w100">
|
||||
<option value="10" selected="selected">10</option>
|
||||
<option value="20">20</option>
|
||||
|
|
@ -38,8 +38,8 @@
|
|||
<option value="500">500</option>
|
||||
<option value="1000">1000</option>
|
||||
</select>
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_next}" /></span>
|
||||
</td>
|
||||
<span class="button black strong"><input type="submit" value="{$lang->cmd_next}" /></span>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
|
|
|||
|
|
@ -9,11 +9,12 @@
|
|||
<input type="hidden" name="cur" value="" />
|
||||
<input type="hidden" name="key" value="" />
|
||||
<input type="hidden" name="target_module" value="" />
|
||||
<input type="hidden" name="guestbook_target_module" value="" />
|
||||
<input type="hidden" name="unit_count" value="" />
|
||||
<input type="hidden" name="user_id" value="" />
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<caption>{$lang->import_step_title[99]} - {$lang->import_step_desc[99]}</caption>
|
||||
<h4 class="xeAdmin">{$lang->import_step_title[99]} - {$lang->import_step_desc[99]}</h4>
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
<td>
|
||||
<div id="status"></div>
|
||||
|
|
@ -21,8 +22,8 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th class="button">
|
||||
<div id="btn_continue" style="display:none;"><span class="button black strong"><input type="submit" value="{$lang->cmd_continue}" /></span></div>
|
||||
<div id="btn_reload" style="display:block;"><span class="button"><input type="button" value="{$lang->cmd_reload}" onclick="location.reload(); return false;"/></span></div>
|
||||
<div id="btn_continue" style="display:none;"><span class="button"><input type="submit" value="{$lang->cmd_continue}" /></span></div>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<!--#include("header.html")-->
|
||||
|
||||
<form action="./" method="get" onsubmit="return doSync(this)">
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<caption>{$lang->import_step_title[3]} - {$lang->import_step_desc[3]}</caption>
|
||||
<h4 class="xeAdmin">{$lang->import_step_title[3]} - {$lang->import_step_desc[3]}</h4>
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
<td><span class="button"><input type="submit" value="{$lang->cmd_sync_member}" /></span></td>
|
||||
<th class="button"><span class="button black strong"><input type="submit" value="{$lang->cmd_sync_member}" /></span></th>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -5,17 +5,25 @@
|
|||
<form action="./" method="get" onsubmit="return doPreProcessing(this)" id="fo_import">
|
||||
<input type="hidden" name="type" value="ttxml" />
|
||||
<input type="hidden" name="target_module" value="" id="target_module" />
|
||||
<input type="hidden" name="guestbook_target_module" value="" id="guestbook_target_module" />
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<caption>{$lang->import_step_title[1]} - {$lang->import_step_desc[12]}</caption>
|
||||
<h4 class="xeAdmin">{$lang->import_step_title[1]} - {$lang->import_step_desc[12]}</h4>
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
<td>{$lang->import_step_desc[121]} </td>
|
||||
<td>
|
||||
<input type="text" name="_target_module" id="_target_module" class="inputTypeText w300" readonly="readonly"><a href="{getUrl('','module','module','act','dispModuleAdminSelectList','id','target_module','type','single')}" onclick="popopen(this.href,'ModuleSelect');return false;" class="button green"><span>{$lang->cmd_select}</span></a>
|
||||
<input type="text" name="_target_module" id="_target_module" class="inputTypeText w300" readonly="readonly"><a href="{getUrl('','module','module','act','dispModuleSelectList','id','target_module','type','single')}" onclick="popopen(this.href,'ModuleSelect');return false;" class="button green"><span>{$lang->cmd_select}</span></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{$lang->import_step_desc[122]} </td>
|
||||
<td>
|
||||
<input type="text" name="_guestbook_target_module" id="_guestbook_target_module" class="inputTypeText w300" readonly="readonly"><a href="{getUrl('','module','module','act','dispModuleSelectList','id','guestbook_target_module','type','single')}" onclick="popopen(this.href,'ModuleSelect');return false;" class="button green"><span>{$lang->cmd_select}</span></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
<td>
|
||||
{$lang->user_id} : <input type="text" name="user_id" value="{$logged_info->user_id}" class="inputTypeText w200" />
|
||||
|
|
@ -24,8 +32,8 @@
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<caption>{$lang->import_step_title[2]} - {$lang->import_step_desc[2]}</caption>
|
||||
<h4 class="xeAdmin">{$lang->import_step_title[2]} - {$lang->import_step_desc[2]}</h4>
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text" name="xml_file" value="./" class="inputTypeText w700" />
|
||||
|
|
@ -47,7 +55,7 @@
|
|||
<option value="500">500</option>
|
||||
<option value="1000">1000</option>
|
||||
</select>
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_next}" /></span>
|
||||
<span class="button black strong"><input type="submit" value="{$lang->cmd_next}" /></span>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@
|
|||
/**
|
||||
* @brief module.xml 형식의 데이터 import
|
||||
**/
|
||||
function importModule($key, $cur, $index_file, $unit_count, $module_srl, $user_id) {
|
||||
function importModule($key, $cur, $index_file, $unit_count, $module_srl, $guestbook_module_srl, $user_id) {
|
||||
DebugPrint('Import start...');
|
||||
// 필요한 객체 미리 생성
|
||||
$this->oXmlParser = new XmlParser();
|
||||
|
||||
|
|
@ -27,18 +28,17 @@
|
|||
if(count($category_list)) foreach($category_list as $key => $val) $category_titles[$val->title] = $val->category_srl;
|
||||
|
||||
// 먼저 카테고리 정보를 입력함
|
||||
$category_file = preg_replace('/index$/i', 'category', $index_file);
|
||||
$category_file = preg_replace('/index$/i', 'category.xml', $index_file);
|
||||
if(file_exists($category_file)) {
|
||||
$buff = FileHandler::readFile($category_file);
|
||||
|
||||
DebugPrint('Category importing...');
|
||||
// xmlParser객체 생성
|
||||
$xmlDoc = $this->oXmlParser->loadXmlFile($category_file);
|
||||
|
||||
// 카테고리 정보를 정리
|
||||
if($xmlDoc->items->category) {
|
||||
if($xmlDoc->categories->category) {
|
||||
$categories = array();
|
||||
$idx = 0;
|
||||
$this->arrangeCategory($xmlDoc->items, $categories, $idx, 0);
|
||||
$this->arrangeCategory($xmlDoc->categories, $categories, $idx, 0);
|
||||
|
||||
$match_sequence = array();
|
||||
foreach($categories as $k => $v) {
|
||||
|
|
@ -51,11 +51,12 @@
|
|||
if($v->parent) $obj->parent_srl = $match_sequence[$v->parent];
|
||||
$output = $oDocumentController->insertCategory($obj);
|
||||
|
||||
if($output->toBool()) $match_sequence[$v->sequence] = $output->get('category_srl');
|
||||
if($output->toBool()) $match_sequence[$v->sequence] = $category_titles[$category] = $output->get('category_srl');
|
||||
}
|
||||
$oDocumentController->makeCategoryFile($module_srl);
|
||||
}
|
||||
FileHandler::removeFile($category_file);
|
||||
DebugPrint('Category imported.');
|
||||
}
|
||||
$category_list = $category_titles = array();
|
||||
$category_list = $oDocumentModel->getCategoryList($module_srl);
|
||||
|
|
@ -64,6 +65,79 @@
|
|||
// 관리자 정보를 구함
|
||||
$oMemberModel = &getModel('member');
|
||||
$member_info = $oMemberModel->getMemberInfoByUserID($user_id);
|
||||
|
||||
// 방명록 정보를 입력함
|
||||
$guestbook_file = preg_replace('/index$/i', 'guestbook.xml', $index_file);
|
||||
if (file_exists($guestbook_file)) {
|
||||
DebugPrint('Guestbook importing...');
|
||||
// xmlParser객체 생성
|
||||
$xmlDoc = $this->oXmlParser->loadXmlFile($guestbook_file);
|
||||
|
||||
// 방명록 정보를 처리
|
||||
if($guestbook_module_srl && $xmlDoc->guestbook->comment) {
|
||||
DebugPrint('Started.');
|
||||
$comment = $xmlDoc->guestbook->comment;
|
||||
if(!is_array($comment)) $comment = array($comment);
|
||||
foreach($comment as $key => $val) {
|
||||
$obj = null;
|
||||
$obj->module_srl = $guestbook_module_srl;
|
||||
$obj->document_srl = getNextSequence();
|
||||
$obj->uploaded_count = 0;
|
||||
$obj->is_notice = 'N';
|
||||
$obj->is_secret = $val->secret->body=='1'?'Y':'N';
|
||||
$obj->content = nl2br($val->content->body);
|
||||
|
||||
DebugPrint($obj->content);
|
||||
|
||||
// 본문에서 제목 추출
|
||||
$obj->title = cut_str(strip_tags($obj->content),20,'...');
|
||||
if ($obj->title == '') $obj->title = 'Untitled';
|
||||
|
||||
$obj->allow_comment = 'Y';
|
||||
$obj->allow_trackback = 'N';
|
||||
$obj->regdate = date("YmdHis",$val->written->body);
|
||||
$obj->last_update = date("YmdHis", $val->written->body);
|
||||
if(!$obj->last_update) $obj->last_update = $obj->regdate;
|
||||
$obj->tags = '';
|
||||
$obj->readed_count = 0;
|
||||
$obj->voted_count = 0;
|
||||
if ($val->commenter->attrs->id) {
|
||||
$obj->password = '';
|
||||
$obj->nick_name = $member_info->nick_name;
|
||||
$obj->user_name = $member_info->user_name;
|
||||
$obj->user_id = $member_info->user_id;
|
||||
$obj->member_srl = $member_info->member_srl;
|
||||
$obj->email_address = $member_info->email_address;
|
||||
$obj->homepage = $member_info->homepage;
|
||||
}
|
||||
else {
|
||||
$obj->password = $val->password->body;
|
||||
$obj->nick_name = $val->commenter->name->body;
|
||||
$obj->member_srl = 0;
|
||||
$homepage = $val->commenter->homepage->body;
|
||||
}
|
||||
$obj->ipaddress = $val->commenter->ip->body;
|
||||
$obj->list_order = $obj->update_order = $obj->document_srl*-1;
|
||||
$obj->lock_comment = 'N';
|
||||
$obj->notify_message = 'N';
|
||||
$obj->trackback_count = 0;
|
||||
|
||||
$obj->comment_count = 0;
|
||||
if($val->comment) {
|
||||
$child_comment = $val->comment;
|
||||
if(!is_array($child_comment)) $child_comment = array($child_comment);
|
||||
foreach($child_comment as $k => $v) {
|
||||
$result = $this->insertComment($v, $module_srl, $obj->document_srl, $member_info, 0);
|
||||
if($result !== false) $obj->comment_count++;
|
||||
}
|
||||
}
|
||||
|
||||
// 문서 입력
|
||||
$output = executeQuery('document.insertDocument', $obj);
|
||||
}
|
||||
}
|
||||
FileHandler::removeFile($guestbook_file);
|
||||
}
|
||||
|
||||
if(!$cur) $cur = 0;
|
||||
|
||||
|
|
@ -127,10 +201,10 @@
|
|||
$obj->title = $xmlDoc->post->title->body;
|
||||
$obj->content = $xmlDoc->post->content->body;
|
||||
$obj->password = md5($xmlDoc->post->password->body);
|
||||
//$obj->allow_comment = $xmlDoc->post->acceptComment->body==1?'Y':'N';
|
||||
$obj->allow_comment = 'Y';
|
||||
//$obj->allow_trackback = $xmlDoc->post->acceptTrackback->body==1?'Y':'N';
|
||||
$obj->allow_trackback = 'Y';
|
||||
$obj->allow_comment = $xmlDoc->post->acceptcomment->body=='1'?'Y':'N';
|
||||
$obj->allow_trackback = $xmlDoc->post->accepttrackback->body=='1'?'Y':'N';
|
||||
//$obj->allow_comment = $xmlDoc->post->acceptComment->body=='1'?'Y':'N';
|
||||
//$obj->allow_trackback = $xmlDoc->post->acceptTrackback->body=='1'?'Y':'N';
|
||||
$obj->regdate = date("YmdHis",$xmlDoc->post->published->body);
|
||||
$obj->last_update = date("YmdHis", $xmlDoc->post->modified->body);
|
||||
if(!$obj->last_update) $obj->last_update = $obj->regdate;
|
||||
|
|
@ -202,7 +276,7 @@
|
|||
$comment = $xmlDoc->post->comment;
|
||||
if(!is_array($comment)) $comment = array($comment);
|
||||
foreach($comment as $key => $val) {
|
||||
$parent_srl = $this->insertComment($val, $module_srl, $obj->document_srl, 0);
|
||||
$parent_srl = $this->insertComment($val, $module_srl, $obj->document_srl, $member_info, 0);
|
||||
if($parent_srl === false) continue;
|
||||
|
||||
$obj->comment_count++;
|
||||
|
|
@ -210,7 +284,7 @@
|
|||
$child_comment = $val->comment;
|
||||
if(!is_array($child_comment)) $child_comment = array($child_comment);
|
||||
foreach($child_comment as $k => $v) {
|
||||
$result = $this->insertComment($v, $module_srl, $obj->document_srl, $parent_srl);
|
||||
$result = $this->insertComment($v, $module_srl, $obj->document_srl, $member_info, $parent_srl);
|
||||
if($result !== false) $obj->comment_count++;
|
||||
}
|
||||
}
|
||||
|
|
@ -296,7 +370,7 @@
|
|||
}
|
||||
|
||||
// 디렉토리 생성
|
||||
if(!FileHandler::makeDir($path)) continue;
|
||||
if(!FileHandler::makeDir($path)) return;
|
||||
|
||||
FileHandler::rename($file_obj->file, $filename);
|
||||
|
||||
|
|
@ -327,7 +401,7 @@
|
|||
* @biref 임의로 사용할 파일이름을 return
|
||||
**/
|
||||
function getTmpFilename() {
|
||||
$path = "./files/cache/tmp";
|
||||
$path = "./files/cache/importer";
|
||||
if(!is_dir($path)) FileHandler::makeDir($path);
|
||||
$filename = sprintf("%s/%d", $path, rand(11111111,99999999));
|
||||
if(file_exists($filename)) $filename .= rand(111,999);
|
||||
|
|
@ -400,19 +474,29 @@
|
|||
/**
|
||||
* @brief 댓글 입력
|
||||
**/
|
||||
function insertComment($val, $module_srl, $document_srl, $parent_srl = 0) {
|
||||
function insertComment($val, $module_srl, $document_srl, $member_info, $parent_srl = 0) {
|
||||
$tobj = null;
|
||||
$tobj->comment_srl = getNextSequence();
|
||||
$tobj->module_srl = $module_srl;
|
||||
$tobj->document_srl = $document_srl;
|
||||
$tobj->is_secret = $val->secret->body==1?'Y':'N';
|
||||
$tobj->is_secret = $val->secret->body=='1'?'Y':'N';
|
||||
$tobj->notify_message = 'N';
|
||||
$tobj->content = nl2br($val->content->body);
|
||||
$tobj->voted_count = 0;
|
||||
$tobj->password = $val->password->body;
|
||||
$tobj->nick_name = $val->commenter->name->body;
|
||||
$tobj->member_srl = 0;
|
||||
$tobj->homepage = $val->commenter->homepage->body;
|
||||
if ($val->commenter->attrs->id) {
|
||||
$tobj->password = '';
|
||||
$tobj->nick_name = $member_info->nick_name;
|
||||
$tobj->user_name = $member_info->user_name;
|
||||
$tobj->user_id = $member_info->user_id;
|
||||
$tobj->member_srl = $member_info->member_srl;
|
||||
$tobj->homepage = $member_info->homepage;
|
||||
$tobj->email_address = $member_info->email_address;
|
||||
} else {
|
||||
$tobj->password = $val->password->body;
|
||||
$tobj->nick_name = $val->commenter->name->body;
|
||||
$tobj->homepage = $val->commenter->homepage->body;
|
||||
$tobj->member_srl = 0;
|
||||
}
|
||||
$tobj->last_update = $tobj->regdate = date("YmdHis",$val->written->body);
|
||||
$tobj->ipaddress = $val->commenter->ip->body;
|
||||
$tobj->list_order = $tobj->comment_srl*-1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue