git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7440 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
ngleader 2010-05-11 10:30:18 +00:00
parent aff477dd54
commit e5c5449be4
9 changed files with 38 additions and 179 deletions

View file

@ -409,7 +409,6 @@
* @brief 문서 삭제
**/
function deleteDocument($document_srl, $is_admin = false) {
// trigger 호출 (before)
$trigger_obj->document_srl = $document_srl;
$output = ModuleHandler::triggerCall('document.deleteDocument', 'before', $trigger_obj);
@ -466,7 +465,6 @@
// commit
$oDB->commit();
return $output;
}
@ -474,7 +472,6 @@
* @brief 문서를 휴지통으로 옮김
**/
function moveDocumentToTrash($obj) {
// 주어진 trash_srl이 없으면 trash_srl 등록
if(!$obj->trash_srl) $trash_args->trash_srl = getNextSequence();
else $trash_args->trash_srl = $obj->trash_srl;
@ -568,13 +565,7 @@
// 조회수 업데이트
$args->document_srl = $document_srl;
$output = executeQuery('document.updateReadedCount', $args, false);
$CacheHandler = &CacheHandler::getInstance();
if($CacheHandler->isSupport()){
$readed_count = $oDocument->get('readed_count')+1;
$oDocument->add('readed_count', $readed_count);
$CacheHandler->put('readed_count:'.$document_srl, $readed_count);
}
$output = executeQuery('document.updateReadedCount', $args);
// 세션 등록
$_SESSION['readed_document'][$document_srl] = true;

View file

@ -56,12 +56,6 @@
$this->add('title', $GLOBALS['XE_DOCUMENT_LIST'][$this->document_srl]->get('title'));
$this->add('content', $GLOBALS['XE_DOCUMENT_LIST'][$this->document_srl]->get('content'));
}
$CacheHandler = &CacheHandler::getInstance();
if($CacheHandler->isSupport()){
$readed_count = $CacheHandler->get('readed_count:'.$document_srl);
if($readed_count) $this->add('readed_count', $readed_count);
}
}
function isExists() {

View file

@ -95,12 +95,11 @@
function getDocument($document_srl=0, $is_admin = false, $load_extra_vars=true) {
if(!$document_srl) return new documentItem();
if(!isset($GLOBALS['XE_DOCUMENT_LIST'][$document_srl])) {
$oDocument = new documentItem($document_srl, true);
$GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument;
if($load_extra_vars) $this->setToAllDocumentExtraVars();
}
if(!isset($GLOBALS['XE_DOCUMENT_LIST'][$document_srl])) {
$oDocument = new documentItem($document_srl, true);
$GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument;
if($load_extra_vars) $this->setToAllDocumentExtraVars();
}
if($is_admin) $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->setGrant();
return $GLOBALS['XE_DOCUMENT_LIST'][$document_srl];
@ -161,21 +160,6 @@
if(!in_array($obj->sort_index, array('list_order','regdate','last_update','update_order','readed_count','voted_count','comment_count','trackback_count','uploaded_count','title','category_srl'))) $obj->sort_index = 'list_order';
if(!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc';
$CacheHandler = &CacheHandler::getInstance();
$cache_support = $CacheHandler->isSupport();
if($cache_support){
$obj->e = $except_notice;
$obj->l = $load_extra_vars;
$oDB = &DB::getInstance();
$mtime = $oDB->_getTableMtime(array('documents'));
$cache_key = 'documentlist'.serialize($obj);
$buff = $CacheHandler->get($cache_key, $mtime);
if($buff){
return $buff;
}
}
// module_srl 대신 mid가 넘어왔을 경우는 직접 module_srl을 구해줌
if($obj->mid) {
$oModuleModel = &getModel('module');
@ -420,9 +404,6 @@
}
}
if($cache_support && $cache_key){
$CacheHandler->put($cache_key, $output);
}
return $output;
}