묻고답하기
신고 출력 색상 정하기
2015.06.21 10:23
아래 소스 중에서 신고를하면 신고제목이 적색으로 들어가게 하려고 합니다.
어디를 수정 해야 될까요?
------------------------------------------------------------------------------------------------
<?php
if(!defined("__XE__")) exit();
if($called_position != 'after_module_proc' || Context::get('module') == 'admin') return;
if($this->act != "dispBoardContent" && $this->act != "procBoardInsertDocument" && $this->act != "dispBoardDelete") return;
$oModuleModel = &getModel('module');
$logged_info = Context::get('logged_info');
$declared_max = (int)$addon_info->declared_max;
$blamed_max = (int)$addon_info->blamed_max;
if($blamed_max == 0 && $declared_max == 0) return;
$useDeclared = $declared_max > 0;
$useBlamed = $blamed_max > 0;
$blocked_title = $addon_info->blocked_title;
$blocked_message = $addon_info->blocked_message;
$document_srl = Context::get('document_srl');
$document_list = Context::get('document_list');
if($document_list) {
foreach($document_list as $key=>$document){
if($useDeclared){
$result = executeQuery('document.getDeclaredDocument', $document);
$overDeclared = $result->data->declared_count >= $declared_max;
}else{
$overDeclared = false;
}
if($useBlamed){
$overBlamed = abs($document->get('blamed_count')) >= $blamed_max;
}else{
$overBlamed = false;
}
if( $overDeclared || $overBlamed){
$grant = $oModuleModel->getGrant($oModuleModel->getModuleInfoByModuleSrl($document->get('module_srl')), $logged_info);
if($logged_info->is_admin == 'Y' || $grant->manager){
$document->add('title', $blocked_title.' - '.$document->get('title'));
}else{
$document->add('title', $blocked_title);
$document->add('member_srl', "0");
$document->add('nick_name', "익명");
$document->add('content', "신고된 게시물입니다.");
}
}
}
}
if($document_srl) {
$oDocumentModel = &getModel('document');
$document = $oDocumentModel->getDocument($document_srl);
if($document->isExists()) {
if($useDeclared){
$result = executeQuery('document.getDeclaredDocument', $document);
$overDeclared = $result->data->declared_count >= $declared_max;
}else{
$overDeclared = false;
}
if($useBlamed){
$overBlamed = abs($document->get('blamed_count')) >= $blamed_max;
}else{
$overBlamed = false;
}
if( $overDeclared || $overBlamed){
$grant = $oModuleModel->getGrant($oModuleModel->getModuleInfoByModuleSrl($document->get('module_srl')), $logged_info);
if($logged_info->is_admin == 'Y' || $grant->manager){
}else{
$this->stop($blocked_message);
}
}
}
}
?>