코멘트(댓글)에서 답변이 비밀글이라도 내용볼 수 있게....... 정보
코멘트(댓글)에서 답변이 비밀글이라도 내용볼 수 있게.......
본문
코멘트(댓글)에 글을 적고
다른 회원이 코멘트(댓글)에 비밀로 답변 코멘트(댓글)를 달면
" *비밀글 입니다. "
라는 주황색의 글만 보이게 됩니다.
비밀글 답변이지만 내용을 보라고 답변을 적은 것인데, 보이지 않네요.
불당님의 소스를 나름 분석 해보려고 노력해봤는데.... 쉽지 않네요.
순정 그누보드에서 어디 부분을 접근 수정해 가야하는지 궁금합니다.
불당님 소스에서는 view_comment.php와 view_comment.skin.php라고 하던데. 이해가 잘 되지 않네요.
활용팁이나 질문게시판에서 검색을 해봤지만, 잘못 검색을 해서인지 어려워 적용하기 쉽지 않더라구요.
다른 회원이 코멘트(댓글)에 비밀로 답변 코멘트(댓글)를 달면
" *비밀글 입니다. "
라는 주황색의 글만 보이게 됩니다.
비밀글 답변이지만 내용을 보라고 답변을 적은 것인데, 보이지 않네요.
불당님의 소스를 나름 분석 해보려고 노력해봤는데.... 쉽지 않네요.
순정 그누보드에서 어디 부분을 접근 수정해 가야하는지 궁금합니다.
불당님 소스에서는 view_comment.php와 view_comment.skin.php라고 하던데. 이해가 잘 되지 않네요.
활용팁이나 질문게시판에서 검색을 해봤지만, 잘못 검색을 해서인지 어려워 적용하기 쉽지 않더라구요.
댓글 전체
코멘트 읽어오는 부분에 예외처리를 해주셔야 합니다.
코멘트 읽어오는부분 소스를 올려주셔야 확인이 가능할듯 하네요
코멘트 읽어오는부분 소스를 올려주셔야 확인이 가능할듯 하네요
네. 소스는 아래와 같습니다. skin폴더에서 view_comment.skin.php 내용중에 코멘트가 출력되는 부분은 아래 내용 같습니다.
<!-- 코멘트 출력 -->
<div style='line-height:20px; padding:7px; word-break:break-all; overflow:hidden; clear:both; '>
<?
if (strstr($list[$i][wr_option], "secret")) echo "<span style='color:#ff6600;'>*</span> ";
$str = $list[$i][content];
if (strstr($list[$i][wr_option], "secret"))
$str = "<span class='small' style='color:#ff6600;'>$str</span>";
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(swf)\".*\<\/a\>\]/i", "<script>doc_write(flash_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(gif|png|jpg|jpeg|bmp)\"\s*[^\>]*\>[^\s]*\<\/a\>\]/i", "<img src='$1://$2.$3' id='target_resize_image[]' onclick='image_window(this);' border='0'>", $str);
echo $str;
if ($file_view)
echo "<p>".$file_view;
//if(file_exists($com_file)) echo "<BR><img src='$com_file'>";
?>
</div>
<? if ($list[$i][trackback]) { echo "<p>".$list[$i][trackback]."</p>"; } ?>
<span id='edit_<?=$comment_id?>' style='display:none;'></span><!-- 수정 -->
<span id='reply_<?=$comment_id?>' style='display:none;'></span><!-- 답변 -->
</div>
<input type=hidden id='secret_comment_<?=$comment_id?>' value="<?=strstr($list[$i][wr_option],"secret")?>">
<textarea id='save_comment_<?=$comment_id?>' style='display:none;'><?=get_text($list[$i][content1], 0)?></textarea></td>
<!-- 코멘트 출력 -->
<div style='line-height:20px; padding:7px; word-break:break-all; overflow:hidden; clear:both; '>
<?
if (strstr($list[$i][wr_option], "secret")) echo "<span style='color:#ff6600;'>*</span> ";
$str = $list[$i][content];
if (strstr($list[$i][wr_option], "secret"))
$str = "<span class='small' style='color:#ff6600;'>$str</span>";
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(swf)\".*\<\/a\>\]/i", "<script>doc_write(flash_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(gif|png|jpg|jpeg|bmp)\"\s*[^\>]*\>[^\s]*\<\/a\>\]/i", "<img src='$1://$2.$3' id='target_resize_image[]' onclick='image_window(this);' border='0'>", $str);
echo $str;
if ($file_view)
echo "<p>".$file_view;
//if(file_exists($com_file)) echo "<BR><img src='$com_file'>";
?>
</div>
<? if ($list[$i][trackback]) { echo "<p>".$list[$i][trackback]."</p>"; } ?>
<span id='edit_<?=$comment_id?>' style='display:none;'></span><!-- 수정 -->
<span id='reply_<?=$comment_id?>' style='display:none;'></span><!-- 답변 -->
</div>
<input type=hidden id='secret_comment_<?=$comment_id?>' value="<?=strstr($list[$i][wr_option],"secret")?>">
<textarea id='save_comment_<?=$comment_id?>' style='display:none;'><?=get_text($list[$i][content1], 0)?></textarea></td>
아래 내용은 bbs폴더내에 있는 view_comment.php 파일내용 중 해당 사항입니다.
// 코멘트 출력
//$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] = "<span class='".($row[mb_id]?'member':'guest')."'>$tmp_name</span>";
// 공백없이 연속 입력한 문자 자르기 (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]);
}
$list[$i][trackback] = url_auto_link($row[wr_trackback]);
$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]+)/", "\\1.♡.\\3.\\4", $row[wr_ip]);
$list[$i][is_reply] = false;
$list[$i][is_edit] = false;
$list[$i][is_del] = false;
if ($is_comment_write || $is_admin)
{
if ($member[mb_id])
{
if ($row[mb_id] == $member[mb_id] || $is_admin)
{
$list[$i][del_link] = "./delete_comment.php?bo_table=$bo_table&comment_id=$row[wr_id]&token=$token&cwin=$cwin&page=$page".$qstr;
$list[$i][is_edit] = true;
$list[$i][is_del] = true;
}
}
else
{
if (!$row[mb_id]) {
$list[$i][del_link] = "./password.php?w=x&bo_table=$bo_table&comment_id=$row[wr_id]&cwin=$cwin&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;
}
}
}
}
// 코멘트 출력
//$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] = "<span class='".($row[mb_id]?'member':'guest')."'>$tmp_name</span>";
// 공백없이 연속 입력한 문자 자르기 (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]);
}
$list[$i][trackback] = url_auto_link($row[wr_trackback]);
$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]+)/", "\\1.♡.\\3.\\4", $row[wr_ip]);
$list[$i][is_reply] = false;
$list[$i][is_edit] = false;
$list[$i][is_del] = false;
if ($is_comment_write || $is_admin)
{
if ($member[mb_id])
{
if ($row[mb_id] == $member[mb_id] || $is_admin)
{
$list[$i][del_link] = "./delete_comment.php?bo_table=$bo_table&comment_id=$row[wr_id]&token=$token&cwin=$cwin&page=$page".$qstr;
$list[$i][is_edit] = true;
$list[$i][is_del] = true;
}
}
else
{
if (!$row[mb_id]) {
$list[$i][del_link] = "./password.php?w=x&bo_table=$bo_table&comment_id=$row[wr_id]&cwin=$cwin&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;
}
}
}
}
드디어 찾았습니다. 처음엔 무슨 말인지 몰랐는데, 다시 읽어보니 이해가 되네요.
아래 팁을 이용했습니다.
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=15640
아래 팁을 이용했습니다.
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=15640