대댓글에 'OOO님에게 달린 댓글' 구현하기
대댓글에 'OOO님에게 달린 댓글' 구현하기
Str@wBerry♪'· 님이 작성한 내용을 조금 보충한겁니다
적용하고 나니 댓글 기준을누구에게 줬는지 확실하게 알수가 있어서 좋군요
문제가 된다면 삭제 하도록 하겠습니다
_comment.html 수정 전
<!--// 댓글 본문 -->
<!--@if(!$comment->isAccessible())-->
<
form
action
=
"./"
method
=
"get"
onsubmit
=
"return procFilter(this, input_password)"
>
<
input
name
=
"mid"
value
=
"{$mid}"
type
=
"hidden"
>
<
input
name
=
"page"
value
=
"{$page}"
type
=
"hidden"
>
<
input
name
=
"document_srl"
value="{$comment->get('document_srl')}" type="hidden">
<
input
name
=
"comment_srl"
value="{$comment->get('comment_srl')}" type="hidden">
<
p
>"{$lang->msg_is_secret}"</
p
>
<
span
class
=
"itx_wrp"
>
<
label
for="cpw_{$comment->comment_srl}">{$lang->password}</
label
>
<
input
id="cpw_{$comment->comment_srl}" name="password" class="itx" type="password">
<
input
value="{$lang->cmd_input}" class="bd_btn" type="submit">
</
span
>
</
form
>
<!--@else-->
{$comment->getContent(false)}
<!--@end-->
<!--// 편집 등 -->
<
div
class
=
"fdb_nav img_tx"
>
<
block
cond="$mi->cmt_this_btn=='2' && $is_logged">
<
a
href
=
"#"
onclick="doCallModuleAction('comment','procCommentDeclare','{$comment->comment_srl}');return false"><
i
class
=
"fa fa-phone"
></
i
>{$lang->cmd_declare}</
a
>
<
a
href
=
"#"
onclick="doCallModuleAction('comment','procCommentVoteUp','{$comment->comment_srl}');return false"><
i
class
=
"fa fa-heart color"
></
i
>{$lang->cmd_vote}</
a
>
<
a
cond="!$mi->cmt_vote_down" href="#" onclick="doCallModuleAction('comment','procCommentVoteDown','{$comment->comment_srl}');return false"><
i
class
=
"fa fa-heart"
></
i
>{$lang->cmd_vote_down}</
a
>
</
block
>
</
div
>
<!--// 댓글 본문 -->
<!--@if(!$comment->isAccessible())-->
<
form
action
=
"./"
method
=
"get"
onsubmit
=
"return procFilter(this, input_password)"
>
<
input
name
=
"mid"
value
=
"{$mid}"
type
=
"hidden"
>
<
input
name
=
"page"
value
=
"{$page}"
type
=
"hidden"
>
<
input
name
=
"document_srl"
value="{$comment->get('document_srl')}" type="hidden">
<
input
name
=
"comment_srl"
value="{$comment->get('comment_srl')}" type="hidden">
<
p
>"{$lang->msg_is_secret}"</
p
>
<
span
class
=
"itx_wrp"
>
<
label
for="cpw_{$comment->comment_srl}">{$lang->password}</
label
>
<
input
id="cpw_{$comment->comment_srl}" name="password" class="itx" type="password">
<
input
value="{$lang->cmd_input}" class="bd_btn" type="submit">
</
span
>
</
form
>
<!--@else-->
<!--@if($comment->parent_srl)-->
{@
$oComment = &getModel('comment');
$comment_parent = $oComment->getComment($comment->parent_srl);
}
{$comment_parent->getNickName()} 님에게 달린 댓글 {$comment->getContent(false)}
<!--@else-->
{$comment->getContent(false)}
<!--@end-->
<!--@end-->
<!--// 편집 등 -->
<
div
class
=
"fdb_nav img_tx"
>
<
block
cond="$mi->cmt_this_btn=='2' && $is_logged">
<
a
href
=
"#"
onclick="doCallModuleAction('comment','procCommentDeclare','{$comment->comment_srl}');return false"><
i
class
=
"fa fa-phone"
></
i
>{$lang->cmd_declare}</
a
>
<
a
href
=
"#"
onclick="doCallModuleAction('comment','procCommentVoteUp','{$comment->comment_srl}');return false"><
i
class
=
"fa fa-heart color"
></
i
>{$lang->cmd_vote}</
a
>
<
a
cond="!$mi->cmt_vote_down" href="#" onclick="doCallModuleAction('comment','procCommentVoteDown','{$comment->comment_srl}');return false"><
i
class
=
"fa fa-heart"
></
i
>{$lang->cmd_vote_down}</
a
>
</
block
><
font
face
=
"돋움"
><
span
style
=
"white-space: normal;"
>
</
span
></
font
></
div
>
저는 이렇게 했습니다
글자를 굵게 그리고 색을 넣습니다
<!--@else-->
<!--@if($comment->parent_srl)-->
{@
$oComment = &getModel('comment');
$comment_parent = $oComment->getComment($comment->parent_srl);
}
<span style="color:red; font-weight: bold;">{$comment_parent->getNickName()}</span> 님에게 달린 댓글 {$comment->getContent(false)}
<!--@else-->
{$comment->getContent(false)}
<!--@end-->
저는 <!--@end--> 이거 하나를 삭제하고 나니 적용이 잘되였습니다
출처: http://widzard.tistory.com/241 [WIDzard]
댓글 7
제 글이네요ㅎㅎ 그때당시 잘 된다고해서 올렸던건데ㅎㅎ 잘 안됬었나보군여~ 부끄럽습니다
그리고 홈피에 좋은 글 많더군요 ^^;;
어쨋든 도음 되었다니 기분 좋네요~^^
고맙습니다 :)
좋은 정보 감사드립니다.