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/trunk@123 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
242b24d369
commit
756ecc1423
28 changed files with 197 additions and 153 deletions
|
|
@ -21,7 +21,7 @@
|
|||
$password = Context::get('password');
|
||||
|
||||
// member controller 객체 생성
|
||||
$oMemberController = getController('member');
|
||||
$oMemberController = &getController('member');
|
||||
return $oMemberController->doLogin($user_id, $password);
|
||||
}
|
||||
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
**/
|
||||
function procLogout() {
|
||||
// member controller 객체 생성
|
||||
$oMemberController = getController('member');
|
||||
$oMemberController = &getController('member');
|
||||
return $oMemberController->doLogout();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,18 +13,5 @@
|
|||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 경로를 return
|
||||
**/
|
||||
function getLayoutPath() {
|
||||
return $this->template_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 파일을 return
|
||||
**/
|
||||
function getLayoutTpl() {
|
||||
return "layout.html";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@
|
|||
**/
|
||||
function init() {
|
||||
// 관리자 모듈 목록을 세팅
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_list = $oModuleModel->getAdminModuleList();
|
||||
Context::set('module_list', $module_list);
|
||||
|
||||
// 접속 사용자에 대한 체크
|
||||
$oMemberModel = getModel('member');
|
||||
$oMemberModel = &getModel('member');
|
||||
$logged_info = $oMemberModel->getLoggedInfo();
|
||||
|
||||
// 로그인 하지 않았다면 로그인 폼 출력
|
||||
|
|
@ -30,9 +30,8 @@
|
|||
}
|
||||
|
||||
// 관리자용 레이아웃으로 변경
|
||||
$this->setLayoutPath($this->getLayoutPath());
|
||||
$this->setLayoutTpl($this->getLayoutTpl());
|
||||
|
||||
//$this->setLayoutPath($this->getLayoutPath());
|
||||
//$this->setLayoutTpl($this->getLayoutTpl());
|
||||
|
||||
// 로그인/로그아웃 act의 경우는 패스~
|
||||
if(in_array($this->act, array('procLogin', 'procLogout'))) return true;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
$password = Context::get('password');
|
||||
|
||||
// member모듈 controller 객체 생성
|
||||
$oMemberController = getController('member');
|
||||
$oMemberController = &getController('member');
|
||||
return $oMemberController->doLogin($user_id, $password);
|
||||
}
|
||||
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
**/
|
||||
function procLogout() {
|
||||
// member모듈 controller 객체 생성
|
||||
$oMemberController = getController('member');
|
||||
$oMemberController = &getController('member');
|
||||
return $oMemberController->doLogout();
|
||||
}
|
||||
|
||||
|
|
@ -47,10 +47,10 @@
|
|||
if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N';
|
||||
|
||||
// document module의 model 객체 생성
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// document module의 controller 객체 생성
|
||||
$oDocumentController = getController('document');
|
||||
$oDocumentController = &getController('document');
|
||||
|
||||
// 이미 존재하는 글인지 체크
|
||||
$document = $oDocumentModel->getDocument($obj->document_srl);
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
$trackback_url = Context::get('trackback_url');
|
||||
$trackback_charset = Context::get('trackback_charset');
|
||||
if($trackback_url) {
|
||||
$oTrackbackController = getController('trackback');
|
||||
$oTrackbackController = &getController('trackback');
|
||||
$oTrackbackController->sendTrackback($obj, $trackback_url, $trackback_charset);
|
||||
}
|
||||
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
if(!$document_srl) return $this->doError('msg_invalid_document');
|
||||
|
||||
// document module model 객체 생성
|
||||
$oDocumentController = getController('document');
|
||||
$oDocumentController = &getController('document');
|
||||
|
||||
// 삭제 시도
|
||||
$output = $oDocumentController->deleteDocument($document_srl);
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
**/
|
||||
function procVoteDocument() {
|
||||
// document module controller 객체 생성
|
||||
$oDocumentController = getController('document');
|
||||
$oDocumentController = &getController('document');
|
||||
|
||||
$document_srl = Context::get('document_srl');
|
||||
return $oDocumentController->updateVotedCount($document_srl);
|
||||
|
|
@ -121,10 +121,10 @@
|
|||
$obj->module_srl = $this->module_srl;
|
||||
|
||||
// comment 모듈의 model 객체 생성
|
||||
$oCommentModel = getModel('comment');
|
||||
$oCommentModel = &getModel('comment');
|
||||
|
||||
// comment 모듈의 controller 객체 생성
|
||||
$oCommentController = getController('comment');
|
||||
$oCommentController = &getController('comment');
|
||||
|
||||
// comment_srl이 없을 경우 신규 입력
|
||||
if(!$obj->comment_srl) {
|
||||
|
|
@ -171,7 +171,7 @@
|
|||
|
||||
// 삭제
|
||||
// comment 모듈의 controller 객체 생성
|
||||
$oCommentController = getController('comment');
|
||||
$oCommentController = &getController('comment');
|
||||
|
||||
$output = $oCommentController->deleteComment($comment_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -189,7 +189,7 @@
|
|||
$obj = Context::gets('document_srl','url','title','excerpt');
|
||||
|
||||
// trackback module의 controller 객체 생성
|
||||
$oTrackbackController = getController('trackback');
|
||||
$oTrackbackController = &getController('trackback');
|
||||
$oTrackbackController->insertTrackback($obj);
|
||||
}
|
||||
|
||||
|
|
@ -200,7 +200,7 @@
|
|||
$trackback_srl = Context::get('trackback_srl');
|
||||
|
||||
// trackback module의 controller 객체 생성
|
||||
$oTrackbackController = getController('trackback');
|
||||
$oTrackbackController = &getController('trackback');
|
||||
$output = $oTrackbackController->deleteTrackback($trackback_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
|
@ -222,12 +222,12 @@
|
|||
// comment_srl이 있을 경우 댓글이 대상
|
||||
if($comment_srl) {
|
||||
// 문서번호에 해당하는 글이 있는지 확인
|
||||
$oCommentModel = getModel('comment');
|
||||
$oCommentModel = &getModel('comment');
|
||||
$data = $oCommentModel->getComment($comment_srl);
|
||||
// comment_srl이 없으면 문서가 대상
|
||||
} else {
|
||||
// 문서번호에 해당하는 글이 있는지 확인
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
$data = $oDocumentModel->getDocument($document_srl);
|
||||
}
|
||||
|
||||
|
|
@ -239,11 +239,11 @@
|
|||
|
||||
// 해당 글에 대한 권한 부여
|
||||
if($comment_srl) {
|
||||
$oCommentController = getController('comment');
|
||||
$oCommentController = &getController('comment');
|
||||
$oCommentController->addGrant($comment_srl);
|
||||
} else {
|
||||
$_SESSION['own_document'][$document_srl] = true;
|
||||
$oDocumentController = getController('document');
|
||||
$oDocumentController = &getController('document');
|
||||
$oDocumentController->addGrant($document_srl);
|
||||
}
|
||||
}
|
||||
|
|
@ -259,7 +259,7 @@
|
|||
$file_srl = Context::get('file_srl');
|
||||
|
||||
// file class의 controller 객체 생성
|
||||
$oFileController = getController('file');
|
||||
$oFileController = &getController('file');
|
||||
$output = $oFileController->deleteFile($file_srl);
|
||||
|
||||
// 첨부파일의 목록을 java script로 출력
|
||||
|
|
@ -275,7 +275,7 @@
|
|||
$module_srl = $this->module_srl;
|
||||
|
||||
// file class의 controller 객체 생성
|
||||
$oFileController = getController('file');
|
||||
$oFileController = &getController('file');
|
||||
$output = $oFileController->insertFile($module_srl, $document_srl);
|
||||
|
||||
// 첨부파일의 목록을 java script로 출력
|
||||
|
|
@ -294,7 +294,7 @@
|
|||
$sid = Context::get('sid');
|
||||
|
||||
// document module 객체 생성후 해당 파일의 정보를 체크
|
||||
$oFileModel = getModel('file');
|
||||
$oFileModel = &getModel('file');
|
||||
$oFileModel->procDownload($file_srl, $sid);
|
||||
}
|
||||
|
||||
|
|
@ -308,12 +308,12 @@
|
|||
$document_srl = Context::get('document_srl');
|
||||
|
||||
// document_srl의 글이 등록되어 있다면 pass
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
$data = $oDocumentModel->getDocument($document_srl);
|
||||
if($data) exit();
|
||||
|
||||
// 등록되어 있지 않다면 첨부파일 삭제
|
||||
$oFileController = getController('file');
|
||||
$oFileController = &getController('file');
|
||||
$oFileController->deleteFiles($this->module_srl, $document_srl);
|
||||
}
|
||||
|
||||
|
|
@ -324,7 +324,7 @@
|
|||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// 현 모듈의 권한 목록을 가져옴
|
||||
$oBoardView = getModule('view');
|
||||
$oBoardView = &getModule('view');
|
||||
$grant_list = $oBoardView->grant_list;
|
||||
|
||||
if(count($grant_list)) {
|
||||
|
|
@ -335,7 +335,7 @@
|
|||
$grant = serialize($arr_grant);
|
||||
}
|
||||
|
||||
$oModule = getModule('module_manager');
|
||||
$oModule = &getModule('module_manager');
|
||||
$oModule->updateModuleGrant($module_srl, $grant);
|
||||
|
||||
$this->add('sid','board');
|
||||
|
|
@ -351,12 +351,12 @@
|
|||
function procUpdateSkinInfo() {
|
||||
// module_srl에 해당하는 정보들을 가져오기
|
||||
$module_srl = Context::get('module_srl');
|
||||
$oModule = getModule('module_manager');
|
||||
$oModule = &getModule('module_manager');
|
||||
$module_info = $oModule->getModuleInfoByModuleSrl($module_srl);
|
||||
$skin = $module_info->skin;
|
||||
|
||||
// 스킨의 정볼르 구해옴 (extra_vars를 체크하기 위해서)
|
||||
$oModule = getModule('module_manager');
|
||||
$oModule = &getModule('module_manager');
|
||||
$skin_info = $oModule->loadSkinInfo($this->module_path, $skin);
|
||||
|
||||
// 입력받은 변수들을 체크 (sid, act, module_srl, page등 기본적인 변수들 없앰)
|
||||
|
|
@ -422,7 +422,7 @@
|
|||
// serialize하여 저장
|
||||
$extra_vars = serialize($obj);
|
||||
|
||||
$oModule = getModule('module_manager');
|
||||
$oModule = &getModule('module_manager');
|
||||
$oModule->updateModuleExtraVars($module_srl, $extra_vars);
|
||||
|
||||
$url = sprintf("./admin.php?sid=%s&module_srl=%s&act=dispSkinInfo&page=%s", 'board', $module_srl, Context::get('page'));
|
||||
|
|
@ -447,7 +447,7 @@
|
|||
unset($extra_var->page);
|
||||
|
||||
// module_srl이 있으면 원본을 구해온다
|
||||
$oModule = getModule('module_manager');
|
||||
$oModule = &getModule('module_manager');
|
||||
|
||||
// module_srl이 넘어오면 원 모듈이 있는지 확인
|
||||
if($args->module_srl) {
|
||||
|
|
@ -487,7 +487,7 @@
|
|||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// 원본을 구해온다
|
||||
$oModule = getModule('module_manager');
|
||||
$oModule = &getModule('module_manager');
|
||||
$output = $oModule->deleteModule($module_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
|
@ -506,7 +506,7 @@
|
|||
$category_title = Context::get('category_title');
|
||||
|
||||
// module_srl이 있으면 원본을 구해온다
|
||||
$oDocument = getModule('document');
|
||||
$oDocument = &getModule('document');
|
||||
$output = $oDocument->insertCategory($module_srl, $category_title);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
|
@ -524,7 +524,7 @@
|
|||
$category_srl = Context::get('category_srl');
|
||||
$mode = Context::get('mode');
|
||||
|
||||
$oDocument = getModule('document');
|
||||
$oDocument = &getModule('document');
|
||||
|
||||
switch($mode) {
|
||||
case 'up' :
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
function init() {
|
||||
// 카테고리를 사용한다면 카테고리 목록을 구해옴
|
||||
if($this->module_info->use_category=='Y') {
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
$this->category_list = $oDocumentModel->getCategoryList($this->module_srl);
|
||||
Context::set('category_list', $this->category_list);
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
$page = Context::get('page');
|
||||
|
||||
// document 객체를 생성. 기본 데이터 구조의 경우 document모듈만 쓰면 만사 해결.. -_-;
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// document_srl이 있다면 해당 글을 구해오자
|
||||
if($this->grant->view && $document_srl) {
|
||||
|
|
@ -68,14 +68,14 @@
|
|||
|
||||
// 댓글 가져오기
|
||||
if($document->comment_count && $document->allow_comment == 'Y') {
|
||||
$oCommentModel = getModel('comment');
|
||||
$oCommentModel = &getModel('comment');
|
||||
$comment_list = $oCommentModel->getCommentList($document_srl);
|
||||
Context::set('comment_list', $comment_list);
|
||||
}
|
||||
|
||||
// 트랙백 가져오기
|
||||
if($document->trackback_count && $document->allow_trackback == 'Y') {
|
||||
$oTrackback = getModule('trackback');
|
||||
$oTrackback = &getModule('trackback');
|
||||
$trackback_list = $oTrackback->getTrackbackList($document_srl);
|
||||
Context::set('trackback_list', $trackback_list);
|
||||
}
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
if($category) $search_obj->category_srl = $category;
|
||||
|
||||
// 목록의 경우 document->getDocumentList 에서 걍 알아서 다 해버리는 구조이다... (아.. 이거 나쁜 버릇인데.. ㅡ.ㅜ 어쩔수 없다)
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
$output = $oDocumentModel->getDocumentList($this->module_srl, 'list_order', $page, $this->list_count, $this->page_count, $search_obj);
|
||||
|
||||
// 템플릿에 쓰기 위해서 context::set
|
||||
|
|
@ -153,7 +153,7 @@
|
|||
$document_srl = Context::get('document_srl');
|
||||
|
||||
// document 모듈 객체 생성
|
||||
$oDocument = getModule('document');
|
||||
$oDocument = &getModule('document');
|
||||
|
||||
// 지정된 글이 없다면 (신규) 새로운 번호를 만든다
|
||||
if(!$document_srl) {
|
||||
|
|
@ -190,7 +190,7 @@
|
|||
|
||||
// 지정된 글이 있는지 확인
|
||||
if($document_srl) {
|
||||
$oDocument = getModule('document');
|
||||
$oDocument = &getModule('document');
|
||||
$document = $oDocument->getDocument($document_srl);
|
||||
}
|
||||
|
||||
|
|
@ -220,7 +220,7 @@
|
|||
if(!$parent_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
// 해당 댓글를 찾아본다
|
||||
$oComment = getModule('comment');
|
||||
$oComment = &getModule('comment');
|
||||
$source_comment = $oComment->getComment($parent_srl);
|
||||
|
||||
// 댓글이 없다면 오류
|
||||
|
|
@ -250,7 +250,7 @@
|
|||
if(!$comment_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
// 해당 댓글를 찾아본다
|
||||
$oComment = getModule('comment');
|
||||
$oComment = &getModule('comment');
|
||||
$comment = $oComment->getComment($comment_srl);
|
||||
|
||||
// 댓글이 없다면 오류
|
||||
|
|
@ -279,7 +279,7 @@
|
|||
|
||||
// 삭제하려는 댓글가 있는지 확인
|
||||
if($comment_srl) {
|
||||
$oComment = getModule('comment');
|
||||
$oComment = &getModule('comment');
|
||||
$comment = $oComment->getComment($comment_srl);
|
||||
}
|
||||
|
||||
|
|
@ -329,7 +329,7 @@
|
|||
$trackback_srl = Context::get('trackback_srl');
|
||||
|
||||
// 삭제하려는 댓글가 있는지 확인
|
||||
$oTrackback = getModule('trackback');
|
||||
$oTrackback = &getModule('trackback');
|
||||
$output = $oTrackback->getTrackback($trackback_srl);
|
||||
$trackback = $output->data;
|
||||
|
||||
|
|
@ -358,14 +358,13 @@
|
|||
$info->link = sprintf("%s?mid=%s", Context::getRequestUri(), Context::get('mid'));
|
||||
|
||||
// 컨텐츠 추출
|
||||
$oDocument = getModule('document');
|
||||
$oDocument = &getModule('document');
|
||||
$output = $oDocument->getDocumentList($this->module_srl, 'update_order', $page, 20, 20, NULL);
|
||||
$document_list = $output->data;
|
||||
|
||||
// 출력하고 끝내기
|
||||
$oRss = getModule('rss');
|
||||
$oRss->printRssDocument($info, $document_list);
|
||||
exit();
|
||||
$oRss = &getView('rss');
|
||||
$oRss->dispRss($info, $document_list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -375,7 +374,7 @@
|
|||
// module_srl이 있으면 미리 체크하여 존재하는 모듈이면 module_info 세팅
|
||||
$module_srl = Context::get('module_srl');
|
||||
if($module_srl) {
|
||||
$oModule = getModule('module_manager');
|
||||
$oModule = &getModule('module_manager');
|
||||
$module_info = $oModule->getModuleInfoByModuleSrl($module_srl);
|
||||
if(!$module_info) {
|
||||
Context::set('module_srl','');
|
||||
|
|
@ -428,7 +427,7 @@
|
|||
|
||||
$module_info = Context::get('module_info');
|
||||
|
||||
$oDocument = getModule('document');
|
||||
$oDocument = &getModule('document');
|
||||
$document_count = $oDocument->getDocumentCount($module_info->module_srl);
|
||||
$module_info->document_count = $document_count;
|
||||
|
||||
|
|
@ -446,7 +445,7 @@
|
|||
$module_info = Context::get('module_info');
|
||||
$skin = $module_info->skin;
|
||||
|
||||
$oModule = getModule('module_manager');
|
||||
$oModule = &getModule('module_manager');
|
||||
$skin_info = $oModule->loadSkinInfo($this->module_path, $skin);
|
||||
|
||||
// skin_info에 extra_vars 값을 지정
|
||||
|
|
@ -471,7 +470,7 @@
|
|||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// 카테고리의 목록을 구해옴
|
||||
$oDocument = getModule('document');
|
||||
$oDocument = &getModule('document');
|
||||
$category_list = $oDocument->getCategoryList($module_srl);
|
||||
Context::set('category_list', $category_list);
|
||||
|
||||
|
|
@ -494,14 +493,14 @@
|
|||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// 현 모듈의 권한 목록을 가져옴
|
||||
$oBoard = getModule('board');
|
||||
$oBoard = &getModule('board');
|
||||
$grant_list = $oBoard->grant_list;
|
||||
|
||||
// 권한 목록 세팅
|
||||
Context::set('grant_list', $grant_list);
|
||||
|
||||
// 권한 그룹의 목록을 가져온다
|
||||
$oMember = getModule('member');
|
||||
$oMember = &getModule('member');
|
||||
$group_list = $oMember->getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
if(!$document_srl) return new Object(-1,'msg_invalid_document');
|
||||
|
||||
// document model 객체 생성
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 원본글을 가져옴
|
||||
$document = $oDocumentModel->getDocument($document_srl);
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
if(!$output->toBool()) return $output;
|
||||
|
||||
// comment model객체 생성
|
||||
$oCommentModel = getModel('comment');
|
||||
$oCommentModel = &getModel('comment');
|
||||
|
||||
// 해당 글의 전체 댓글 수를 구해옴
|
||||
$comment_count = $oCommentModel->getCommentCount($document_srl);
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
**/
|
||||
function updateComment($obj) {
|
||||
// comment model 객체 생성
|
||||
$oCommentModel = getModel('comment');
|
||||
$oCommentModel = &getModel('comment');
|
||||
|
||||
// 권한이 있는지 확인
|
||||
if(!$oCommentModel->isGranted($obj->comment_srl)) return new Object(-1, 'msg_not_permitted');
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
**/
|
||||
function deleteComment($comment_srl) {
|
||||
// comment model 객체 생성
|
||||
$oCommentModel = getModel('comment');
|
||||
$oCommentModel = &getModel('comment');
|
||||
|
||||
// 기존 댓글이 있는지 확인
|
||||
$comment = $oCommentModel->getComment($comment_srl);
|
||||
|
|
@ -115,7 +115,7 @@
|
|||
$comment_count = $oCommentModel->getCommentCount($document_srl);
|
||||
|
||||
// document의 controller 객체 생성
|
||||
$oDocumentController = getController('document');
|
||||
$oDocumentController = &getController('document');
|
||||
|
||||
// 해당글의 댓글 수를 업데이트
|
||||
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count);
|
||||
|
|
@ -129,7 +129,7 @@
|
|||
**/
|
||||
function deleteComments($document_srl) {
|
||||
// document model객체 생성
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 권한이 있는지 확인
|
||||
if(!$oDocumentModel->isGranted($document_srl)) return new Object(-1, 'msg_not_permitted');
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
if($obj->allow_trackback!='Y') $obj->allow_trackback = 'N';
|
||||
|
||||
// file의 Model객체 생성
|
||||
$oFileModel = getModel('file');
|
||||
$oFileModel = &getModel('file');
|
||||
|
||||
// 첨부 파일의 갯수를 구함
|
||||
$obj->uploaded_count = $oFileModel->getFilesCount($obj->document_srl);
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
}
|
||||
|
||||
// 태그 처리
|
||||
$oTagController = getController('tag');
|
||||
$oTagController = &getController('tag');
|
||||
$obj->tags = $oTagController->insertTag($obj->module_srl, $obj->document_srl, $obj->tags);
|
||||
|
||||
// 글 입력
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
if($obj->allow_trackback!='Y') $obj->allow_trackback = 'N';
|
||||
|
||||
// file의 Model객체 생성
|
||||
$oFileModel = getModel('file');
|
||||
$oFileModel = &getModel('file');
|
||||
|
||||
// 첨부 파일의 갯수를 구함
|
||||
$obj->uploaded_count = $oFileModel->getFilesCount($obj->document_srl);
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
}
|
||||
|
||||
// 태그 처리
|
||||
$oTagController = getController('tag');
|
||||
$oTagController = &getController('tag');
|
||||
$obj->tags = $oTagController->insertTag($obj->module_srl, $obj->document_srl, $obj->tags);
|
||||
|
||||
// 수정
|
||||
|
|
@ -133,7 +133,7 @@
|
|||
$category_srl = $obj->category_srl;
|
||||
|
||||
// document의 model 객체 생성
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 기존 문서가 있는지 확인
|
||||
$document = $oDocumentModel->getDocument($document_srl);
|
||||
|
|
@ -150,19 +150,19 @@
|
|||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 댓글 삭제
|
||||
$oCommentController = getController('comment');
|
||||
$oCommentController = &getController('comment');
|
||||
$output = $oCommentController->deleteComments($document_srl);
|
||||
|
||||
// 엮인글 삭제
|
||||
$oTrackbackController = getController('trackback');
|
||||
$oTrackbackController = &getController('trackback');
|
||||
$output = $oTrackbackController->deleteTrackbacks($document_srl);
|
||||
|
||||
// 태그 삭제
|
||||
$oTagController = getController('tag');
|
||||
$oTagController = &getController('tag');
|
||||
$oTagController->deleteTag($document_srl);
|
||||
|
||||
// 첨부 파일 삭제
|
||||
$oFileController = getController('file');
|
||||
$oFileController = &getController('file');
|
||||
if($document->uploaded_count) $oFileController->deleteFiles($document->module_srl, $document_srl);
|
||||
|
||||
// 카테고리가 있으면 카테고리 정보 변경
|
||||
|
|
@ -262,7 +262,7 @@
|
|||
**/
|
||||
function updateCategoryCount($category_srl, $document_count = 0) {
|
||||
// document model 객체 생성
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
if(!$document_count) $document_count = $oDocumentModel->getCategoryDocumentCount($category_srl);
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
|
|
@ -309,7 +309,7 @@
|
|||
**/
|
||||
function moveCategoryUp($category_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 선택된 카테고리의 정보를 구한다
|
||||
$args->category_srl = $category_srl;
|
||||
|
|
@ -356,7 +356,7 @@
|
|||
**/
|
||||
function moveCategoryDown($category_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 선택된 카테고리의 정보를 구한다
|
||||
$args->category_srl = $category_srl;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
if($this->isGranted($document->document_srl)) {
|
||||
$document->is_granted = true;
|
||||
} elseif($document->member_srl) {
|
||||
$oMemberModel = getMemberModel('member');
|
||||
$oMemberModel = &getMemberModel('member');
|
||||
$member_srl = $oMemberModel->getMemberSrl();
|
||||
if($member_srl && $member_srl ==$document->member_srl) $document->is_granted = true;
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
if(!$document_list) return;
|
||||
|
||||
// 권한 체크
|
||||
$oMemberModel = getModel('member');
|
||||
$oMemberModel = &getModel('member');
|
||||
$member_srl = $oMemberModel->getMemberSrl();
|
||||
|
||||
$document_count = count($document_list);
|
||||
|
|
@ -115,7 +115,7 @@
|
|||
if(!count($output->data)) return $output;
|
||||
|
||||
// 권한 체크
|
||||
$oMemberModel = getModel('member');
|
||||
$oMemberModel = &getModel('member');
|
||||
$member_srl = $oMemberModel->getMemberSrl();
|
||||
|
||||
foreach($output->data as $key => $document) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
if(!move_uploaded_file($file_info['tmp_name'], $filename)) return false;
|
||||
|
||||
// 사용자 정보를 구함
|
||||
$oMemberModel = getModel('member');
|
||||
$oMemberModel = &getModel('member');
|
||||
$member_srl = $oMemberModel->getMemberSrl();
|
||||
|
||||
// 파일 정보를 정리
|
||||
|
|
@ -136,7 +136,7 @@
|
|||
**/
|
||||
function printUploadedFileList($document_srl) {
|
||||
// file의 Model객체 생성
|
||||
$oFileModel = getModel('file');
|
||||
$oFileModel = &getModel('file');
|
||||
|
||||
// 첨부파일 목록을 구함
|
||||
$file_list = $oFileModel->getFiles($document_srl);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 멤버 컨트롤러 객체 생성
|
||||
$oMemberController = getController('member');
|
||||
$oMemberController = &getController('member');
|
||||
|
||||
// 그룹을 입력
|
||||
$group_args->title = Context::getLang('default_group_1');
|
||||
|
|
@ -110,7 +110,7 @@
|
|||
if(!$output) return $output;
|
||||
|
||||
// 기본 모듈을 생성
|
||||
$oModule = getController('module');
|
||||
$oModule = &getController('module');
|
||||
$oModule->makeDefaultModule();
|
||||
|
||||
// config 파일 생성
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
$this->setTemplatePath($this->module_path."tpl");
|
||||
|
||||
// 컨트롤러 생성
|
||||
$oController = getController('install');
|
||||
$oController = &getController('install');
|
||||
|
||||
// 설치 불가능하다면 introduce를 출력
|
||||
if(!$oController->checkInstallEnv()) $this->act = $this->default_act;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -25,11 +25,8 @@
|
|||
if(!$user_id) return new Object(-1,'null_user_id');
|
||||
if(!$password) return new Object(-1,'null_password');
|
||||
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// member model 객체 생성
|
||||
$oMemberModel = getModel('member');
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// user_id 에 따른 정보 가져옴
|
||||
$member_info = $oMemberModel->getMemberInfoByUserID($user_id);
|
||||
|
|
@ -48,6 +45,9 @@
|
|||
$_SESSION['member_srl'] = $member_info->member_srl;
|
||||
$_SESSION['logged_info'] = $member_info;
|
||||
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 사용자 정보의 최근 로그인 시간을 기록
|
||||
$args->member_srl = $member_info->member_srl;
|
||||
$output = $oDB->executeQuery('member.updateLastLogin', $args);
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
list($args->email_id, $args->email_host) = explode('@', $args->email_address);
|
||||
|
||||
// 모델 객체 생성
|
||||
$oMemberModel = getModel('member');
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// 금지 아이디인지 체크
|
||||
if($oMemberModel->isDeniedID($args->user_id)) return new Object(-1,'denied_user_id');
|
||||
|
|
@ -126,7 +126,7 @@
|
|||
**/
|
||||
function updateMember($args) {
|
||||
// 모델 객체 생성
|
||||
$oMemberModel = getModel('member');
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// 수정하려는 대상의 원래 정보 가져오기
|
||||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
|
||||
|
|
@ -178,7 +178,7 @@
|
|||
function deleteMember($member_srl) {
|
||||
|
||||
// 모델 객체 생성
|
||||
$oMemberModel = getModel('member');
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// 해당 사용자의 정보를 가져옴
|
||||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
|
||||
|
|
@ -264,7 +264,7 @@
|
|||
**/
|
||||
function deleteGroup($group_srl) {
|
||||
// 멤버모델 객체 생성
|
||||
$oMemberModel = getModel('member');
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// 삭제 대상 그룹을 가져와서 체크 (is_default == 'Y'일 경우 삭제 불가)
|
||||
$group_info = $oMemberModel->getGroup($group_srl);
|
||||
|
|
@ -318,7 +318,7 @@
|
|||
// member_srl이 넘어오면 원 회원이 있는지 확인
|
||||
if($args->member_srl) {
|
||||
// 멤버 모델 객체 생성
|
||||
$oMemberModel = getModel('member');
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// 회원 정보 구하기
|
||||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
|
||||
|
|
@ -426,7 +426,8 @@
|
|||
function procInsertDeniedID() {
|
||||
$user_id = Context::get('user_id');
|
||||
$description = Context::get('description');
|
||||
$oMemberModel = getModel('member');
|
||||
|
||||
$oMemberModel = &getModel('member');
|
||||
$output = $oMemberModel->insertDeniedID($user_id, $description);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
|
@ -444,7 +445,7 @@
|
|||
$user_id = Context::get('user_id');
|
||||
$mode = Context::get('mode');
|
||||
|
||||
$oMemberController = getController('member');
|
||||
$oMemberController = &getController('member');
|
||||
|
||||
switch($mode) {
|
||||
case 'delete' :
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
function getLoggedInfo() {
|
||||
// 로그인 되어 있고 세션 정보를 요청하면 세션 정보를 return
|
||||
if($this->isLogged()) return $_SESSION['logged_info'];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@
|
|||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function dispInit() {
|
||||
function init() {
|
||||
// 멤버모델 객체 생성
|
||||
$oMemberModel = getModel('member');
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// member_srl이 있으면 미리 체크하여 member_info 세팅
|
||||
$member_srl = Context::get('member_srl');
|
||||
|
|
@ -104,7 +104,7 @@
|
|||
**/
|
||||
function dispDeniedID() {
|
||||
// 멤버모델 객체 생성
|
||||
$oMemberModel = getModel('member');
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// 사용금지 목록 가져오기
|
||||
$output = $oMemberModel->getDeniedIDList();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<module default_action="dispContent" management_action="">
|
||||
<actions>
|
||||
<action name="dispContent" type="view" grant="guest" />
|
||||
<action name="dispContent" type="view" grant="root" />
|
||||
</actions>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -23,14 +23,15 @@
|
|||
$output = $oDB->executeQuery('module.getDefaultMidInfo');
|
||||
if($output->data) return;
|
||||
|
||||
// 기본 모듈 입력
|
||||
// extra_vars 데이터 세팅
|
||||
$extra_vars->colorset = 'normal';
|
||||
|
||||
// 기본 데이터 세팅
|
||||
$args->mid = 'board';
|
||||
$args->browser_title = '테스트 모듈';
|
||||
$args->is_default = 'Y';
|
||||
$args->module = 'board';
|
||||
$args->skin = 'default';
|
||||
|
||||
$extra_vars->colorset = 'normal';
|
||||
$args->extra_vars = serialize($extra_vars);
|
||||
|
||||
return $this->insertModule($args);
|
||||
|
|
@ -41,17 +42,20 @@
|
|||
**/
|
||||
function insertModule($args) {
|
||||
// module model 객체 생성
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
// 선택된 스킨정보에서 colorset을 구함
|
||||
$skin_info = $oModuleModel->loadSkinInfo($args->module, $args->skin);
|
||||
$extra_vars->colorset = $skin_info->colorset[0]->name;
|
||||
|
||||
// db에 입력
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 변수 정리후 query 실행
|
||||
$args->module_srl = $oDB->getNextSequence();
|
||||
$args->extra_vars = serialize($extra_vars);
|
||||
$output = $oDB->executeQuery('module.insertModule', $args);
|
||||
|
||||
$output->add('module_srl',$args->module_srl);
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -61,6 +65,7 @@
|
|||
**/
|
||||
function updateModule($args) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$output = $oDB->executeQuery('module.updateModule', $args);
|
||||
$output->add('module_srl',$args->module_srl);
|
||||
return $output;
|
||||
|
|
@ -71,6 +76,7 @@
|
|||
**/
|
||||
function updateModuleExtraVars($module_srl, $extra_vars) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->module_srl = $module_srl;
|
||||
$args->extra_vars = $extra_vars;
|
||||
$output = $oDB->executeQuery('module.updateModuleExtraVars', $args);
|
||||
|
|
@ -82,6 +88,7 @@
|
|||
**/
|
||||
function updateModuleGrant($module_srl, $grant) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->module_srl = $module_srl;
|
||||
$args->grant = $grant;
|
||||
$output = $oDB->executeQuery('module.updateModuleGrant', $args);
|
||||
|
|
@ -97,10 +104,11 @@
|
|||
$oDB = &DB::getInstance();
|
||||
|
||||
// addon 삭제
|
||||
|
||||
// plugin 삭제
|
||||
|
||||
// document 삭제
|
||||
$oDocumentController = getController('document');
|
||||
$oDocumentController = &getController('document');
|
||||
$output = $oDocumentController->deleteModuleDocument($module_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
|
@ -109,25 +117,26 @@
|
|||
if(!$output->toBool()) return $output;
|
||||
|
||||
// trackbacks 삭제
|
||||
$oTrackbackController = getController('trackback');
|
||||
$oTrackbackController = &getController('trackback');
|
||||
$output = $oTrackbackController->deleteModuleTrackbacks($module_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// comments 삭제
|
||||
$oCommentController = getController('comment');
|
||||
$oCommentController = &getController('comment');
|
||||
$output = $oCommentController->deleteModuleComments($module_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// tags 삭제
|
||||
$oTagController = getController('tag');
|
||||
$oTagController = &getController('tag');
|
||||
$output = $oTagController->deleteModuleTags($module_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// files 삭제
|
||||
$output = $oDocumentController->deleteModuleFiles($module_srl);
|
||||
// 첨부 파일 삭제
|
||||
$oFileController = &getController('file');
|
||||
$output = $oFileController->deleteModuleFiles($module_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// module 정보 삭제
|
||||
// module 정보를 DB에서 삭제
|
||||
$args->module_srl = $module_srl;
|
||||
$output = $oDB->executeQuery('module.deleteModule', $args);
|
||||
|
||||
|
|
@ -139,6 +148,7 @@
|
|||
**/
|
||||
function clearDefaultModule() {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
return $oDB->executeQuery('module.clearDefaultModule');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@
|
|||
$class_path = ModuleHandler::getModulePath($module);
|
||||
if(!$class_path) return;
|
||||
|
||||
$action_xml_file = sprintf("%sconf/module.xml", $class_path);
|
||||
if(!file_exists($action_xml_file)) return;
|
||||
$xml_file = sprintf("%sconf/module.xml", $class_path);
|
||||
if(!file_exists($xml_file)) return;
|
||||
|
||||
$xml_obj = XmlParser::loadXmlFile($action_xml_file);
|
||||
$xml_obj = XmlParser::loadXmlFile($xml_file);
|
||||
if(!count($xml_obj->module)) return;
|
||||
|
||||
$output->default_action = $xml_obj->module->attrs->default_action; ///< 별도의 action이 지정되지 않으면 호출될 action
|
||||
|
|
@ -112,8 +112,10 @@
|
|||
* @brief document_srl로 모듈의 정보르 구함
|
||||
**/
|
||||
function getModuleInfoByDocumentSrl($document_srl) {
|
||||
// DB 객체 생성후 데이터를 DB에서 가져옴
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 데이터를 DB에서 가져옴
|
||||
$args->document_srl = $document_srl;
|
||||
$output = $oDB->executeQuery('module.getModuleInfoByDocument', $args);
|
||||
|
||||
|
|
@ -124,7 +126,7 @@
|
|||
* @brief mid로 모듈의 정보를 구함
|
||||
**/
|
||||
function getModuleInfoByMid($mid='') {
|
||||
// DB 객체 생성후 데이터를 DB에서 가져옴
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// $mid값이 인자로 주어질 경우 $mid로 모듈의 정보를 구함
|
||||
|
|
@ -145,8 +147,10 @@
|
|||
* @brief module_srl에 해당하는 모듈의 정보를 구함
|
||||
**/
|
||||
function getModuleInfoByModuleSrl($module_srl='') {
|
||||
// db에서 데이터를 가져옴
|
||||
// db객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 데이터를 가져옴
|
||||
$args->module_srl = $module_srl;
|
||||
$output = $oDB->executeQuery('module.getMidInfo', $args);
|
||||
if(!$output->data) return;
|
||||
|
|
@ -162,11 +166,11 @@
|
|||
|
||||
// serialize되어 있는 변수들 추출
|
||||
$extra_vars = $source_module_info->extra_vars;
|
||||
$grant = $source_module_info->grant;
|
||||
$grants = $source_module_info->grants;
|
||||
$admin_id = $source_module_info->admin_id;
|
||||
|
||||
unset($source_module_info->extra_vars);
|
||||
unset($source_module_info->grant);
|
||||
unset($source_module_info->grants);
|
||||
unset($source_module_info->admin_id);
|
||||
|
||||
$module_info = clone($source_module_info);
|
||||
|
|
@ -178,7 +182,7 @@
|
|||
}
|
||||
|
||||
// 권한의 정리
|
||||
if($grant) $module_info->grant = unserialize($grant);
|
||||
if($grants) $module_info->grants = unserialize($grants);
|
||||
|
||||
// 관리자 아이디의 정리
|
||||
if($module_info->admin_id) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
**/
|
||||
function dispContent() {
|
||||
// 모듈모델 객체를 구함
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
// 등록된 모듈의 목록을 구해옴
|
||||
$installed_module_list = $oModuleModel->getModulesInfo();
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<column name="modules.use_category" alias="use_category" />
|
||||
<column name="modules.extra_vars" alias="extra_vars" />
|
||||
<column name="modules.layout_file" alias="layout_file" />
|
||||
<column name="modules.grant" alias="grant" />
|
||||
<column name="modules.grants" alias="grants" />
|
||||
<column name="modules.admin_id" alias="admin_id" />
|
||||
<column name="modules.header_text" alias="header_text" />
|
||||
<column name="modules.footer_text" alias="footer_text" />
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<table name="modules" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="grant" var="grant" />
|
||||
<column name="grants" var="grants" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull"/>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<column name="use_category" type="char" size="1" default="N"/>
|
||||
<column name="extra_vars" type="text" />
|
||||
<column name="layout_file" type="varchar" size="250" />
|
||||
<column name="grant_list" type="text" />
|
||||
<column name="grants" type="text" />
|
||||
<column name="admin_id" type="text" />
|
||||
<column name="header_text" type="text" />
|
||||
<column name="footer_text" type="text" />
|
||||
|
|
|
|||
|
|
@ -7,5 +7,7 @@
|
|||
|
||||
class rss extends ModuleObject {
|
||||
|
||||
var $rss_type = "rss2.0";
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -17,10 +17,20 @@
|
|||
function init() {
|
||||
}
|
||||
|
||||
function dispRss($info, $content, $type="rss2.0") {
|
||||
switch($type) {
|
||||
case "rss2.0" :
|
||||
$this->dispRss20($info, $content);
|
||||
break;
|
||||
}
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief content를 받아서 rss 형식으로 출력
|
||||
**/
|
||||
function printRssDocument($info, $content, $type="2.0") {
|
||||
function dispRss20($info, $content) {
|
||||
header("Content-Type: text/xml; charset=UTF-8");
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
/**
|
||||
* @brief 태그 입력
|
||||
* 태그 입력은 해당 글의 모든 태그를 삭제 후 재 입력하는 방식을 이용
|
||||
**/
|
||||
function insertTag($module_srl, $document_srl, $tags) {
|
||||
|
||||
|
|
@ -32,9 +33,10 @@
|
|||
}
|
||||
if(!count($tag_list)) return;
|
||||
|
||||
// 다시 태그를 입력
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 다시 태그를 입력
|
||||
$args->module_srl = $module_srl;
|
||||
$args->document_srl = $document_srl;
|
||||
$tag_count = count($tag_list);
|
||||
|
|
@ -50,7 +52,9 @@
|
|||
* @brief 특정 문서의 태그 삭제
|
||||
**/
|
||||
function deleteTag($document_srl) {
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->document_srl = $document_srl;
|
||||
return $oDB->executeQuery('tag.deleteTag', $args);
|
||||
}
|
||||
|
|
@ -59,8 +63,9 @@
|
|||
* @brief 특정 모듈의 태그 삭제
|
||||
**/
|
||||
function deleteModuleTags($module_srl) {
|
||||
// 삭제
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->module_srl = $module_srl;
|
||||
return $oDB->executeQuery('tag.deleteModuleTags', $args);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,16 +17,20 @@
|
|||
* @brief 엮인글 입력
|
||||
**/
|
||||
function insertTrackback($obj) {
|
||||
// dispMessage()를 위해 미리 View 객체 생성
|
||||
$oTrackbackView = &getView('trackback');
|
||||
|
||||
// GET으로 넘어온 document_srl을 참조, 없으면 오류~
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) $this->dispMessage(-1, 'fail');
|
||||
if(!$document_srl) $oTrackbackView->dispMessage(-1, 'fail');
|
||||
|
||||
// document model 객체 생성후 원본글을 가져옴
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
$document = $oDocumentModel->getDocument($document_srl);
|
||||
|
||||
// 원본글이 없거나 트랙백 허용을 하지 않으면 오류 표시
|
||||
if(!$document_srl) $this->dispMessage(-1,'fail');
|
||||
if($document->allow_trackback=='N') $this->dispMessage(-1,'fail');
|
||||
if(!$document_srl) $oTrackbackView->dispMessage(-1,'fail');
|
||||
if($document->allow_trackback=='N') $oTrackbackView->dispMessage(-1,'fail');
|
||||
|
||||
// 엮인글 정리
|
||||
$obj = Context::convertEncoding($obj);
|
||||
|
|
@ -40,22 +44,23 @@
|
|||
$output = $oDB->executeQuery('trackback.insertTrackback', $obj);
|
||||
|
||||
// 입력에 이상이 없으면 해당 글의 엮인글 수를 올림
|
||||
if(!$output->toBool()) $this->dispMessage(-1, 'fail');
|
||||
if(!$output->toBool()) $oTrackbackView->dispMessage(-1, 'fail');
|
||||
|
||||
// trackback model 객체 생성
|
||||
$oTrackbackModel = getModel('trackback');
|
||||
$oTrackbackModel = &getModel('trackback');
|
||||
|
||||
// 해당 글의 전체 엮인글 수를 구해옴
|
||||
$trackback_count = $oTrackbackModel->getTrackbackCount($document_srl);
|
||||
|
||||
// document controller 객체 생성
|
||||
$oDocumentController = getController('document');
|
||||
$oDocumentController = &getController('document');
|
||||
|
||||
// 해당글의 엮인글 수를 업데이트
|
||||
$output = $oDocumentController->updateTrackbackCount($document_srl, $trackback_count);
|
||||
|
||||
if(!$output->toBool()) $this->dispMessage(-1,'fail');
|
||||
else $this->dispMessage(0,'success');
|
||||
// 결과 return
|
||||
if(!$output->toBool()) $oTrackbackView->dispMessage(-1,'fail');
|
||||
else $oTrackbackView->dispMessage(0,'success');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -63,7 +68,7 @@
|
|||
**/
|
||||
function deleteTrackback($trackback_srl) {
|
||||
// trackback model 객체 생성
|
||||
$oTrackbackModel = getModel('trackback');
|
||||
$oTrackbackModel = &getModel('trackback');
|
||||
|
||||
// 삭제하려는 엮인글이 있는지 확인
|
||||
$trackback = $oTrackbackModel->getTrackback($trackback_srl);
|
||||
|
|
@ -71,7 +76,7 @@
|
|||
$document_srl = $trackback->data->document_srl;
|
||||
|
||||
// document model 객체 생성
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 권한이 있는지 확인
|
||||
if(!$oDocumentModel->isGranted($document_srl)) return new Object(-1, 'msg_not_permitted');
|
||||
|
|
@ -86,11 +91,12 @@
|
|||
$trackback_count = $oTrackbackModel->getTrackbackCount($document_srl);
|
||||
|
||||
// document controller 객체 생성
|
||||
$oDocumentController = getController('document','controller');
|
||||
$oDocumentController = &getController('document','controller');
|
||||
|
||||
// 해당글의 엮인글 수를 업데이트
|
||||
$output = $oDocumentController->updateTrackbackCount($document_srl, $trackback_count);
|
||||
$output->add('document_srl', $document_srl);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -98,9 +104,13 @@
|
|||
* @brief 글에 속한 모든 트랙백 삭제
|
||||
**/
|
||||
function deleteTrackbacks($document_srl) {
|
||||
// DB객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 삭제
|
||||
$args->document_srl = $document_srl;
|
||||
$output = $oDB->executeQuery('trackback.deleteTrackbacks', $args);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -108,15 +118,20 @@
|
|||
* @brief 모듈에 속한 모든 트랙백 삭제
|
||||
**/
|
||||
function deleteModuleTrackbacks($module_srl) {
|
||||
// 삭제
|
||||
// DB객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 삭제
|
||||
$args->module_srl = $module_srl;
|
||||
$output = $oDB->executeQuery('trackback.deleteModuleTrackbacks', $args);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 엮인글을 발송
|
||||
*
|
||||
* 발송 후 결과처리는 하지 않는 구조임
|
||||
**/
|
||||
function sendTrackback($document, $trackback_url, $charset) {
|
||||
// 발송할 정보를 정리
|
||||
|
|
@ -151,6 +166,7 @@
|
|||
if($http['query']) $content .= '&'.$http['query'];
|
||||
$content_length = strlen($content);
|
||||
|
||||
// header 정리
|
||||
$header =
|
||||
sprintf(
|
||||
"POST %s HTTP/1.1\r\n".
|
||||
|
|
@ -166,16 +182,20 @@
|
|||
);
|
||||
if(!$http['host']||!$http['port']) return;
|
||||
|
||||
// 발송하려는 대상 서버의 socket을 연다
|
||||
$fp = @fsockopen($http['host'], $http['port'], $errno, $errstr, 5);
|
||||
if(!$fp) return;
|
||||
|
||||
// 작성한 헤더 정보를 발송
|
||||
fputs($fp, $header);
|
||||
|
||||
// 결과를 기다림 (특정 서버의 경우 EOF가 떨어지지 않을 수가 있음
|
||||
while(!feof($fp)) {
|
||||
$line = trim(fgets($fp, 4096));
|
||||
if(eregi("^<error>",$line)) break;
|
||||
}
|
||||
|
||||
// socket 닫음
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
**/
|
||||
function getTrackback($trackback_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->trackback_srl = $trackback_srl;
|
||||
return $oDB->executeQuery('trackback.getTrackback', $args);
|
||||
}
|
||||
|
|
@ -27,9 +28,11 @@
|
|||
**/
|
||||
function getTrackbackCount($document_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->document_srl = $document_srl;
|
||||
$output = $oDB->executeQuery('trackback.getTrackbackCount', $args);
|
||||
$total_count = $output->data->count;
|
||||
|
||||
return (int)$total_count;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
/**
|
||||
* @brief 메세지 출력
|
||||
* 메세지를 출력하고 그냥 종료 시켜 버림
|
||||
**/
|
||||
function dispMessage($error, $message) {
|
||||
// 헤더 출력
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue