mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-20 19:59:54 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@864 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
5a2be2d812
commit
35b9bb8fd2
28 changed files with 186 additions and 485 deletions
|
|
@ -47,9 +47,6 @@
|
|||
* @brief 문서 입력
|
||||
**/
|
||||
function insertDocument($obj) {
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 기본 변수들 정리
|
||||
if($obj->is_secret!='Y') $obj->is_secret = 'N';
|
||||
if($obj->allow_comment!='Y') $obj->allow_comment = 'N';
|
||||
|
|
@ -98,7 +95,7 @@
|
|||
}
|
||||
|
||||
// DB에 입력
|
||||
$output = $oDB->executeQuery('document.insertDocument', $obj);
|
||||
$output = executeQuery('document.insertDocument', $obj);
|
||||
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
|
@ -120,8 +117,6 @@
|
|||
* @brief 문서 수정
|
||||
**/
|
||||
function updateDocument($source_obj, $obj) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 기본 변수들 정리
|
||||
if($obj->is_secret!='Y') $obj->is_secret = 'N';
|
||||
if($obj->allow_comment!='Y') $obj->allow_comment = 'N';
|
||||
|
|
@ -154,7 +149,7 @@
|
|||
}
|
||||
|
||||
// 수정
|
||||
$obj->update_order = $oDB->getNextSequence() * -1;
|
||||
$obj->update_order = getNextSequence() * -1;
|
||||
|
||||
// 공지사항일 경우 list_order에 무지막지한 값을, 그렇지 않으면 document_srl*-1값을
|
||||
if($obj->is_notice=='Y') $obj->list_order = $this->notice_list_order;
|
||||
|
|
@ -184,7 +179,7 @@
|
|||
}
|
||||
|
||||
// DB에 입력
|
||||
$output = $oDB->executeQuery('document.updateDocument', $obj);
|
||||
$output = executeQuery('document.updateDocument', $obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 성공하였을 경우 category_srl이 있으면 카테고리 update
|
||||
|
|
@ -216,11 +211,9 @@
|
|||
// 권한이 있는지 확인
|
||||
if(!$document->is_granted&&!$is_admin) return new Object(-1, 'msg_not_permitted');
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 글 삭제
|
||||
$args->document_srl = $document_srl;
|
||||
$output = $oDB->executeQuery('document.deleteDocument', $args);
|
||||
$output = executeQuery('document.deleteDocument', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 댓글 삭제
|
||||
|
|
@ -251,10 +244,8 @@
|
|||
* @brief 특정 모듈의 전체 문서 삭제
|
||||
**/
|
||||
function deleteModuleDocument($module_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->module_srl = $module_srl;
|
||||
$output = $oDB->executeQuery('document.deleteModuleDocument', $args);
|
||||
$output = executeQuery('document.deleteModuleDocument', $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -286,9 +277,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 로그인 사용자이면 member_srl, 비회원이면 ipaddress로 판단
|
||||
if($member_srl) {
|
||||
$args->member_srl = $member_srl;
|
||||
|
|
@ -296,16 +284,16 @@
|
|||
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
$args->document_srl = $document_srl;
|
||||
$output = $oDB->executeQuery('document.getDocumentReadedLogInfo', $args);
|
||||
$output = executeQuery('document.getDocumentReadedLogInfo', $args);
|
||||
|
||||
// 로그 정보에 조회 로그가 있으면 세션 등록후 패스
|
||||
if($output->data->count) return $_SESSION['readed_document'][$document_srl] = true;
|
||||
|
||||
// 조회수 업데이트
|
||||
$output = $oDB->executeQuery('document.updateReadedCount', $args);
|
||||
$output = executeQuery('document.updateReadedCount', $args);
|
||||
|
||||
// 로그 남기기
|
||||
$output = $oDB->executeQuery('document.insertDocumentReadedLog', $args);
|
||||
$output = executeQuery('document.insertDocumentReadedLog', $args);
|
||||
|
||||
// 세션 정보에 남김
|
||||
return $_SESSION['readed_document'][$document_srl] = true;
|
||||
|
|
@ -341,9 +329,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 로그인 사용자이면 member_srl, 비회원이면 ipaddress로 판단
|
||||
if($member_srl) {
|
||||
$args->member_srl = $member_srl;
|
||||
|
|
@ -351,7 +336,7 @@
|
|||
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
$args->document_srl = $document_srl;
|
||||
$output = $oDB->executeQuery('document.getDocumentVotedLogInfo', $args);
|
||||
$output = executeQuery('document.getDocumentVotedLogInfo', $args);
|
||||
|
||||
// 로그 정보에 추천 로그가 있으면 세션 등록후 패스
|
||||
if($output->data->count) {
|
||||
|
|
@ -360,10 +345,10 @@
|
|||
}
|
||||
|
||||
// 추천수 업데이트
|
||||
$output = $oDB->executeQuery('document.updateVotedCount', $args);
|
||||
$output = executeQuery('document.updateVotedCount', $args);
|
||||
|
||||
// 로그 남기기
|
||||
$output = $oDB->executeQuery('document.insertDocumentVotedLog', $args);
|
||||
$output = executeQuery('document.insertDocumentVotedLog', $args);
|
||||
|
||||
// 세션 정보에 남김
|
||||
$_SESSION['voted_document'][$document_srl] = true;
|
||||
|
|
@ -376,46 +361,39 @@
|
|||
* @brief 해당 document의 댓글 수 증가
|
||||
**/
|
||||
function updateCommentCount($document_srl, $comment_count) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->document_srl = $document_srl;
|
||||
$args->comment_count = $comment_count;
|
||||
|
||||
return $oDB->executeQuery('document.updateCommentCount', $args);
|
||||
return executeQuery('document.updateCommentCount', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 해당 document의 엮인글 수증가
|
||||
**/
|
||||
function updateTrackbackCount($document_srl, $trackback_count) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->document_srl = $document_srl;
|
||||
$args->trackback_count = $trackback_count;
|
||||
|
||||
return $oDB->executeQuery('document.updateTrackbackCount', $args);
|
||||
return executeQuery('document.updateTrackbackCount', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카테고리 추가
|
||||
**/
|
||||
function insertCategory($module_srl, $title) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->list_order = $args->category_srl = $oDB->getNextSequence();
|
||||
$args->list_order = $args->category_srl = getNextSequence();
|
||||
$args->module_srl = $module_srl;
|
||||
$args->title = $title;
|
||||
$args->document_count = 0;
|
||||
|
||||
return $oDB->executeQuery('document.insertCategory', $args);
|
||||
return executeQuery('document.insertCategory', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카테고리 정보 수정
|
||||
**/
|
||||
function updateCategory($args) {
|
||||
$oDB = &DB::getInstance();
|
||||
return $oDB->executeQuery('document.updateCategory', $args);
|
||||
return executeQuery('document.updateCategory', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -426,23 +404,19 @@
|
|||
$oDocumentModel = &getModel('document');
|
||||
if(!$document_count) $document_count = $oDocumentModel->getCategoryDocumentCount($category_srl);
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->category_srl = $category_srl;
|
||||
$args->document_count = $document_count;
|
||||
return $oDB->executeQuery('document.updateCategoryCount', $args);
|
||||
return executeQuery('document.updateCategoryCount', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카테고리 삭제
|
||||
**/
|
||||
function deleteCategory($category_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->category_srl = $category_srl;
|
||||
|
||||
// 카테고리 정보를 삭제
|
||||
$output = $oDB->executeQuery('document.deleteCategory', $args);
|
||||
$output = executeQuery('document.deleteCategory', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 현 카테고리 값을 가지는 문서들의 category_srl을 0 으로 세팅
|
||||
|
|
@ -450,7 +424,7 @@
|
|||
|
||||
$args->target_category_srl = 0;
|
||||
$args->source_category_srl = $category_srl;
|
||||
$output = $oDB->executeQuery('document.updateDocumentCategory', $args);
|
||||
$output = executeQuery('document.updateDocumentCategory', $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -458,10 +432,8 @@
|
|||
* @brief 특정 모듈의 카테고리를 모두 삭제
|
||||
**/
|
||||
function deleteModuleCategory($module_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->module_srl = $module_srl;
|
||||
$output = $oDB->executeQuery('document.deleteModuleCategory', $args);
|
||||
$output = executeQuery('document.deleteModuleCategory', $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -469,12 +441,11 @@
|
|||
* @brief 카테고리를 상단으로 이동
|
||||
**/
|
||||
function moveCategoryUp($category_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 선택된 카테고리의 정보를 구한다
|
||||
$args->category_srl = $category_srl;
|
||||
$output = $oDB->executeQuery('document.getCategory', $args);
|
||||
$output = executeQuery('document.getCategory', $args);
|
||||
|
||||
$category = $output->data;
|
||||
$list_order = $category->list_order;
|
||||
|
|
@ -516,12 +487,11 @@
|
|||
* @brief 카테고리를 아래로 이동
|
||||
**/
|
||||
function moveCategoryDown($category_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 선택된 카테고리의 정보를 구한다
|
||||
$args->category_srl = $category_srl;
|
||||
$output = $oDB->executeQuery('document.getCategory', $args);
|
||||
$output = executeQuery('document.getCategory', $args);
|
||||
|
||||
$category = $output->data;
|
||||
$list_order = $category->list_order;
|
||||
|
|
|
|||
|
|
@ -25,9 +25,8 @@
|
|||
**/
|
||||
function getDocument($document_srl, $is_admin=false, $get_extra_info=false) {
|
||||
// DB에서 가져옴
|
||||
$oDB = &DB::getInstance();
|
||||
$args->document_srl = $document_srl;
|
||||
$output = $oDB->executeQuery('document.getDocument', $args);
|
||||
$output = executeQuery('document.getDocument', $args);
|
||||
$document = $output->data;
|
||||
if(!$document) return;
|
||||
|
||||
|
|
@ -83,9 +82,8 @@
|
|||
if(is_array($document_srl_list)) $document_srls = implode(',',$document_srl_list);
|
||||
|
||||
// DB에서 가져옴
|
||||
$oDB = &DB::getInstance();
|
||||
$args->document_srls = $document_srls;
|
||||
$output = $oDB->executeQuery('document.getDocuments', $args);
|
||||
$output = executeQuery('document.getDocuments', $args);
|
||||
$document_list = $output->data;
|
||||
if(!$document_list) return;
|
||||
|
||||
|
|
@ -113,9 +111,6 @@
|
|||
**/
|
||||
function getDocumentList($obj) {
|
||||
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
if(!in_array($obj->sort_index, array('list_order', 'update_order'))) $obj->sort_index = 'list_order';
|
||||
|
||||
// module_srl 대신 mid가 넘어왔을 경우는 직접 module_srl을 구해줌
|
||||
|
|
@ -215,7 +210,7 @@
|
|||
}
|
||||
|
||||
// document.getDocumentList 쿼리 실행
|
||||
$output = $oDB->executeQuery($query_id, $args);
|
||||
$output = executeQuery($query_id, $args);
|
||||
|
||||
// 결과가 없거나 오류 발생시 그냥 return
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
|
|
@ -239,9 +234,6 @@
|
|||
* @brief module_srl에 해당하는 문서의 전체 갯수를 가져옴
|
||||
**/
|
||||
function getDocumentCount($module_srl, $search_obj = NULL) {
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 검색 옵션 추가
|
||||
$args->module_srl = $module_srl;
|
||||
$args->s_title = $search_obj->s_title;
|
||||
|
|
@ -252,7 +244,7 @@
|
|||
$args->s_regdate = $search_obj->s_regdate;
|
||||
$args->category_srl = $search_obj->category_srl;
|
||||
|
||||
$output = $oDB->executeQuery('document.getDocumentCount', $args);
|
||||
$output = executeQuery('document.getDocumentCount', $args);
|
||||
|
||||
// 전체 갯수를 return
|
||||
$total_count = $output->data->count;
|
||||
|
|
@ -262,15 +254,12 @@
|
|||
* @brief 해당 document의 page 가져오기, module_srl이 없으면 전체에서..
|
||||
**/
|
||||
function getDocumentPage($document_srl, $module_srl=0, $list_count) {
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 변수 설정
|
||||
$args->document_srl = $document_srl;
|
||||
$args->module_srl = $module_srl;
|
||||
|
||||
// 전체 갯수를 구한후 해당 글의 페이지를 검색
|
||||
$output = $oDB->executeQuery('document.getDocumentPage', $args);
|
||||
$output = executeQuery('document.getDocumentPage', $args);
|
||||
$count = $output->data->count;
|
||||
$page = (int)(($count-1)/$list_count)+1;
|
||||
return $page;
|
||||
|
|
@ -280,10 +269,8 @@
|
|||
* @brief 카테고리의 정보를 가져옴
|
||||
**/
|
||||
function getCategory($category_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->category_srl = $category_srl;
|
||||
$output = $oDB->executeQuery('document.getCategory', $args);
|
||||
$output = executeQuery('document.getCategory', $args);
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
|
|
@ -291,11 +278,9 @@
|
|||
* @brief 특정 모듈의 카테고리 목록을 가져옴
|
||||
**/
|
||||
function getCategoryList($module_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->module_srl = $module_srl;
|
||||
$args->sort_index = 'list_order';
|
||||
$output = $oDB->executeQuery('document.getCategoryList', $args);
|
||||
$output = executeQuery('document.getCategoryList', $args);
|
||||
|
||||
$category_list = $output->data;
|
||||
|
||||
|
|
@ -314,10 +299,8 @@
|
|||
* @brief 카테고리에 속한 문서의 갯수를 구함
|
||||
**/
|
||||
function getCategoryDocumentCount($category_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->category_srl = $category_srl;
|
||||
$output = $oDB->executeQuery('document.getCategoryDocumentCount', $args);
|
||||
$output = executeQuery('document.getCategoryDocumentCount', $args);
|
||||
return (int)$output->data->count;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,9 +39,8 @@
|
|||
if(!in_array($module_srl, $module_srl_list)) $module_srl_list[] = $module_srl;
|
||||
}
|
||||
if(count($module_srl_list)) {
|
||||
$oDB = &DB::getInstance();
|
||||
$args->module_srls = implode(',',$module_srl_list);
|
||||
$mid_output = $oDB->executeQuery('module.getModuleInfoByModuleSrl', $args);
|
||||
$mid_output = executeQuery('module.getModuleInfoByModuleSrl', $args);
|
||||
if($mid_output->data && !is_array($mid_output->data)) $mid_output->data = array($mid_output->data);
|
||||
for($i=0;$i<count($mid_output->data);$i++) {
|
||||
$mid_info = $mid_output->data[$i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue