비회원이 글을 작성하면 다른 글의 두번째 댓글부터 이름이 비회원 닉넴으로 바뀝니다. 정보
비회원이 글을 작성하면 다른 글의 두번째 댓글부터 이름이 비회원 닉넴으로 바뀝니다.첨부파일
본문
파일로 첨부한 방명록형 게시판(메모장)을 수정해서 쓰고 있습니다.
스킨을 수정하다 어디를 잘못 건드렸는지 비회원이 글을 작성하고 나면 그 전에 있는 다른 글의 두번째 댓글부터 닉넴이 비회원이 작성한 글의 닉넴으로 바뀝니다. 날짜도 비회원이 작성한 날짜로 다 수정되구요. 코멘트 부분을 수정하면 되는가 싶어서 건드려봤는데 도저히 모르겠습니다. 도움 부탁드립니다.ㅠㅠ
다른 게시판들은 문제가 없는걸 보니 스킨 문제가 맞는 거 같습니다. 제가 사용하는 스킨은 파일 첨부로 올려드립니다. 아래는 그 게시판의 view_comment.skin 파일 소스입니다.
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<script language="JavaScript">
// 글자수 제한
var char_min = parseInt(<?=$comment_min?>); // 최소
var char_max = parseInt(<?=$comment_max?>); // 최대
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<!-- 코멘트 리스트 -->
<?
for ($i=0; $i<count($list); $i++) {
$comment_id = $list[$i][wr_id];
if ($list[$i][content] == "쉿!") {
for ($j=$i-1; $j>=0; $i--) {
if ($list[$i][wr_comment] == $list[$i][wr_comment] && $list[$i][wr_comment_reply] == substr($list[$i][wr_comment_reply], 0, strlen($list[$i][wr_comment_reply])-1)) {
if ($list[$i][mb_id] == $member[mb_id]) {
$list[$i][content] = conv_content($list[$i][wr_content], $html, 'wr_content');
$list[$i][content] = search_font($stx, $list[$i][content]);
}
break;
}
}
}
?>
<a name="c_<?=$comment_id?>"></a>
<table width="100%" border="0" cellpadding="10" cellspacing="5" bgcolor="#eeeeee">
<tr>
<td nowrap width=15 align=center valign=top style="border-top-width:0; border-right-width:1; border-bottom-width:0; border-left-width:0; border-top-color:white; border-right-color:#ffcfa4; border-bottom-color:white; border-left-color:white; border-style:solid;">
<img src="<?=$board_skin_path?>/img/reply_head.gif" border=0 align=absmiddle></td>
<td>
<!-- 코멘트 출력 -->
<?
if (strstr($list[$i][wr_option], "secret")) echo "<span class=secret2>ⓢ </span> ";
$str = "<span class=cont>".$list[$i][content]."</span>";
if (strstr($list[$i][wr_option], "secret"))
$str = "<span class=secret>$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);
// FLASH XSS 공격에 의해 주석 처리 - 110406
//$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 $re_name." ".$str;
?>
<span id='edit_<?=$comment_id?>' style='display:none;'></span><!-- 수정 -->
<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><span class=cname> : <font color='#e18e44'><?=$lists[$i][name]?></font><span class=mdr> l </span><?=$lists[$i][datetime]?></span>
<? if ($list[$i][is_del]) { echo "<span class=mdr> l </span><a href=\"javascript:comment_delete('{$list[$i][del_link]}');\" onfocus='this.blur()'><span class=\"mdr\"> D </span></a>"; } ?>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="6"></td>
</tr>
</table>
<? } ?>
<!-- 코멘트 리스트 -->
<span id="comment_write<?=$wr_id?>" style="display:none;">
<!-- 코멘트 입력테이블시작 -->
<form name="fviewcomment<?=$wr_id?>" method="post" action="./write_comment_update.php" autocomplete="off" style="margin:0;">
<input type=hidden name=w id=w value='c'>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=wr_id value='<?=$wr_id?>'>
<input type=hidden name=comment_id id='comment_id' value=''>
<input type=hidden name=sca value='<?=$sca?>' >
<input type=hidden name=sfl value='<?=$sfl?>' >
<input type=hidden name=stx value='<?=$stx?>'>
<input type=hidden name=spt value='<?=$spt?>'>
<input type=hidden name=page value='<?=$page?>'>
<input type=hidden name=cwin value='<?=$cwin?>'>
<input type=hidden name=is_good value=''>
<input type=hidden name=url value='./board.php?bo_table=<?=$bo_table?>&page=<?=$page?>'>
<? if ($is_comment_write) { ?>
<table width=100% height=90 cellpadding=0 cellspacing=0>
<tr>
<td>
<? if ($is_guest) { ?>
<INPUT type=text maxLength=20 size=10 name="wr_name" itemname="이름" required class=ed title="Name" style='width:80px; height:13px; background-color:#e18e44; border:0px; font-family:돋움; font-size:8pt; color:#ffffff;'>
<INPUT type=password maxLength=20 size=10 name="wr_password" itemname="패스워드" required class=ed title="Pass" style='width:80px; height:13px; background-color:#e18e44; border:0px; font-family:돋움; font-size:8pt; color:#ffffff;'>
<? if ($is_guest) { ?>
<input type='hidden' name='wr_key' value='pass' />
<? } ?>
<? } ?>
</td>
<td width="5" height="30">
</td>
<td width="50" height="30">
</td>
</tr>
<tr>
<td valign="top" height="60">
<textarea id="wr_content" name="wr_content" rows=5 itemname="내용" required
<? if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?}?> style='width:100%; word-break:break-all;font:normal 8pt 돋움; color:#666666;border-width:1; border-color:#dddddd; border-style:solid;' class=tx></textarea>
<? if ($comment_min || $comment_max) { ?><script type="text/javascript"> check_byte('wr_content', 'char_count'); </script><?}?>
</td>
<td width="5" height="60">
</td>
<td width="50" height="60" valign="top">
<input type="submit" value=" OK " accesskey='s' style='word-break:break-all; font:normal 8pt 돋움; color:#ffffff;border-width:0; background:#e18e44; width:100%; height:100%;' onfocus='blur()'>
</td>
</tr>
</table>
<? } ?>
</form>
<!-- 코멘트 입력테이블 끝 -->
</span>
</td>
</tr>
</table>
<? if($cwin==1) { ?><p align=center><a href="javascript:window.close();"><img src="<?=$board_skin_path?>/img/close.gif" border="0"></a><? } ?>
<?
include_once("$board_skin_path/view_skin_js.php");
?>
스킨을 수정하다 어디를 잘못 건드렸는지 비회원이 글을 작성하고 나면 그 전에 있는 다른 글의 두번째 댓글부터 닉넴이 비회원이 작성한 글의 닉넴으로 바뀝니다. 날짜도 비회원이 작성한 날짜로 다 수정되구요. 코멘트 부분을 수정하면 되는가 싶어서 건드려봤는데 도저히 모르겠습니다. 도움 부탁드립니다.ㅠㅠ
다른 게시판들은 문제가 없는걸 보니 스킨 문제가 맞는 거 같습니다. 제가 사용하는 스킨은 파일 첨부로 올려드립니다. 아래는 그 게시판의 view_comment.skin 파일 소스입니다.
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<script language="JavaScript">
// 글자수 제한
var char_min = parseInt(<?=$comment_min?>); // 최소
var char_max = parseInt(<?=$comment_max?>); // 최대
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<!-- 코멘트 리스트 -->
<?
for ($i=0; $i<count($list); $i++) {
$comment_id = $list[$i][wr_id];
if ($list[$i][content] == "쉿!") {
for ($j=$i-1; $j>=0; $i--) {
if ($list[$i][wr_comment] == $list[$i][wr_comment] && $list[$i][wr_comment_reply] == substr($list[$i][wr_comment_reply], 0, strlen($list[$i][wr_comment_reply])-1)) {
if ($list[$i][mb_id] == $member[mb_id]) {
$list[$i][content] = conv_content($list[$i][wr_content], $html, 'wr_content');
$list[$i][content] = search_font($stx, $list[$i][content]);
}
break;
}
}
}
?>
<a name="c_<?=$comment_id?>"></a>
<table width="100%" border="0" cellpadding="10" cellspacing="5" bgcolor="#eeeeee">
<tr>
<td nowrap width=15 align=center valign=top style="border-top-width:0; border-right-width:1; border-bottom-width:0; border-left-width:0; border-top-color:white; border-right-color:#ffcfa4; border-bottom-color:white; border-left-color:white; border-style:solid;">
<img src="<?=$board_skin_path?>/img/reply_head.gif" border=0 align=absmiddle></td>
<td>
<!-- 코멘트 출력 -->
<?
if (strstr($list[$i][wr_option], "secret")) echo "<span class=secret2>ⓢ </span> ";
$str = "<span class=cont>".$list[$i][content]."</span>";
if (strstr($list[$i][wr_option], "secret"))
$str = "<span class=secret>$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);
// FLASH XSS 공격에 의해 주석 처리 - 110406
//$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 $re_name." ".$str;
?>
<span id='edit_<?=$comment_id?>' style='display:none;'></span><!-- 수정 -->
<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><span class=cname> : <font color='#e18e44'><?=$lists[$i][name]?></font><span class=mdr> l </span><?=$lists[$i][datetime]?></span>
<? if ($list[$i][is_del]) { echo "<span class=mdr> l </span><a href=\"javascript:comment_delete('{$list[$i][del_link]}');\" onfocus='this.blur()'><span class=\"mdr\"> D </span></a>"; } ?>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="6"></td>
</tr>
</table>
<? } ?>
<!-- 코멘트 리스트 -->
<span id="comment_write<?=$wr_id?>" style="display:none;">
<!-- 코멘트 입력테이블시작 -->
<form name="fviewcomment<?=$wr_id?>" method="post" action="./write_comment_update.php" autocomplete="off" style="margin:0;">
<input type=hidden name=w id=w value='c'>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=wr_id value='<?=$wr_id?>'>
<input type=hidden name=comment_id id='comment_id' value=''>
<input type=hidden name=sca value='<?=$sca?>' >
<input type=hidden name=sfl value='<?=$sfl?>' >
<input type=hidden name=stx value='<?=$stx?>'>
<input type=hidden name=spt value='<?=$spt?>'>
<input type=hidden name=page value='<?=$page?>'>
<input type=hidden name=cwin value='<?=$cwin?>'>
<input type=hidden name=is_good value=''>
<input type=hidden name=url value='./board.php?bo_table=<?=$bo_table?>&page=<?=$page?>'>
<? if ($is_comment_write) { ?>
<table width=100% height=90 cellpadding=0 cellspacing=0>
<tr>
<td>
<? if ($is_guest) { ?>
<INPUT type=text maxLength=20 size=10 name="wr_name" itemname="이름" required class=ed title="Name" style='width:80px; height:13px; background-color:#e18e44; border:0px; font-family:돋움; font-size:8pt; color:#ffffff;'>
<INPUT type=password maxLength=20 size=10 name="wr_password" itemname="패스워드" required class=ed title="Pass" style='width:80px; height:13px; background-color:#e18e44; border:0px; font-family:돋움; font-size:8pt; color:#ffffff;'>
<? if ($is_guest) { ?>
<input type='hidden' name='wr_key' value='pass' />
<? } ?>
<? } ?>
</td>
<td width="5" height="30">
</td>
<td width="50" height="30">
</td>
</tr>
<tr>
<td valign="top" height="60">
<textarea id="wr_content" name="wr_content" rows=5 itemname="내용" required
<? if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?}?> style='width:100%; word-break:break-all;font:normal 8pt 돋움; color:#666666;border-width:1; border-color:#dddddd; border-style:solid;' class=tx></textarea>
<? if ($comment_min || $comment_max) { ?><script type="text/javascript"> check_byte('wr_content', 'char_count'); </script><?}?>
</td>
<td width="5" height="60">
</td>
<td width="50" height="60" valign="top">
<input type="submit" value=" OK " accesskey='s' style='word-break:break-all; font:normal 8pt 돋움; color:#ffffff;border-width:0; background:#e18e44; width:100%; height:100%;' onfocus='blur()'>
</td>
</tr>
</table>
<? } ?>
</form>
<!-- 코멘트 입력테이블 끝 -->
</span>
</td>
</tr>
</table>
<? if($cwin==1) { ?><p align=center><a href="javascript:window.close();"><img src="<?=$board_skin_path?>/img/close.gif" border="0"></a><? } ?>
<?
include_once("$board_skin_path/view_skin_js.php");
?>
댓글 전체