= $board['bo_comment_level'])
$is_comment_write = true;
// 코멘트 출력
//$sql = " select * from {$write_table} where wr_parent = '{$wr_id}' and wr_is_comment = 1 order by wr_comment desc, wr_comment_reply ";
$sql = " select * from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$list[$i] = $row;
//$list[$i]['name'] = get_sideview($row['mb_id'], cut_str($row['wr_name'], 20, ''), $row['wr_email'], $row['wr_homepage']);
$tmp_name = get_text(cut_str($row['wr_name'], $config['cf_cut_name'])); // 설정된 자리수 만큼만 이름 출력
if ($board['bo_use_sideview'])
$list[$i]['name'] = get_sideview($row['mb_id'], $tmp_name, $row['wr_email'], $row['wr_homepage']);
else
$list[$i]['name'] = ''.$tmp_name.'';
// 공백없이 연속 입력한 문자 자르기 (way 보드 참고. way.co.kr)
//$list[$i]['content'] = eregi_replace("[^ \n<>]{130}", "\\0\n", $row['wr_content']);
/*
$list[$i]['content'] = $list[$i]['content1']= '비밀글 입니다.';
if (!strstr($row['wr_option'], 'secret') ||
$is_admin ||
($write['mb_id']===$member['mb_id'] && $member['mb_id']) ||
($row['mb_id']===$member['mb_id'] && $member['mb_id'])) {
$list[$i]['content1'] = $row['wr_content'];
$list[$i]['content'] = conv_content($row['wr_content'], 0, 'wr_content');
$list[$i]['content'] = search_font($stx, $list[$i]['content']);
}
*/
// 댓글에 댓글이 비밀댓글인 경우 원댓글 작성자도 볼 수 있도록 처리 2.1.7
$pre_comment_info = substr($row['wr_comment_reply'],0,-1);
$pre_comment = sql_fetch(" select mb_id from {$write_table} where wr_parent = '{$wr_id}' and wr_is_comment = 1 and wr_comment = '{$row['wr_comment']}' and wr_comment_reply = '{$pre_comment_info}' ");
$list[$i]['content'] = $list[$i]['content1']= '비밀글 입니다.';
if (!strstr($row['wr_option'], 'secret') ||
$is_admin ||
($pre_comment['mb_id']==$member['mb_id'] && $member['mb_id']) ||
($write['mb_id']==$member['mb_id'] && $member['mb_id']) ||
($row['mb_id']==$member['mb_id'] && $member['mb_id'])) {
$list[$i]['content1'] = $row['wr_content'];
$list[$i]['content'] = conv_content($row['wr_content'], 0, 'wr_content');
$list[$i]['content'] = search_font($stx, $list[$i]['content']);
}
else {
$ss_name = 'ss_secret_comment_'.$bo_table.'_'.$list[$i]['wr_id'];
if(!get_session($ss_name))
$list[$i]['content'] = '댓글내용 확인';
else {
$list[$i]['content'] = conv_content($row['wr_content'], 0, 'wr_content');
$list[$i]['content'] = search_font($stx, $list[$i]['content']);
}
}
$list[$i]['datetime'] = substr($row['wr_datetime'],2,14);
// 관리자가 아니라면 중간 IP 주소를 감춘후 보여줍니다.
$list[$i]['ip'] = $row['wr_ip'];
if (!$is_admin)
$list[$i]['ip'] = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", G5_IP_DISPLAY, $row['wr_ip']);
$list[$i]['is_reply'] = false;
$list[$i]['is_edit'] = false;
$list[$i]['is_del'] = false;
if ($is_comment_write || $is_admin)
{
$token = '';
if ($member['mb_id'])
{
if ($row['mb_id'] === $member['mb_id'] || $is_admin)
{
set_session('ss_delete_comment_'.$row['wr_id'].'_token', $token = uniqid(time()));
$list[$i]['del_link'] = G5_BBS_URL.'/delete_comment.php?bo_table='.$bo_table.'&comment_id='.$row['wr_id'].'&token='.$token.'&page='.$page.$qstr;
$list[$i]['is_edit'] = true;
$list[$i]['is_del'] = true;
}
}
else
{
if (!$row['mb_id']) {
$list[$i]['del_link'] = G5_BBS_URL.'/password.php?w=x&bo_table='.$bo_table.'&comment_id='.$row['wr_id'].'&page='.$page.$qstr;
$list[$i]['is_del'] = true;
}
}
if (strlen($row['wr_comment_reply']) < 5)
$list[$i]['is_reply'] = true;
}
// 05.05.22
// 답변있는 코멘트는 수정, 삭제 불가
if ($i > 0 && !$is_admin)
{
if ($row['wr_comment_reply'])
{
$tmp_comment_reply = substr($row['wr_comment_reply'], 0, strlen($row['wr_comment_reply']) - 1);
if ($tmp_comment_reply == $list[$i-1]['wr_comment_reply'])
{
$list[$i-1]['is_edit'] = false;
$list[$i-1]['is_del'] = false;
}
}
}
}
// 코멘트수 제한 설정값
if ($is_admin)
{
$comment_min = $comment_max = 0;
}
else
{
$comment_min = (int)$board['bo_comment_min'];
$comment_max = (int)$board['bo_comment_max'];
}
$comment_action_url = https_url(G5_BBS_DIR)."/write_comment_update.php";
$comment_common_url = short_url_clean(G5_BBS_URL.'/board.php?'.clean_query_string($_SERVER['QUERY_STRING']));
include_once($board_skin_path.'/view_comment.skin.php');
if (!$member['mb_id']) // 비회원일 경우에만
echo ''."\n";
@include_once($board_skin_path.'/view_comment.tail.skin.php');