mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51:41 +09:00
댓글을 관리자가 정한 수만큼 페이징을 하여 보여주도록 기능 추가. 모듈의 업데이트 필요
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3757 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
d122c1a0b4
commit
21dcd2d191
37 changed files with 490 additions and 45 deletions
|
|
@ -62,8 +62,47 @@
|
|||
function deleteModuleComments($module_srl) {
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('comment.deleteModuleComments', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$output = executeQuery('comment.deleteModuleCommentsList', $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 댓글의 모듈별 추가 확장 폼을 저장
|
||||
**/
|
||||
function procCommentAdminInsertModuleConfig() {
|
||||
// 기존 설정을 가져옴
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('comment');
|
||||
|
||||
// 대상을 구함
|
||||
$module_srl = Context::get('target_module_srl');
|
||||
|
||||
// 여러개의 모듈 일괄 설정일 경우
|
||||
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
|
||||
else $module_srl = array($module_srl);
|
||||
|
||||
$comment_config = null;
|
||||
|
||||
$comment_config->comment_count = (int)Context::get('comment_count');
|
||||
if(!$comment_config->comment_count) $comment_config->comment_count = 50;
|
||||
|
||||
for($i=0;$i<count($module_srl);$i++) {
|
||||
$srl = trim($module_srl[$i]);
|
||||
if(!$srl) continue;
|
||||
$config->module_config[$srl] = $comment_config;
|
||||
}
|
||||
|
||||
// module Controller 객체 생성하여 입력
|
||||
$oModuleController = &getController('module');
|
||||
$output = $oModuleController->insertModuleConfig('comment',$config);
|
||||
|
||||
$this->setError(-1);
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@
|
|||
// 2007. 10. 17 모듈이 삭제될때 등록된 댓글도 모두 삭제하는 트리거 추가
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after');
|
||||
|
||||
// 2008. 02. 22 모듈의 추가 설정에서 댓글 추가 설정 추가
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
|
|
@ -46,6 +49,9 @@
|
|||
|
||||
if(!$oModuleModel->getActionForward('dispCommentAdminDeclared')) return true;
|
||||
|
||||
// 2008. 02. 22 모듈의 추가 설정에서 댓글 추가 설정 추가
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -78,6 +84,10 @@
|
|||
if(!$oModuleModel->getActionForward('dispCommentAdminDeclared'))
|
||||
$oModuleController->insertActionForward('comment', 'view', 'dispCommentAdminDeclared');
|
||||
|
||||
// 2008. 02. 22 모듈의 추가 설정에서 댓글 추가 설정 추가
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -118,11 +118,11 @@
|
|||
|
||||
// 내용에서 제로보드XE만의 태그를 삭제
|
||||
$obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content);
|
||||
$obj->regdate = date("YmdHis");
|
||||
|
||||
// 세션에서 최고 관리자가 아니면 iframe, script 제거
|
||||
if($logged_info->is_admin != 'Y') $obj->content = removeHackTag($obj->content);
|
||||
|
||||
|
||||
if(!$obj->notify_message) $obj->notify_message = 'N';
|
||||
if(!$obj->is_secret) $obj->is_secret = 'N';
|
||||
|
||||
|
|
@ -130,15 +130,48 @@
|
|||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// 댓글을 입력
|
||||
$output = executeQuery('comment.insertComment', $obj);
|
||||
// 댓글 목록 부분을 먼저 입력
|
||||
$list_args->comment_srl = $obj->comment_srl;
|
||||
$list_args->document_srl = $obj->document_srl;
|
||||
$list_args->module_srl = $obj->module_srl;
|
||||
$list_args->regdate = $obj->regdate;
|
||||
|
||||
// 입력에 이상이 없으면 해당 글의 댓글 수를 올림
|
||||
// 부모댓글이 없으면 바로 데이터를 설정
|
||||
if(!$obj->parent_srl) {
|
||||
$list_args->head = $list_args->arrange = $obj->comment_srl;
|
||||
$list_args->depth = 0;
|
||||
|
||||
// 부모댓글이 있으면 부모글의 정보를 구해옴
|
||||
} else {
|
||||
// 부모댓글의 정보를 구함
|
||||
$parent_args->comment_srl = $obj->parent_srl;
|
||||
$parent_output = executeQuery('comment.getCommentListItem', $parent_args);
|
||||
|
||||
// 부모댓글이 존재하지 않으면 return
|
||||
if(!$parent_output->toBool() || !$parent_output->data) return;
|
||||
$parent = $parent_output->data;
|
||||
|
||||
$list_args->head = $parent->head;
|
||||
$list_args->depth = $parent->depth+1;
|
||||
if($list_args->depth<2) $list_args->arrange = $obj->comment_srl;
|
||||
else {
|
||||
$list_args->arrange = $parent->arrange;
|
||||
$output = executeQuery('comment.updateCommentListArrange', $list_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
}
|
||||
|
||||
$output = executeQuery('comment.insertCommentList', $list_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 댓글 본문을 입력
|
||||
$output = executeQuery('comment.insertComment', $obj);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 입력에 이상이 없으면 해당 글의 댓글 수를 올림
|
||||
if(!$manual_inserted) {
|
||||
// comment model객체 생성
|
||||
$oCommentModel = &getModel('comment');
|
||||
|
|
@ -155,6 +188,7 @@
|
|||
// 댓글의 권한을 부여
|
||||
$this->addGrant($obj->comment_srl);
|
||||
}
|
||||
|
||||
|
||||
// trigger 호출 (after)
|
||||
if($output->toBool()) {
|
||||
|
|
@ -301,6 +335,8 @@
|
|||
return $output;
|
||||
}
|
||||
|
||||
$output = executeQuery('comment.deleteCommentList', $args);
|
||||
|
||||
// 댓글 수를 구해서 업데이트
|
||||
$comment_count = $oCommentModel->getCommentCount($document_srl);
|
||||
|
||||
|
|
@ -341,9 +377,14 @@
|
|||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
if(!$oDocument->isExists() || !$oDocument->isGranted()) return new Object(-1, 'msg_not_permitted');
|
||||
|
||||
// 삭제
|
||||
// 댓글 본문 삭제
|
||||
$args->document_srl = $document_srl;
|
||||
$output = executeQuery('comment.deleteComments', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 댓글 목록 삭제
|
||||
$output = executeQuery('comment.deleteCommentsList', $args);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -158,13 +158,62 @@
|
|||
/**
|
||||
* @brief document_srl에 해당하는 문서의 댓글 목록을 가져옴
|
||||
**/
|
||||
function getCommentList($document_srl, $is_admin = false) {
|
||||
function getCommentList($document_srl, $page = 1, $is_admin = false) {
|
||||
// 해당 문서의 모듈에 해당하는 댓글 수를 구함
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
|
||||
// 문서가 존재하지 않으면 return~
|
||||
if(!$oDocument->isExists()) return;
|
||||
|
||||
// 댓글수가 없으면 return~
|
||||
if($oDocument->getCommentCount()<1) return;
|
||||
|
||||
// 정해진 댓글수에 따른 댓글 목록 구함
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
$comment_config = $this->getCommentConfig($module_srl);
|
||||
$comment_count = $comment_config->comment_count;
|
||||
if(!$comment_count) $comment_count = 50;
|
||||
|
||||
if(!$page) !$page = 1;
|
||||
|
||||
// 정해진 수에 따라 목록을 구해옴
|
||||
$args->document_srl = $document_srl;
|
||||
$args->list_count = $comment_count;
|
||||
$args->page = $page;
|
||||
$args->page_count = 10;
|
||||
$output = executeQueryArray('comment.getCommentPageList', $args);
|
||||
|
||||
// 쿼리 결과에서 오류가 생기면 그냥 return
|
||||
if(!$output->toBool()) return;
|
||||
|
||||
// 만약 구해온 결과값이 저장된 댓글수와 다르다면 기존의 데이터로 판단하고 댓글 목록 테이블에 데이터 입력
|
||||
if(!$output->data) {
|
||||
$this->fixCommentList($oDocument->get('module_srl'), $document_srl);
|
||||
$output = executeQueryArray('comment.getCommentPageList', $args);
|
||||
if(!$output->toBool()) return;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief document_srl에 해당하는 댓글 목록을 갱신
|
||||
* 정식버전 이전에 사용되던 데이터를 위한 처리
|
||||
**/
|
||||
function fixCommentList($module_srl, $document_srl) {
|
||||
// 일괄 작업이라서 lock 파일을 생성하여 중복 작업이 되지 않도록 한다
|
||||
$lock_file = "./files/cache/tmp/lock.".$document_srl;
|
||||
if(file_exists($lock_file) && filemtime($lock_file)+60*60*10<time()) return;
|
||||
FileHandler::writeFile($lock_file, '');
|
||||
|
||||
// 목록을 구함
|
||||
$args->document_srl = $document_srl;
|
||||
$args->list_order = 'list_order';
|
||||
$output = executeQuery('comment.getCommentList', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$source_list= $output->data;
|
||||
$source_list = $output->data;
|
||||
if(!is_array($source_list)) $source_list = array($source_list);
|
||||
|
||||
// 댓글를 계층형 구조로 정렬
|
||||
|
|
@ -172,26 +221,18 @@
|
|||
|
||||
$root = NULL;
|
||||
$list = NULL;
|
||||
$comment_list = array();
|
||||
|
||||
// 로그인 사용자의 경우 로그인 정보를 일단 구해 놓음
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
|
||||
// loop를 돌면서 코멘트의 계층 구조 만듬
|
||||
for($i=$comment_count-1;$i>=0;$i--) {
|
||||
$comment_srl = $source_list[$i]->comment_srl;
|
||||
$parent_srl = $source_list[$i]->parent_srl;
|
||||
$member_srl = $source_list[$i]->member_srl;
|
||||
|
||||
// OL/LI 태그를 위한 치환 처리
|
||||
//$source_list[$i]->content = preg_replace('!<(ol|ul|blockquote)>!is','<\\1 style="margin-left:40px;">',$source_list[$i]->content);
|
||||
|
||||
// url에 대해서 정규표현식으로 치환
|
||||
$source_list[$i]->content = preg_replace('!([^>^"^\'^=])(http|https|ftp|mms):\/\/([^ ^<^"^\']*)!is','$1<a href="$2://$3" onclick="window.open(this.href);return false;">$2://$3</a>',' '.$source_list[$i]->content);
|
||||
|
||||
if(!$comment_srl) continue;
|
||||
|
||||
//if($is_admin || $this->isGranted($comment_srl) || $member_srl == $logged_info->member_srl) $source_list[$i]->is_granted = true;
|
||||
|
||||
// 목록을 만듬
|
||||
$list[$comment_srl] = $source_list[$i];
|
||||
|
||||
|
|
@ -201,35 +242,48 @@
|
|||
$root->child[] = &$list[$comment_srl];
|
||||
}
|
||||
}
|
||||
$this->_arrangeComment($comment_list, $root->child, 0);
|
||||
return $comment_list;
|
||||
$this->_arrangeComment($comment_list, $root->child, 0, null);
|
||||
|
||||
// 구해진 값을 db에 입력함
|
||||
if(count($comment_list)) {
|
||||
foreach($comment_list as $comment_srl => $item) {
|
||||
$comment_args = null;
|
||||
$comment_args->comment_srl = $comment_srl;
|
||||
$comment_args->document_srl = $document_srl;
|
||||
$comment_args->head = $item->head;
|
||||
$comment_args->arrange = $item->arrange;
|
||||
$comment_args->module_srl = $module_srl;
|
||||
$comment_args->regdate = $item->regdate;
|
||||
$comment_args->depth = $item->depth;
|
||||
|
||||
executeQuery('comment.insertCommentList', $comment_args);
|
||||
}
|
||||
}
|
||||
|
||||
// 성공시 lock파일 제거
|
||||
@unlink($lock_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 댓글을 계층형으로 재배치
|
||||
**/
|
||||
function _arrangeComment(&$comment_list, $list, $depth, $set_grant = false) {
|
||||
function _arrangeComment(&$comment_list, $list, $depth, $parent = null) {
|
||||
if(!count($list)) return;
|
||||
foreach($list as $key => $val) {
|
||||
$oCommentItem = new commentItem();
|
||||
|
||||
if($parent) $val->head = $parent->head;
|
||||
else $val->head = $val->comment_srl;
|
||||
$val->arrange = count($comment_list)+1;
|
||||
|
||||
if($val->child) {
|
||||
$tmp = $val;
|
||||
$tmp->depth = $depth;
|
||||
$oCommentItem->setAttribute($tmp);
|
||||
|
||||
$comment_list[$tmp->comment_srl] = $oCommentItem;
|
||||
if($set_grant) $oCommentItem->setAccessible();
|
||||
|
||||
$this->_arrangeComment($comment_list,$val->child,$depth+1, $oCommentItem->isGranted());
|
||||
$val->depth = $depth;
|
||||
$comment_list[$val->comment_srl] = $val;
|
||||
$this->_arrangeComment($comment_list,$val->child,$depth+1, $val);
|
||||
unset($val->child);
|
||||
} else {
|
||||
$val->depth = $depth;
|
||||
$oCommentItem->setAttribute($val);
|
||||
|
||||
if($set_grant) $oCommentItem->setAccessible();
|
||||
$comment_list[$val->comment_srl] = $oCommentItem;
|
||||
$comment_list[$val->comment_srl] = $val;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -297,5 +351,25 @@
|
|||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈별 댓글 설정을 return
|
||||
**/
|
||||
function getCommentConfig($module_srl) {
|
||||
if(!$GLOBLAS['__comment_module_config__']) {
|
||||
// 선택된 모듈의 trackback설정을 가져옴
|
||||
$oModuleModel = &getModel('module');
|
||||
$GLOBLAS['__comment_module_config__'] = $oModuleModel->getModuleConfig('comment');
|
||||
}
|
||||
|
||||
$comment_config = $GLOBLAS['__comment_module_config__']->module_config[$module_srl];
|
||||
|
||||
if(!is_object($comment_config)) $comment_config = null;
|
||||
|
||||
if(!isset($comment_config->comment_count)) $comment_count->comment_count = 50;
|
||||
|
||||
return $comment_config;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
48
modules/comment/comment.view.php
Normal file
48
modules/comment/comment.view.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
/**
|
||||
* @class commentView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief comment 모듈의 view 클래스
|
||||
**/
|
||||
|
||||
class commentView extends comment {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈의 추가 설정에서 댓글 설정을 하는 form 추가
|
||||
**/
|
||||
function triggerDispCommentAdditionSetup(&$obj) {
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
$current_module_srls = Context::get('module_srls');
|
||||
|
||||
if(!$current_module_srl && !$current_module_srls) {
|
||||
// 선택된 모듈의 정보를 가져옴
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new Object();
|
||||
}
|
||||
|
||||
// 댓글 설정을 구함
|
||||
$oCommentModel = &getModel('comment');
|
||||
$comment_config = $oCommentModel->getCommentConfig($current_module_srl);
|
||||
Context::set('comment_config', $comment_config);
|
||||
|
||||
// 그룹 목록을 구함
|
||||
$oMemberModel = &getModel('member');
|
||||
$group_list = $oMemberModel->getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'comment_module_config');
|
||||
$obj .= $tpl;
|
||||
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -10,5 +10,6 @@
|
|||
<action name="procCommentDeclare" type="controller" standalone="true" />
|
||||
<action name="procCommentAdminDeleteChecked" type="controller" standalone="true" />
|
||||
<action name="procCommentAdminCancelDeclare" type="controller" standalone="true" />
|
||||
<action name="procCommentAdminInsertModuleConfig" type="controller" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@
|
|||
$lang->comment_list = 'Comments List';
|
||||
$lang->cmd_delete_checked_comment = 'Delete selected item';
|
||||
|
||||
$lang->comment_count = '댓글 수';
|
||||
$lang->about_comment_count = '댓글을 정해진 수 만큼만 표시하고 그 이상일 경우 목록으로 이동할 수 있게 합니다.';
|
||||
|
||||
$lang->msg_cart_is_null = 'Please select an article to delete';
|
||||
$lang->msg_checked_comment_is_deleted = '%d comment(s) is(are) successfully deleted.';
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@
|
|||
$lang->comment_list = 'Comentarios Lista';
|
||||
$lang->cmd_delete_checked_comment = 'Eliminar lo seleccionado' ;
|
||||
|
||||
$lang->comment_count = '댓글 수';
|
||||
$lang->about_comment_count = '댓글을 정해진 수 만큼만 표시하고 그 이상일 경우 목록으로 이동할 수 있게 합니다.';
|
||||
|
||||
$lang->msg_cart_is_null = 'Selecciona el commentario que desea eliminar';
|
||||
$lang->msg_checked_comment_is_deleted = '%d comentario eliminado correctamente.';
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@
|
|||
$lang->cmd_toggle_checked_comment = '選択項目の反転';
|
||||
$lang->cmd_delete_checked_comment = '選択項目削除';
|
||||
|
||||
$lang->comment_count = '댓글 수';
|
||||
$lang->about_comment_count = '댓글을 정해진 수 만큼만 표시하고 그 이상일 경우 목록으로 이동할 수 있게 합니다.';
|
||||
|
||||
$lang->msg_cart_is_null = '削除するコメントを選択してください。';
|
||||
$lang->msg_checked_comment_is_deleted = '%d個のコメントを削除しました。';
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@
|
|||
$lang->cmd_toggle_checked_comment = '선택항목 반전';
|
||||
$lang->cmd_delete_checked_comment = '선택항목 삭제';
|
||||
|
||||
$lang->comment_count = '댓글 수';
|
||||
$lang->about_comment_count = '댓글을 정해진 수 만큼만 표시하고 그 이상일 경우 목록으로 이동할 수 있게 합니다.';
|
||||
|
||||
$lang->msg_cart_is_null = '삭제할 글을 선택해주세요';
|
||||
$lang->msg_checked_comment_is_deleted = '%d개의 댓글이 삭제되었습니다';
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@
|
|||
$lang->comment_list = 'Список комментариев';
|
||||
$lang->cmd_delete_checked_comment = 'Удалить выбранный объект';
|
||||
|
||||
$lang->comment_count = '댓글 수';
|
||||
$lang->about_comment_count = '댓글을 정해진 수 만큼만 표시하고 그 이상일 경우 목록으로 이동할 수 있게 합니다.';
|
||||
|
||||
$lang->msg_cart_is_null = 'Пожалуйста, выберите статью для удаления.';
|
||||
$lang->msg_checked_comment_is_deleted = '%d комментарий(-ия) успешно удален(о).';
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@
|
|||
$lang->cmd_toggle_checked_comment = '反选';
|
||||
$lang->cmd_delete_checked_comment = '删除所选';
|
||||
|
||||
$lang->comment_count = '댓글 수';
|
||||
$lang->about_comment_count = '댓글을 정해진 수 만큼만 표시하고 그 이상일 경우 목록으로 이동할 수 있게 합니다.';
|
||||
|
||||
$lang->msg_cart_is_null = '请选择要删除的评论。';
|
||||
$lang->msg_checked_comment_is_deleted = '已删除%d个评论。';
|
||||
|
||||
|
|
|
|||
8
modules/comment/queries/deleteCommentList.xml
Normal file
8
modules/comment/queries/deleteCommentList.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteCommentList" action="delete">
|
||||
<tables>
|
||||
<table name="comments_list" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="comment_srl" var="comment_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
8
modules/comment/queries/deleteCommentsList.xml
Normal file
8
modules/comment/queries/deleteCommentsList.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteCommentsList" action="delete">
|
||||
<tables>
|
||||
<table name="comments_list" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
8
modules/comment/queries/deleteModuleCommentsList.xml
Normal file
8
modules/comment/queries/deleteModuleCommentsList.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteModuleCommentsList" action="delete">
|
||||
<tables>
|
||||
<table name="comments_list" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -3,7 +3,9 @@
|
|||
<table name="comments" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
<column name="comment_srl" />
|
||||
<column name="parent_srl" />
|
||||
<column name="regdate" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
|
|
|
|||
11
modules/comment/queries/getCommentListItem.xml
Normal file
11
modules/comment/queries/getCommentListItem.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getCommentListItem" action="select">
|
||||
<tables>
|
||||
<table name="comments_list" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="comment_srl" var="comment_srl" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
21
modules/comment/queries/getCommentPageList.xml
Normal file
21
modules/comment/queries/getCommentPageList.xml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<query id="getCommentPageList" action="select">
|
||||
<tables>
|
||||
<table name="comments" alias="comments" />
|
||||
<table name="comments_list" alias="comments_list" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="comments.*" />
|
||||
<column name="depth" alias="depth" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="comments_list.document_srl" var="document_srl" notnull="notnull" pipe="and" />
|
||||
<condition operation="equal" column="comments_list.comment_srl" var="comments.comment_srl" filter="number" pipe="and" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="head" order="asc" />
|
||||
<index var="sort_index" default="arrange" order="asc" />
|
||||
<list_count var="list_count" default="list_count" />
|
||||
<page_count var="page_count" default="10" />
|
||||
<page var="page" default="1" />
|
||||
</navigation>
|
||||
</query>
|
||||
14
modules/comment/queries/insertCommentList.xml
Normal file
14
modules/comment/queries/insertCommentList.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<query id="insertCommentList" action="insert">
|
||||
<tables>
|
||||
<table name="comments_list" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="comment_srl" var="comment_srl" notnull="notnull" />
|
||||
<column name="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
<column name="head" var="head" filter="number" />
|
||||
<column name="arrange" var="arrange" filter="number" />
|
||||
<column name="module_srl" var="module_srl" filter="number" notnull="notnull" />
|
||||
<column name="regdate" var="regdate" />
|
||||
<column name="depth" var="depth" filter="number" />
|
||||
</columns>
|
||||
</query>
|
||||
13
modules/comment/queries/updateCommentListArrange.xml
Normal file
13
modules/comment/queries/updateCommentListArrange.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<query id="updateCommentListArrange" action="update">
|
||||
<tables>
|
||||
<table name="comments_list" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="arrange" default="plus(1)" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
<condition operation="equal" column="head" var="head" filter="number" notnull="notnull" pipe="and" />
|
||||
<condition operation="excess" column="arrange" var="arrange" filter="number" notnull="notnull" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
11
modules/comment/queries/updateCommentListModule.xml
Normal file
11
modules/comment/queries/updateCommentListModule.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="updateCommentListModule" action="update">
|
||||
<tables>
|
||||
<table name="comments_list" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="module_srl" var="module_srl" filter="number" default="0" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="document_srl" var="document_srls" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
9
modules/comment/schemas/comments_list.xml
Normal file
9
modules/comment/schemas/comments_list.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<table name="comments_list">
|
||||
<column name="comment_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="document_srl" type="number" size="11" default="0" notnull="notnull" index="idx_list" />
|
||||
<column name="head" type="number" size="11" default="0" notnull="notnull" index="idx_list" />
|
||||
<column name="arrange" type="number" size="11" default="0" notnull="notnull" index="idx_list" />
|
||||
<column name="module_srl" type="number" size="11" default="0" notnull="notnull" index="idx_date" />
|
||||
<column name="regdate" type="date" index="idx_date" />
|
||||
<column name="depth" type="number" size="11" default="0" notnull="notnull" />
|
||||
</table>
|
||||
27
modules/comment/tpl/comment_module_config.html
Normal file
27
modules/comment/tpl/comment_module_config.html
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<!--%import("filter/insert_comment_module_config.xml")-->
|
||||
|
||||
<form action="./" method="post" onsubmit="return procFilter(this, insert_comment_module_config)">
|
||||
<input type="hidden" name="target_module_srl" value="{$module_info->module_srl?$module_info->module_srl:$module_srls}" />
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<col width="150" />
|
||||
<col />
|
||||
<caption>{$lang->comment}</caption>
|
||||
<tr>
|
||||
<th rowspan="2">{$lang->comment_count}</th>
|
||||
<td>
|
||||
<input type="text" name="comment_count" value="{$comment_config->comment_count}" class="inputTypeText w80" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{$lang->about_comment_count}</td>
|
||||
<tr>
|
||||
<th class="button" colspan="2">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_save}"/></span>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
<div class="gap1"></div>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<filter name="insert_comment_module_config" module="comment" act="procCommentAdminInsertModuleConfig" confirm_msg_code="confirm_submit">
|
||||
<form />
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
Loading…
Add table
Add a link
Reference in a new issue