댓글 추천/비추천 새로 고침 없이
/modules/comment/comment.controller.php
updateVotedCount() 수정
이것을
1
2
3
4
5
6
7
8
9
10
11
|
// update the number of votes if ( $point < 0) { $args ->blamed_count = $oComment ->get( 'blamed_count' ) + $point ; $output = executeQuery( 'comment.updateBlamedCount' , $args ); } else { $args ->voted_count = $oComment ->get( 'voted_count' ) + $point ; $output = executeQuery( 'comment.updateVotedCount' , $args ); 요걸로 ↓
|
1
2
3
4
5
6
7
8
9
10
11
12
|
if ( $point < 0) { $args ->blamed_count = $oComment ->get( 'blamed_count' ) + $point ; $output = executeQuery( 'comment.updateBlamedCount' , $args ); $success_message = sprintf( '비추천 되었습니다. 현재 비추천수는 %d 입니다.' , $args ->blamed_count); } else { $args ->voted_count = $oComment ->get( 'voted_count' ) + $point ; $output = executeQuery( 'comment.updateVotedCount' , $args ); $success_message = sprintf( '추천 되었습니다. 현재 추천수는 %d 입니다.' , $args ->voted_count); } |
이것을
1
2
|
// Return the result return new Object(0, $success_message ); 아래로↓
|
1
|
return new Object(-1, $success_message ); |
댓글 10
근데 마지막에
// Return the result
$output = new Object(0, $success_message);
if($point > 0)
{
$output->add('voted_count', $obj->after_point);
}
else
{
$output->add('blamed_count', $obj->after_point);
}
return $output;
}
이렇게 되어있는데 맨 위에 new Object(-1, $success_message); 이렇게 바꾸면 되는 건가요?
고쳐보았는데 여전히 새로고침이 되네요 그대로에요 ㅠㅠ 제가 잘못 적용한건지..
아아아! 감사드립니다! ㅠㅜㅠ 코멘트는 잘 되네요! 도큐멘트는 도큐멘트 컨트롤러에서 어떤 부분을 바꿔야 적용이 될까요?
혹시 어디에서 찾으셨나요?
저는 새로고침 없이 추천은 되는데 한글이 깨져 나와서 왜 그런가 했더니
저장할 때 유니코드로 안 해서 그랬더라고요 ^^;; 지금은 넘 잘됩니다
팁 감사해요!
두번째 팁 부분이 modules/comment/comment.controller.php에서
// Return the result
return new Object(0, $success_message); 부분이 보이질 않는데요..
comment.controller.php 에서 1141라인에서
// Return the result
$output = new Object(0, $success_message);
로 밖에 보이질 않습니다... 혹시 이 부분 아시는 분 부탁드려요.