update and fix codes

This commit is contained in:
Amberstone 2024-12-11 02:10:57 +09:00
parent 97f1be9902
commit f539fb454d
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
12 changed files with 1167 additions and 1145 deletions

View file

@ -1,4 +1,3 @@
<? <?php
$g5_path = "../../.."; $g5_path = "../../..";
include_once("$g5_path/common.php"); include_once "$g5_path/common.php";
?>

View file

@ -1,5 +1,5 @@
<? <?php
include_once("./_common.php"); include_once "./_common.php";
if (!function_exists('convert_charset')) if (!function_exists('convert_charset'))
{ {
@ -23,7 +23,7 @@ if (!function_exists('convert_charset'))
} }
} }
header("Content-Type: text/html; charset=$g5['charset']"); header("Content-Type: text/html; charset={$g5['charset']}");
$subject = strtolower($_POST['subject']); $subject = strtolower($_POST['subject']);
$content = strtolower(strip_tags($_POST['content'])); $content = strtolower(strip_tags($_POST['content']));
@ -69,4 +69,3 @@ for ($i=0; $i<count($filter); $i++)
} }
die("{\"subject\":\"$subj\",\"content\":\"$cont\"}"); die("{\"subject\":\"$subj\",\"content\":\"$cont\"}");
?>

View file

@ -1,17 +1,14 @@
<? <?php
// 수정, 삭제 링크 // 수정, 삭제 링크
$update_href = $delete_href = ""; $update_href = $delete_href = "";
// 로그인중이고 자신의 글이라면 또는 관리자라면 패스워드를 묻지 않고 바로 수정, 삭제 가능 // 로그인중이고 자신의 글이라면 또는 관리자라면 패스워드를 묻지 않고 바로 수정, 삭제 가능
if (($member['mb_id'] && ($member['mb_id'] == $write['mb_id'])) || $is_admin) { if (($member['mb_id'] && ($member['mb_id'] == $write['mb_id'])) || $is_admin) {
$update_href = "./write.php?w=u&bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . $qstr; $update_href = "./write.php?w=u&bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . $qstr;
$delete_href = "javascript:del('./delete.php?bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . urldecode($qstr) . "');"; $delete_href = "javascript:del('./delete.php?bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . urldecode($qstr) . "');";
if ($is_admin) if ($is_admin) {
{
$delete_href = "javascript:del('./delete.php?bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&token=$token&page=$page" . urldecode($qstr) . "');"; $delete_href = "javascript:del('./delete.php?bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&token=$token&page=$page" . urldecode($qstr) . "');";
} }
} } else if (!$write['mb_id']) { // 회원이 쓴 글이 아니라면
else if (!$write['mb_id']) { // 회원이 쓴 글이 아니라면
$update_href = "./password.php?w=u&bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . $qstr; $update_href = "./password.php?w=u&bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . $qstr;
$delete_href = "./password.php?w=d&bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . $qstr; $delete_href = "./password.php?w=d&bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . $qstr;
} }
?>

View file

@ -1,8 +1,10 @@
<? <?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
exit;
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0); add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
if($is_admin) set_session("ss_delete_token", $token = uniqid(time())); if ($is_admin)
set_session("ss_delete_token", $token = uniqid(time()));
if ($is_member) { if ($is_member) {
$comment_token = uniqid(time()); $comment_token = uniqid(time());
@ -11,7 +13,8 @@ if($is_member) {
$is_comment_write = false; $is_comment_write = false;
if($board['bo_table_width']==0) $width="100%"; if ($board['bo_table_width'] == 0)
$width = "100%";
?> ?>
@ -19,37 +22,44 @@ if($board['bo_table_width']==0) $width="100%";
<!-- 상단 공지 부분 --> <!-- 상단 공지 부분 -->
<? if($board['bo_content_head']) { ?> <?php if ($board['bo_content_head']) { ?>
<div class="board-notice theme-box"> <div class="board-notice theme-box">
<?= stripslashes($board['bo_content_head']); ?> <?= stripslashes($board['bo_content_head']); ?>
</div> </div>
<hr class="padding" /> <hr class="padding" />
<? } ?> <?php } ?>
<!-- 버튼 링크 --> <!-- 버튼 링크 -->
<? if($admin_href){?><div class="adm-box"><a href="<?=$admin_href?>" class="ui-btn admin" target="_blank">관리자</a></div><?}?> <?php if ($admin_href) { ?>
<div class="adm-box"><a href="<?= $admin_href ?>" class="ui-btn admin" target="_blank">관리자</a></div><?php } ?>
<div class="ui-memo-list theme-box "> <div class="ui-memo-list theme-box ">
<div class="ui-top"><? if ($write_href) { <div class="ui-top"><?php if ($write_href) {
?><div class="ui-write-area"> ?>
<? include ($board_skin_path."/write.php"); ?> <div class="ui-write-area">
</div><? } <?php include $board_skin_path . "/write.php"; ?>
?><div class="search-box"> </div><?php }
?>
<div class="search-box">
<form name="fsearch" method="get" style="margin:0px;"> <form name="fsearch" method="get" style="margin:0px;">
<input type="hidden" name="bo_table" value="<?= $bo_table ?>"> <input type="hidden" name="bo_table" value="<?= $bo_table ?>">
<input type="hidden" name="sca" value="<?= $sca ?>"> <input type="hidden" name="sca" value="<?= $sca ?>">
<input type="hidden" name="sfl" value='wr_subject||wr_content'> <input type="hidden" name="sfl" value='wr_subject||wr_content'>
<input type="hidden" name="sop" value="and"> <input type="hidden" name="sop" value="and">
<input type="text" name="stx" itemname="검색어" value="<?=$stx?>" ><??><button type="submit" class="ui-btn">?</button> <input type="text" name="stx" itemname="검색어" value="<?= $stx ?>">
<?php ?><button type="submit" class="ui-btn">?</button>
</form> </form>
</div></div> </div>
</div>
<hr class="line"> <hr class="line">
<ul> <ul>
<? <?php
$lists = array(); $lists = array();
for ($i=0; $i<count($list); $i++) { $lists[$i] = $list[$i]; } for ($i = 0; $i < count($list); $i++) {
$lists[$i] = $list[$i];
}
for ($ii = 0; $ii < count($lists); $ii++) { for ($ii = 0; $ii < count($lists); $ii++) {
@ -78,58 +88,73 @@ if($board['bo_table_width']==0) $width="100%";
<div class="memo-content content-area"> <div class="memo-content content-area">
<em><?php if ($is_checkbox) { ?> <em><?php if ($is_checkbox) { ?>
<input type="checkbox" name="chk_id_<?php echo $lists[$ii]['wr_id'] ?>" value="<?php echo $lists[$ii]['wr_id'] ?>" class="chk_id"> <input type="checkbox" name="chk_id_<?php echo $lists[$ii]['wr_id'] ?>"
value="<?php echo $lists[$ii]['wr_id'] ?>" class="chk_id">
<?php } ?> <?php } ?>
</em> </em>
<? if($lists[$ii]['is_notice']) { ?> <?php if ($lists[$ii]['is_notice']) { ?>
<strong class="txt-point notice">!</strong> <strong class="txt-point notice">!</strong>
<? } else { ?> <?php } else { ?>
<strong class="txt-point date"><?= date('Y/m/d', strtotime($lists[$ii]['wr_datetime'])) ?></strong> <strong class="txt-point date"><?= date('Y/m/d', strtotime($lists[$ii]['wr_datetime'])) ?></strong>
<? } ?> <?php } ?>
<? <?php
if (strstr($lists[$ii]['wr_option'], 'secret') && !$is_admin && !$is_open) { if (strstr($lists[$ii]['wr_option'], 'secret') && !$is_admin && !$is_open) {
?> ?>
<a href="#" class="write_open secret ui-btn">***</a><p class="pass_in"><input type="password" name="wr_password" id="wr_password_<?=$ii?>" value="" placeholder="비밀번호"/> <a href="#" class="write_open secret ui-btn">***</a>
<button type="submit" class="ui-btn">입력</button></p> <p class="pass_in"><input type="password" name="wr_password" id="wr_password_<?= $ii ?>" value=""
<? } else { placeholder="비밀번호" />
if ($member['mb_level'] >= $board['bo_comment_level']) $is_comment_write = true; <button type="submit" class="ui-btn">입력</button>
</p>
<?php } else {
if ($member['mb_level'] >= $board['bo_comment_level'])
$is_comment_write = true;
if ($board['bo_comment_write'] <= $member['mb_level']) if ($board['bo_comment_write'] <= $member['mb_level'])
$is_comment_write = true; ?> $is_comment_write = true; ?>
<? if(strstr($lists[$ii]['wr_option'], 'secret')) { <?php if (strstr($lists[$ii]['wr_option'], 'secret')) {
?> ?>
&nbsp;<span class="txt-point">***</span>&nbsp;&nbsp; &nbsp;<span class="txt-point">***</span>&nbsp;&nbsp;
<? } ?> <?php } ?>
<span class="con"> <span class="con">
<?= $lists[$ii]['content'] ?> <?= $lists[$ii]['content'] ?>
<? echo $secret_msg; ?> <?php echo $secret_msg; ?>
</span> </span>
<? } ?> <?php } ?>
<p class="control"><?
<p class="control">
<?php
if ($is_comment_write) { if ($is_comment_write) {
?><a href="javascript:comment_wri('comment_write', '<?=$lists[$ii]['wr_id']?>');">+</a><? ?><a href="javascript:comment_wri('comment_write', '<?= $lists[$ii]['wr_id'] ?>');">+</a>
} if(($member['mb_id'] && ($member['mb_id'] == $lists[$ii]['mb_id'])) || $is_admin) { <?php
if($update_href){?><a href="<?=$update_href?>">*</a><?}
?><a href="<?=$delete_href?>">-</a><?
} else if (!$lists[$ii]['mb_id']) {
?><a href="<?=$delete_href?>">-</a><?
} }
?> </p> if (($member['mb_id'] && ($member['mb_id'] == $lists[$ii]['mb_id'])) || $is_admin) {
if ($update_href) { ?><a href="<?= $update_href ?>">*</a>
<?php }
?><a href="<?= $delete_href ?>">-</a>
<?php
} else if (!$lists[$ii]['mb_id']) {
?><a href="<?= $delete_href ?>">-</a>
<?php
}
?>
</p>
</div> </div>
</form> </form>
<? <?php
if (strstr($lists[$ii]['wr_option'], 'secret') && !$is_admin && !$is_open) { if (strstr($lists[$ii]['wr_option'], 'secret') && !$is_admin && !$is_open) {
if ($lists[$ii]['wr_comment'] == 1) { ?> if ($lists[$ii]['wr_comment'] == 1) { ?>
<?} <?php }
} else { } else {
$wr_id = $lists[$ii]['wr_id']; $wr_id = $lists[$ii]['wr_id'];
include($board_skin_path."/view_comment.php"); include $board_skin_path . "/view_comment.php";
} }
?> ?>
<hr class="line"> <hr class="line">
</li> </li>
<? } <?php }
?> ?>
<? if (count($lists) == 0) { echo "<li class='no-data'>내역이 없습니다.</li>"; } ?> <?php if (count($lists) == 0) {
echo "<li class='no-data'>내역이 없습니다.</li>";
} ?>
</ul> </ul>
<?php if ($is_checkbox) { ?> <?php if ($is_checkbox) { ?>
<hr class="line"> <hr class="line">
@ -148,18 +173,21 @@ if($board['bo_table_width']==0) $width="100%";
<input type="hidden" name="btn_submit" value=""> <input type="hidden" name="btn_submit" value="">
</form> </form>
<?if($is_checkbox && count($lists)>0){?> <?php if ($is_checkbox && count($lists) > 0) { ?>
<span class="chkall"><input type="checkbox" id="chkall" onclick="if (this.checked) all_checked(true); else all_checked(false);"> <span class="chkall"><input type="checkbox" id="chkall"
onclick="if (this.checked) all_checked(true); else all_checked(false);">
</span> </span>
<?}?> <?php } ?>
<input type="submit" name="btn_submit" value="선택삭제" onclick="select_delete();" class="ui-btn small admin"> <input type="submit" name="btn_submit" value="선택삭제" onclick="select_delete();" class="ui-btn small admin">
<input type="submit" name="btn_submit" value="선택복사" onclick="select_copy('copy');" class="ui-btn small admin"> <input type="submit" name="btn_submit" value="선택복사" onclick="select_copy('copy');"
<input type="submit" name="btn_submit" value="선택이동" onclick="select_copy('move');" class="ui-btn small admin"> class="ui-btn small admin">
<input type="submit" name="btn_submit" value="선택이동" onclick="select_copy('move');"
class="ui-btn small admin">
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
<!-- 페이지 --> <!-- 페이지 -->
<? echo $write_pages; ?> <?php echo $write_pages; ?>
</div> </div>
<script language="JavaScript"> <script language="JavaScript">
@ -199,7 +227,7 @@ function mod_comment(co_id) {
} }
</script> </script>
<? if ($is_checkbox) { ?> <?php if ($is_checkbox) { ?>
<script> <script>
var count = 0; var count = 0;
@ -231,8 +259,7 @@ function all_checked(sw) {
} }
function check_confirm(str) function check_confirm(str) {
{
var f = $('.chkd'); var f = $('.chkd');
var chk_count = 0; var chk_count = 0;
@ -250,8 +277,7 @@ function check_confirm(str)
} }
// 선택한 게시물 삭제 // 선택한 게시물 삭제
function select_delete() function select_delete() {
{
var f = document.fchecklist; var f = document.fchecklist;
str = "삭제"; str = "삭제";
@ -267,8 +293,7 @@ function select_delete()
} }
// 선택한 게시물 복사 및 이동 // 선택한 게시물 복사 및 이동
function select_copy(sw) function select_copy(sw) {
{
var f = document.fchecklist; var f = document.fchecklist;
if (sw == "copy") if (sw == "copy")
@ -288,8 +313,9 @@ function select_copy(sw)
f.submit(); f.submit();
} }
</script> </script>
<? } ?> <?php } ?>
<form name="modify_comment" id="frm_modify_comment" action="./write_comment_update.php" method="post" autocomplete="off"> <form name="modify_comment" id="frm_modify_comment" action="./write_comment_update.php" method="post"
autocomplete="off">
<input type="hidden" name="w" value="cu"> <input type="hidden" name="w" value="cu">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>"> <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sca" value="<?php echo $sca ?>"> <input type="hidden" name="sca" value="<?php echo $sca ?>">

View file

@ -1,10 +1,8 @@
<?php <?php
include_once('./_common.php'); include_once './_common.php';
if ($_POST['wr_password']) { if ($_POST['wr_password']) {
set_cookie('read_' . $_POST['wr_idx'], sql_password($_POST['wr_password']), 3600); set_cookie('read_' . $_POST['wr_idx'], sql_password($_POST['wr_password']), 3600);
} }
goto_url(G5_HTTP_BBS_URL . '/board.php?bo_table=' . $bo_table . '&amp;wr_id=' . $wr_id . $qstr); goto_url(G5_HTTP_BBS_URL . '/board.php?bo_table=' . $bo_table . '&amp;wr_id=' . $wr_id . $qstr);
?>

View file

@ -1,7 +1,7 @@
<? <?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
exit;
set_session("ss_delete_token", $token = uniqid(time())); set_session("ss_delete_token", $token = uniqid(time()));
goto_url("./board.php?bo_table=$bo_table" . $qstr); goto_url("./board.php?bo_table=$bo_table" . $qstr);
?>

View file

@ -1,13 +1,13 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 if (!defined('_GNUBOARD_'))
exit;
$list = array(); $list = array();
// 코멘트 출력 // 코멘트 출력
$sql = " select * from {$write_table} where wr_parent = '{$wr_id}' and wr_is_comment = 1 order by wr_comment, 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); $result = sql_query($sql);
for ($i=0; $c_row=sql_fetch_array($result); $i++) for ($i = 0; $c_row = sql_fetch_array($result); $i++) {
{
$list[$i] = $c_row; $list[$i] = $c_row;
//$list[$i]['name'] = get_sideview($c_row['mb_id'], cut_str($c_row['wr_name'], 20, ''), $c_row['wr_email'], $c_row['wr_homepage']); //$list[$i]['name'] = get_sideview($c_row['mb_id'], cut_str($c_row['wr_name'], 20, ''), $c_row['wr_email'], $c_row['wr_homepage']);
@ -24,10 +24,12 @@ for ($i=0; $c_row=sql_fetch_array($result); $i++)
//$list[$i]['content'] = eregi_replace("[^ \n<>]{130}", "\\0\n", $c_row['wr_content']); //$list[$i]['content'] = eregi_replace("[^ \n<>]{130}", "\\0\n", $c_row['wr_content']);
$list[$i]['content'] = $list[$i]['content1'] = '비밀글 입니다.'; $list[$i]['content'] = $list[$i]['content1'] = '비밀글 입니다.';
if (!strstr($c_row['wr_option'], 'secret') || if (
!strstr($c_row['wr_option'], 'secret') ||
$is_admin || $is_admin ||
($write['mb_id'] == $member['mb_id'] && $member['mb_id']) || ($write['mb_id'] == $member['mb_id'] && $member['mb_id']) ||
($c_row['mb_id']==$member['mb_id'] && $member['mb_id'])) { ($c_row['mb_id'] == $member['mb_id'] && $member['mb_id'])
) {
$list[$i]['content1'] = $c_row['wr_content']; $list[$i]['content1'] = $c_row['wr_content'];
$list[$i]['content'] = conv_content($c_row['wr_content'], 0, 'wr_content'); $list[$i]['content'] = conv_content($c_row['wr_content'], 0, 'wr_content');
$list[$i]['content'] = search_font($stx, $list[$i]['content']); $list[$i]['content'] = search_font($stx, $list[$i]['content']);
@ -52,22 +54,17 @@ for ($i=0; $c_row=sql_fetch_array($result); $i++)
$list[$i]['is_reply'] = false; $list[$i]['is_reply'] = false;
$list[$i]['is_edit'] = false; $list[$i]['is_edit'] = false;
$list[$i]['is_del'] = false; $list[$i]['is_del'] = false;
if ($is_comment_write || $is_admin) if ($is_comment_write || $is_admin) {
{
$token = ''; $token = '';
if ($member['mb_id']) if ($member['mb_id']) {
{ if ($c_row['mb_id'] == $member['mb_id'] || $is_admin) {
if ($c_row['mb_id'] == $member['mb_id'] || $is_admin)
{
set_session('ss_delete_comment_' . $c_row['wr_id'] . '_token', $token = uniqid(time())); set_session('ss_delete_comment_' . $c_row['wr_id'] . '_token', $token = uniqid(time()));
$list[$i]['del_link'] = './delete_comment.php?bo_table=' . $bo_table . '&amp;comment_id=' . $c_row['wr_id'] . '&amp;token=' . $token . '&amp;page=' . $page . $qstr; $list[$i]['del_link'] = './delete_comment.php?bo_table=' . $bo_table . '&amp;comment_id=' . $c_row['wr_id'] . '&amp;token=' . $token . '&amp;page=' . $page . $qstr;
$list[$i]['is_edit'] = true; $list[$i]['is_edit'] = true;
$list[$i]['is_del'] = true; $list[$i]['is_del'] = true;
} }
} } else {
else
{
if (!$c_row['mb_id']) { if (!$c_row['mb_id']) {
$list[$i]['del_link'] = './password.php?w=x&amp;bo_table=' . $bo_table . '&amp;comment_id=' . $c_row['wr_id'] . '&amp;page=' . $page . $qstr; $list[$i]['del_link'] = './password.php?w=x&amp;bo_table=' . $bo_table . '&amp;comment_id=' . $c_row['wr_id'] . '&amp;page=' . $page . $qstr;
$list[$i]['is_del'] = true; $list[$i]['is_del'] = true;
@ -80,13 +77,10 @@ for ($i=0; $c_row=sql_fetch_array($result); $i++)
// 05.05.22 // 05.05.22
// 답변있는 코멘트는 수정, 삭제 불가 // 답변있는 코멘트는 수정, 삭제 불가
if ($i > 0 && !$is_admin) if ($i > 0 && !$is_admin) {
{ if ($c_row['wr_comment_reply']) {
if ($c_row['wr_comment_reply'])
{
$tmp_comment_reply = substr($c_row['wr_comment_reply'], 0, strlen($c_row['wr_comment_reply']) - 1); $tmp_comment_reply = substr($c_row['wr_comment_reply'], 0, strlen($c_row['wr_comment_reply']) - 1);
if ($tmp_comment_reply == $list[$i-1]['wr_comment_reply']) if ($tmp_comment_reply == $list[$i - 1]['wr_comment_reply']) {
{
$list[$i - 1]['is_edit'] = false; $list[$i - 1]['is_edit'] = false;
$list[$i - 1]['is_del'] = false; $list[$i - 1]['is_del'] = false;
} }
@ -95,16 +89,11 @@ for ($i=0; $c_row=sql_fetch_array($result); $i++)
} }
// 코멘트수 제한 설정값 // 코멘트수 제한 설정값
if ($is_admin) if ($is_admin) {
{
$comment_min = $comment_max = 0; $comment_min = $comment_max = 0;
} } else {
else
{
$comment_min = (int) $board['bo_comment_min']; $comment_min = (int) $board['bo_comment_min'];
$comment_max = (int) $board['bo_comment_max']; $comment_max = (int) $board['bo_comment_max'];
} }
include($board_skin_path.'/view_comment.skin.php'); include $board_skin_path . '/view_comment.skin.php';
?>

View file

@ -1,5 +1,6 @@
<? <?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
exit;
?> ?>
<script language="JavaScript"> <script language="JavaScript">
@ -10,12 +11,14 @@ var char_max = parseInt(<?=$comment_max?>); // 최대
<!-- 코멘트 쓰기 --> <!-- 코멘트 쓰기 -->
<? if ($is_comment_write) { <?php if ($is_comment_write) {
if($w == '') $w = 'c'; if ($w == '')
$w = 'c';
?> ?>
<div class="ui-write-area" id="comment_write<?= $lists[$ii]['wr_id'] ?>" style="display:none;"> <div class="ui-write-area" id="comment_write<?= $lists[$ii]['wr_id'] ?>" style="display:none;">
<!-- 코멘트 입력테이블시작 --> <!-- 코멘트 입력테이블시작 -->
<form name="fviewcomment" action="<?=G5_BBS_URL?>/write_comment_update.php" method="post" enctype="multipart/form-data" autocomplete="off"> <form name="fviewcomment" action="<?= G5_BBS_URL ?>/write_comment_update.php" method="post"
enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="w" value="<?php echo $w ?>"> <input type="hidden" name="w" value="<?php echo $w ?>">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>"> <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<?php echo $lists[$ii]['wr_id'] ?>"> <input type="hidden" name="wr_id" value="<?php echo $lists[$ii]['wr_id'] ?>">
@ -29,18 +32,20 @@ var char_max = parseInt(<?=$comment_max?>); // 최대
<input type="text" name="wr_content" required class="frm-input full" value="<?= $list[$i]['wr_content'] ?>"> <input type="text" name="wr_content" required class="frm-input full" value="<?= $list[$i]['wr_content'] ?>">
<button type="submit" class="ui-btn" accesskey='s'>입력</button> <button type="submit" class="ui-btn" accesskey='s'>입력</button>
</p> </p>
<?if(!$is_member && $is_comment_write){?> <?php if (!$is_member && $is_comment_write) { ?>
<p> <p>
<input type="text" name="wr_name" placeholder="이름" value="<?=$_COOKIE['MMB_NAME']?>" style="max-width:40%" /> <input type="text" name="wr_name" placeholder="이름" value="<?= $_COOKIE['MMB_NAME'] ?>"
<input type="password" name="wr_password" value="<?=$_COOKIE['MMB_PW']?>" placeholder="비밀번호" style="max-width:40%" /> style="max-width:40%" />
<input type="password" name="wr_password" value="<?= $_COOKIE['MMB_PW'] ?>" placeholder="비밀번호"
style="max-width:40%" />
</p> </p>
<?}?> <?php } ?>
</form> </form>
</div> </div>
<? } ?> <?php } ?>
<ul> <ul>
<!-- 코멘트 리스트 --> <!-- 코멘트 리스트 -->
<? <?php
for ($i = 0; $i < count($list); $i++) { for ($i = 0; $i < count($list); $i++) {
$comment_id = $list[$i]['wr_id']; $comment_id = $list[$i]['wr_id'];
?> ?>
@ -50,8 +55,9 @@ for ($i=0; $i<count($list); $i++) {
<em></em> <em></em>
<span class="date"><?= date("Y/m/d", strtotime($list[$i]['wr_datetime'])) ?></span> <span class="date"><?= date("Y/m/d", strtotime($list[$i]['wr_datetime'])) ?></span>
<!-- 코멘트 출력 --> <!-- 코멘트 출력 -->
<? <?php
if (strstr($list[$i]['wr_option'], "secret")) echo "<span style='color:#ff6600;'>*</span> "; if (strstr($list[$i]['wr_option'], "secret"))
echo "<span style='color:#ff6600;'>*</span> ";
$str = $list[$i]['content']; $str = $list[$i]['content'];
if (strstr($list[$i]['wr_option'], "secret")) if (strstr($list[$i]['wr_option'], "secret"))
$str = "<span style='color:#ff6600;'>$str</span>"; $str = "<span style='color:#ff6600;'>$str</span>";
@ -74,28 +80,36 @@ for ($i=0; $i<count($list); $i++) {
$c_edit_href = './board.php?' . $query_string . '&amp;comment_id=' . $comment_id . '&amp;wr_id=' . $wr_id . 'w=cu'; $c_edit_href = './board.php?' . $query_string . '&amp;comment_id=' . $comment_id . '&amp;wr_id=' . $wr_id . 'w=cu';
?> ?>
<? if ($list[$i]['is_edit']||$list[$i]['is_del']) { ?> <?php if ($list[$i]['is_edit'] || $list[$i]['is_del']) { ?>
<p class="control"><? <p class="control">
if ($list[$i]['is_edit']) { ?><a href="javascript:comment_box('<? echo $comment_id ?>', '<?=$list[$ii]['wr_id']?>');" >*</a><? } <?php
if ($list[$i]['is_del']) { echo "<a href=\"javascript:comment_delete('{$list[$i]['del_link']}');\">-</a>"; } if ($list[$i]['is_edit']) { ?><a
?></p> href="javascript:comment_box('<?php echo $comment_id ?>', '<?= $list[$ii]['wr_id'] ?>');">*</a>
<?}?> <?php }
<span id="edit_<? echo $comment_id ?>"></span><!-- 수정 --> if ($list[$i]['is_del']) {
echo "<a href=\"javascript:comment_delete('{$list[$i]['del_link']}');\">-</a>";
}
?>
</p>
<?php } ?>
<span id="edit_<?php echo $comment_id ?>"></span><!-- 수정 -->
<input type="hidden" value="<? echo strstr($list[$i]['wr_option'],"secret") ?>" id="secret_comment_<? echo $comment_id ?>"> <input type="hidden" value="<?php echo strstr($list[$i]['wr_option'], "secret") ?>"
<input type="text" id="save_comment_<? echo $comment_id ?>" style="display:none" value="<? echo get_text($list[$i]['content1'], 0) ?>"> id="secret_comment_<?php echo $comment_id ?>">
<input type="text" id="save_comment_<?php echo $comment_id ?>" style="display:none"
value="<?php echo get_text($list[$i]['content1'], 0) ?>">
</div> </div>
<? if ($list[$i]['is_edit']) { ?> <?php if ($list[$i]['is_edit']) { ?>
<div class="modify_area ui-text-area" id="save_comment_<?php echo $comment_id ?>" style="display:none;"> <div class="modify_area ui-text-area" id="save_comment_<?php echo $comment_id ?>" style="display:none;">
<input type="text" id="save_co_comment_<?php echo $comment_id ?>" value="<?php echo get_text($list[$i]['wr_content'], 0) ?>" class="full"> <input type="text" id="save_co_comment_<?php echo $comment_id ?>"
<p class="txt-right"><button type="button" class="mod_comment ui-btn" onclick="mod_comment('<?php echo $comment_id ?>')">수정</button></p> value="<?php echo get_text($list[$i]['wr_content'], 0) ?>" class="full">
<p class="txt-right"><button type="button" class="mod_comment ui-btn"
onclick="mod_comment('<?php echo $comment_id ?>')">수정</button></p>
</div> </div>
<? } ?> <?php } ?> </li>
</li> <?php } ?>
<? } ?>
</ul> </ul>
<? <?php
include_once("$board_skin_path/view_skin_js.php"); include_once "$board_skin_path/view_skin_js.php";
?>

View file

@ -6,8 +6,7 @@ function comment_wri(name, id) {
layer.style.display = (layer.style.display == "none") ? "block" : "none"; layer.style.display = (layer.style.display == "none") ? "block" : "none";
} }
function comment_delete(url) function comment_delete(url) {
{
if (confirm("이 코멘트를 삭제하시겠습니까?")) location.href = url; if (confirm("이 코멘트를 삭제하시겠습니까?")) location.href = url;
} }
</script> </script>

View file

@ -1,6 +1,6 @@
<?php <?php
include_once('./_common.php'); include_once './_common.php';
include_once(G5_EDITOR_LIB); include_once G5_EDITOR_LIB;
if (!$board['bo_table']) { if (!$board['bo_table']) {
alert('존재하지 않는 게시판입니다.', G5_URL); alert('존재하지 않는 게시판입니다.', G5_URL);
@ -66,7 +66,8 @@ if ($w == '') {
} }
$len = strlen($write['wr_reply']); $len = strlen($write['wr_reply']);
if ($len < 0) $len = 0; if ($len < 0)
$len = 0;
$reply = substr($write['wr_reply'], 0, $len); $reply = substr($write['wr_reply'], 0, $len);
// 원글만 구한다. // 원글만 구한다.
@ -144,7 +145,8 @@ if ($w == '') {
$reply_number = -1; $reply_number = -1;
$sql = " select MIN(SUBSTRING(wr_reply, {$reply_len}, 1)) as reply from {$write_table} where wr_num = '{$reply_array['wr_num']}' and SUBSTRING(wr_reply, {$reply_len}, 1) <> '' "; $sql = " select MIN(SUBSTRING(wr_reply, {$reply_len}, 1)) as reply from {$write_table} where wr_num = '{$reply_array['wr_num']}' and SUBSTRING(wr_reply, {$reply_len}, 1) <> '' ";
} }
if ($reply_array['wr_reply']) $sql .= " and wr_reply like '{$reply_array['wr_reply']}%' "; if ($reply_array['wr_reply'])
$sql .= " and wr_reply like '{$reply_array['wr_reply']}%' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
if (!$row['reply']) if (!$row['reply'])
@ -203,12 +205,9 @@ if ($config['cf_cert_use'] && !$is_admin) {
} }
// 글자수 제한 설정값 // 글자수 제한 설정값
if ($is_admin || $board['bo_use_dhtml_editor']) if ($is_admin || $board['bo_use_dhtml_editor']) {
{
$write_min = $write_max = 0; $write_min = $write_max = 0;
} } else {
else
{
$write_min = (int) $board['bo_write_min']; $write_min = (int) $board['bo_write_min'];
$write_max = (int) $board['bo_write_max']; $write_max = (int) $board['bo_write_max'];
} }
@ -408,6 +407,4 @@ $autosave_count = autosave_count($member['mb_id']);
$action_url = https_url(G5_BBS_DIR) . "/write_update.php"; $action_url = https_url(G5_BBS_DIR) . "/write_update.php";
echo '<!-- skin : ' . (G5_IS_MOBILE ? $board['bo_mobile_skin'] : $board['bo_skin']) . ' -->'; echo '<!-- skin : ' . (G5_IS_MOBILE ? $board['bo_mobile_skin'] : $board['bo_skin']) . ' -->';
include_once ($board_skin_path.'/write.skin.php'); include_once $board_skin_path . '/write.skin.php';
?>

View file

@ -1,5 +1,6 @@
<? <?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
exit;
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0); add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
$option = ''; $option = '';
@ -34,7 +35,8 @@ if ($is_notice || $is_html || $is_secret || $is_mail) {
echo $option_hidden; echo $option_hidden;
?> ?>
<form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off"> <form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);" method="post"
enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>"> <input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>">
<input type="hidden" name="w" value="<?php echo $w ?>"> <input type="hidden" name="w" value="<?php echo $w ?>">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>"> <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
@ -52,11 +54,14 @@ echo $option_hidden;
<a href="#" class="write_open ui-btn point">+</a> <a href="#" class="write_open ui-btn point">+</a>
<p> <p>
<input type="text" name="wr_content" id="content" class="frm-input full" required value="<?= $content ?>"> <input type="text" name="wr_content" id="content" class="frm-input full" required value="<?= $content ?>">
<button type="submit" id="btn_submit" class="ui-btn" accesskey='s'>입력</button><?if($w=='u'){?><a href="<?=G5_BBS_URL?>/board.php?bo_table=<?=$bo_table?>" class="ui-btn etc">뒤로</a><?}?> <button type="submit" id="btn_submit" class="ui-btn" accesskey='s'>입력</button><?php if ($w == 'u') { ?><a
<? if(!$is_member){ ?> href="<?= G5_BBS_URL ?>/board.php?bo_table=<?= $bo_table ?>" class="ui-btn etc">뒤로</a><?php } ?>
<input type="text" maxlength="20" name="wr_name" id="wr_name" placeholder="이름" required value="<?=$name?>" /> <?php if (!$is_member) { ?>
<input type="password" maxlength="20" id="wr_password" name="wr_password" placeholder="비밀번호" value="<?=$password?>" <?=$password_required?> /> <input type="text" maxlength="20" name="wr_name" id="wr_name" placeholder="이름" required
<? } ?> value="<?= $name ?>" />
<input type="password" maxlength="20" id="wr_password" name="wr_password" placeholder="비밀번호"
value="<?= $password ?>" <?= $password_required ?> />
<?php } ?>
<?php if ($option) { ?> <?php if ($option) { ?>
&nbsp;&nbsp;<?php echo $option ?> &nbsp;&nbsp;<?php echo $option ?>
<?php } ?> <?php } ?>
@ -79,8 +84,7 @@ $(function() {
<?php } ?> <?php } ?>
function fwrite_submit(f) function fwrite_submit(f) {
{
return true; return true;
} }
</script> </script>

View file

@ -1,6 +1,6 @@
<? <?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
exit;
// 자신만의 코드를 넣어주세요. // 자신만의 코드를 넣어주세요.
goto_url("./board.php?bo_table=$bo_table"); goto_url("./board.php?bo_table=$bo_table");
?>