일반게시판 글읽기 댓글 작업 중

This commit is contained in:
whitedot
2012-11-28 12:52:12 +09:00
parent 20d4346e32
commit 016664d489
3 changed files with 64 additions and 76 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
data
dbconfig.php
install.bak
test.php

View File

@ -136,12 +136,12 @@ ob_end_flush();
</div>
<? } ?>
</article>
<?
// 코멘트 입출력
include_once('./view_comment.php');
?>
<?
// 코멘트 입출력
include_once('./view_comment.php');
?>
</article>
<div>
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin_path/img/btn_prev.gif' border='0' align='absmiddle'></a>&nbsp;"; } ?>

View File

@ -1,88 +1,71 @@
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// $cwin 은 코멘트 새창일 때
?>
<script type="text/javascript">
<script>
// 글자수 제한
var char_min = parseInt(<?=$comment_min?>); // 최소
var char_max = parseInt(<?=$comment_max?>); // 최대
</script>
<? if ($cwin==1) { ?><table width=100% cellpadding=10 align=center><tr><td><?}?>
<? if ($cwin==1) { ?><?}?>
<!-- 코멘트 리스트 -->
<div id="commentContents">
<?
for ($i=0; $i<count($list); $i++) {
$comment_id = $list[$i]['wr_id'];
?>
<a name="c_<?=$comment_id?>"></a>
<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr>
<td><? for ($k=0; $k<strlen($list[$i]['wr_comment_reply']); $k++) echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; ?></td>
<td width='100%'>
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr>
<td height=1 colspan=3 bgcolor="#dddddd"><td>
</tr>
<tr>
<td height=1 colspan=3></td>
</tr>
<tr>
<td valign=top>
<div style="height:28px; background:url(<?=$board_skin_path?>/img/co_title_bg.gif); clear:both; line-height:28px;">
<div style="float:left; margin:2px 0 0 2px;">
<strong><?=$list[$i]['name']?></strong>
<span style="color:#888888; font-size:11px;"><?=$list[$i]['datetime']?></span>
</div>
<div style="float:right; margin-top:5px;">
<? if ($is_ip_view) { echo "&nbsp;<span style=\"color:#B2B2B2; font-size:11px;\">{$list[$i]['ip']}</span>"; } ?>
<? if ($list[$i]['is_reply']) { echo "<a href=\"javascript:comment_box('{$comment_id}', 'c');\"><img src='$board_skin_path/img/co_btn_reply.gif' border=0 align=absmiddle alt='답변'></a> "; } ?>
<? if ($list[$i]['is_edit']) { echo "<a href=\"javascript:comment_box('{$comment_id}', 'cu');\"><img src='$board_skin_path/img/co_btn_modify.gif' border=0 align=absmiddle alt='수정'></a> "; } ?>
<? if ($list[$i]['is_del']) { echo "<a href=\"javascript:comment_delete('{$list[$i]['del_link']}');\"><img src='$board_skin_path/img/co_btn_delete.gif' border=0 align=absmiddle alt='삭제'></a> "; } ?>
&nbsp;
</div>
</div>
<!-- 코멘트 출력 -->
<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);
// 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 $str;
?>
</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>
</tr>
<tr>
<td height=5 colspan=3></td>
</tr>
</table>
</td>
</tr>
</table>
<? } ?>
</div>
<!-- 코멘트 리스트 -->
<section>
<h2>이 글에 대한 댓글목록</h2>
<?
for ($i=0; $i<count($list); $i++) {
$comment_id = $list[$i]['wr_id'];
$comment_depth = strlen($list[$i]['wr_comment_reply']);
?>
<article>
<header>
<h1></h1>
</header>
<a name="c_<?=$comment_id?>"></a>
<strong><?=$list[$i]['name']?></strong>
<span style="color:#888888; font-size:11px;"><?=$list[$i]['datetime']?></span>
</div>
<div style="float:right; margin-top:5px;">
<? if ($is_ip_view) { echo "&nbsp;<span style=\"color:#B2B2B2; font-size:11px;\">{$list[$i]['ip']}</span>"; } ?>
<? if ($list[$i]['is_reply']) { echo "<a href=\"javascript:comment_box('{$comment_id}', 'c');\"><img src='$board_skin_path/img/co_btn_reply.gif' border=0 align=absmiddle alt='답변'></a> "; } ?>
<? if ($list[$i]['is_edit']) { echo "<a href=\"javascript:comment_box('{$comment_id}', 'cu');\"><img src='$board_skin_path/img/co_btn_modify.gif' border=0 align=absmiddle alt='수정'></a> "; } ?>
<? if ($list[$i]['is_del']) { echo "<a href=\"javascript:comment_delete('{$list[$i]['del_link']}');\"><img src='$board_skin_path/img/co_btn_delete.gif' border=0 align=absmiddle alt='삭제'></a> "; } ?>
&nbsp;
</div>
</div>
<!-- 코멘트 출력 -->
<?
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);
// 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 $str;
?>
</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>
</article>
<?}?>
</section>
<? if ($is_comment_write) { ?>
<!-- 코멘트 입력 -->
<div id=comment_write style="display:none;">
<table width=100% border=0 cellpadding=1 cellspacing=0 bgcolor="#dddddd"><tr><td>
<form name="fviewcomment" method="post" action="./write_comment_update.php" onsubmit="return fviewcomment_submit(this);" autocomplete="off" style="margin:0px;">
<input type=hidden name=w id=w value='c'>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
@ -96,6 +79,11 @@ for ($i=0; $i<count($list); $i++) {
<input type=hidden name=cwin value='<?=$cwin?>'>
<input type=hidden name=is_good value=''>
<section>
<h2>이 글에 댓글쓰기</h2>
</section>
<table width=100% cellpadding=3 height=156 cellspacing=0 bgcolor="#ffffff" style="border:1px solid #fff; background:url(<?=$board_skin_path?>/img/co_bg.gif) x-repeat;">
<tr>
<td colspan="2" style="padding:5px 0 0 5px;">
@ -126,7 +114,6 @@ for ($i=0; $i<count($list); $i++) {
</tr>
</table>
</form>
</td></tr></table>
</div>
<script type="text/javascript" src="<?=$g4['path']?>/js/jquery.kcaptcha.js"></script>
@ -316,4 +303,4 @@ comment_box('', 'c'); // 코멘트 입력폼이 보이도록 처리하기위해
</script>
<? } ?>
<? if($cwin==1) { ?></td><tr></table><p align=center><a href="javascript:window.close();"><img src="<?=$board_skin_path?>/img/btn_close.gif" border="0"></a><br><br><?}?>
<? if($cwin==1) { ?><?}?>