포인트 히스토리는 본문을 추천 받을 시엔 해당 내역을 자세히 안내하고 있지만 댓글 추천시에 안내하는 로직이 따로 없습니다
그래서 아래 소스를 추가해서 처리를 하려고 하는데 계속 값이 불러와지질 않네요 T_T
pointhistory.model.php
// 게시물 정보
if($document_srl = in_array($obj->act, array('procDocumentVoteUp', 'procDocumentVoteDown')) ? Context::get('target_srl') : Context::get('document_srl'))
{
$oDocument = getModel('document')->getDocument($document_srl);
if($oDocument->isExists())
{
$obj->reference_srl = $document_srl;
// 게시물 열람
if(!Context::get('act'))
{
$obj->message_type = 'read_document';
$obj->message = sprintf(Context::getLang('point_message_read_document'), $module_title, getUrl('', 'document_srl', $document_srl), cut_str($oDocument->get('title'), 30));
return array('type' => $obj->message_type, 'message' => $obj->message);
}
}
}
// ACT별 메세지
switch($obj->act)
{
// 추천 받음
case 'procDocumentVoteUp' :
$obj->message_type = 'vote_up';
$obj->message = sprintf(Context::getLang('point_message_document_vote_up'), $module_title, getUrl('', 'document_srl', $document_srl), cut_str($oDocument->get('title'), 30));
break;
// 비추천 받음
case 'procDocumentVoteDown' :
$obj->message_type = 'vote_down';
$obj->message = sprintf(Context::getLang('point_message_document_vote_down'), $module_title, getUrl('', 'document_srl', $document_srl), cut_str($oDocument->get('title'), 30));
break;
// 댓글 추천 받음 소스추가
case 'procCommentVoteUp' :
$document_srl = Context::get('document_srl');
$oDocument = getModel('document')->getDocument($document_srl);
$obj->reference_srl = $document_srl;
$obj->message_type = 'vote_up';
$obj->message = sprintf(Context::getLang('point_message_comment_vote_up'), $module_title, getUrl('', 'document_srl', $oDocument));
break;
댓글 추천 부분에 게시물의 url값을 받아오려면 소스를 어떻게 수정해야할까요?
code_highlighter를 사용할 수 없어 부득이하게 DIV에 담은점은 양해부탁 드려요
게시물(document)의 URL은 이미 받아오신 것 같은데요. 댓글의 URL을 말씀하시는 건가요?
일단 Context에서 comment_srl 값을 받아오시면
댓글의 URL은 아래의 형식대로 #comment_를 덧붙여서 만들 수 있습니다.
https://xetown.com/questions/1596094#comment_1596098