<block cond="$oDocument->getCommentcount()">
{@ $_idx = 1;}
{@ $comment_no = array()}
<block loop="$oDocument->getComments()=>$key,$comment">
{@ $comment_no[] = $comment->getRegdate('YmdHis')}
</block>
{@ sort($comment_no)}
<article loop="$oDocument->getComments()=>$key,$comment" class="cmt-el indent{($comment->get('depth'))}<!--@if($comment->get('depth'))--> reply<!--@end-->" id="comment_{$comment->comment_srl}">
{@
if($mi->best_cmt_count) $_best_cmt = ($comment->get('voted_count') >= $mi->best_cmt_count);
if($oDocument->comment_page_navigation):
$_use_rank = !$comment->get('depth') && $_idx < 4 && $mi->use_cmt_rank == Y && $cpage == 1;
else:
$_use_rank = !$comment->get('depth') && $_idx < 4 && $mi->use_cmt_rank == Y;
endif;
}
<div class="bPf round50p">
<img cond="$comment->getProfileImage()" src="{$comment->getProfileImage()}" alt="{$comment->getNickName()}" class="bPf-img" />
</div>
<span class="writer" cond="($comment->member_srl == $oDocument->get('member_srl') && $comment->member_srl != 0)">글쓴이</span>
<header class="author">
<div class="bSc bSc2 cmt-secret round50p" cond="$comment->get('is_secret') == Y"><i class="xi-lock-o"></i></div>
<span class="cmt_crown cmt_crown{$_idx}" cond="$_use_rank"><i class="xi-crown"></i></span>
<span class="cmt_rank cmt_rank{$_idx}" cond="$_use_rank">{$_idx}등</span>
<a cond="!$comment->member_srl && $comment->homepage" href="{$comment->homepage}">{$comment->getNickName()}</a>
<block cond="!$comment->member_srl && !$comment->homepage">{$comment->getNickName()}</block>
<span style="color: gray;">{array_search($comment->getRegdate('YmdHis'), $comment_no) + 1}번</span>
아래 소스를 추가해서
번호를 매기는것 까진 성공했는데
글쓴이도 같은 댓작성자도 새로운 번호로 매겨지니까
번호를 매긴 의미가 없네요 ㅠ_ㅠ 원인이 뭔지 아시는분 있을까요
그니깐, 날자가 아니라 그 사람의 아이피를 비교해서 $comment_no에 저장하는 것처럼
$ipList = array(
'ip' => '1'
'twoip' => '2'
)
이렇게 아이피가 있으면 저장하지 않고 없으면 데이터를 저장하되 +1씩 더해서 1,2,3 순차적으로 저장되도록 해보세요.
최종적으로는
{$ipList['ip']}번
이렇게 잡아주는게 좋을 것 같아요.
이게 아이피이던지 아니면 사용자 아이디 이던지 동일합니다.