This commit is contained in:
Amberstone 2024-10-22 17:40:53 +09:00
parent f41e566400
commit 75ea133f82
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
9 changed files with 747 additions and 723 deletions

View file

@ -1,4 +1,2 @@
<?php
include_once('../../../common.php');
?>

View file

@ -1,94 +1,105 @@
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
if($board['bo_table_width']==0) $width="100%";
if (!defined('_GNUBOARD_'))
exit; // 개별 페이지 접근 불가
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
include_once(G5_LIB_PATH . '/thumbnail.lib.php');
if ($board['bo_table_width'] == 0)
$width = "100%";
$cate=array();
$lists=array();
$cate = array();
$lists = array();
?>
<div class="board-skin-basic theme-box" style="max-width:<?=$width?>;">
<? if($board['bo_content_head']) { ?>
<div class="content_head">
<?=stripslashes($board['bo_content_head']);?>
</div>
<? } ?>
<?
if($is_category) {
$cate=explode('|',$board['bo_category_list']);
}
for($h=0;$h<=count($cate);$h++){
if(count($cate)>0 && $h==count($cate)) continue;
$list_item=sql_query("select * from {$write_table} where wr_reply='' and wr_is_comment=0 order by wr_10*1, wr_id");
<div class="board-skin-basic theme-box" style="max-width:<?= $width ?>;">
<? if ($board['bo_content_head']) { ?>
<div class="content_head">
<?= stripslashes($board['bo_content_head']); ?>
</div>
<? } ?>
<?
if ($is_category) {
$cate = explode('|', $board['bo_category_list']);
}
for ($h = 0; $h <= count($cate); $h++) {
if (count($cate) > 0 && $h == count($cate))
continue;
$list_item = sql_query("select * from {$write_table} where wr_reply='' and wr_is_comment=0 order by wr_10*1, wr_id");
for($k=0;$row=sql_fetch_array($list_item);$k++){
$lists[$k]=get_list($row,$board,$board_skin_url);
}
?>
<div class="bo_list">
<?if($is_category){?><h2><?=$cate[$h]?></h2><?}?>
<ul class="list_box"><?
if(count($lists)>0){
for ($i=0; $i<count($lists); $i++) {
// 수정, 삭제 링크
$update_href = $delete_href = "";
// 로그인중이고 자신의 글이라면 또는 관리자라면 패스워드를 묻지 않고 바로 수정, 삭제 가능
if (($member['mb_id'] && ($member['mb_id'] == $lists[$i]['mb_id'])) || $is_admin) {
$update_href = "./write.php?w=u&bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&page=$page" . $qstr;
$delete_href = "javascript:del('./delete.php?bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&page=$page".urldecode($qstr)."');";
if ($is_admin)
{
$delete_href = "javascript:del('./delete.php?bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&token=$token&page=$page".urldecode($qstr)."');";
}
}
else if (!$lists[$i]['mb_id']) { // 회원이 쓴 글이 아니라면
$update_href = "./password.php?w=u&bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&page=$page" . $qstr;
$delete_href = "./password.php?w=d&bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&page=$page" . $qstr;
}
for ($k = 0; $row = sql_fetch_array($list_item); $k++) {
$lists[$k] = get_list($row, $board, $board_skin_url);
}
?>
<div class="bo_list">
<? if ($is_category) { ?>
<h2><?= $cate[$h] ?></h2><? } ?>
<ul class="list_box">
<?
if (count($lists) > 0) {
for ($i = 0; $i < count($lists); $i++) {
// 수정, 삭제 링크
$update_href = $delete_href = "";
// 로그인중이고 자신의 글이라면 또는 관리자라면 패스워드를 묻지 않고 바로 수정, 삭제 가능
if (($member['mb_id'] && ($member['mb_id'] == $lists[$i]['mb_id'])) || $is_admin) {
$update_href = "./write.php?w=u&bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&page=$page" . $qstr;
$delete_href = "javascript:del('./delete.php?bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&page=$page" . urldecode($qstr) . "');";
if ($is_admin) {
$delete_href = "javascript:del('./delete.php?bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&token=$token&page=$page" . urldecode($qstr) . "');";
}
} else if (!$lists[$i]['mb_id']) { // 회원이 쓴 글이 아니라면
$update_href = "./password.php?w=u&bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&page=$page" . $qstr;
$delete_href = "./password.php?w=d&bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&page=$page" . $qstr;
}
if($is_category) {
if(($lists[$i]['ca_name']!=$cate[$h]) || ($sca && $lists[$i]['ca_name']!=$sca)) continue;
}
?><li class="bo-list">
<a href="<?=$lists[$i]['wr_link2'] ? $lists[$i]['wr_link2'] : "javascript:void(0);"?>" target="_blank" class="link-banner <?if(strstr($lists[$i]['wr_option'],'secret')) echo "secret";?>" <?if(!$lists[$i]['wr_link2']){?>style="cursor:default;" onclick="return false;"<?}?>>
<?if($lists[$i]['wr_link1']){?><img src="<?=$lists[$i]['wr_link1']?>" alt="<?=$lists[$i]['wr_1']?>"><?}else{?><strong><?=$lists[$i]['wr_1']?></strong><?}?>
</a>
<p class="link-desc">
<?if($lists[$i]['wr_1']&&$lists[$i]['wr_link1']){?>
<a href="<?=$lists[$i]['wr_link2'] ? $lists[$i]['wr_link2'] : "javascript:void(0);"?>" target="_blank" <?if(!$lists[$i]['wr_link2']){?>style="cursor:default;" onclick="return false;"<?}?> class="name">
<strong>
<?=$lists[$i]['wr_1']?>
</strong>
</a>
<?}?>
<?if($update_href || $delete_href){?>
<span class="options">
<?if($update_href){?><a href="<?=$update_href?>">*</a><?}?>
<?if($delete_href){?><a href="<?=$delete_href?>">-</a><?}?>
</span>
<?}?>
</p>
</li><? }}?></ul>
</div>
<?}?>
if ($is_category) {
if (($lists[$i]['ca_name'] != $cate[$h]) || ($sca && $lists[$i]['ca_name'] != $sca))
continue;
}
?>
<li class="bo-list">
<a href="<?= $lists[$i]['wr_link2'] ? $lists[$i]['wr_link2'] : "javascript:void(0);" ?>" target="_blank"
class="link-banner <? if (strstr($lists[$i]['wr_option'], 'secret'))
echo "secret"; ?>"
<? if (!$lists[$i]['wr_link2']) { ?>style="cursor:default;" onclick="return false;" <? } ?>>
<? if ($lists[$i]['wr_link1']) { ?><img src="<?= $lists[$i]['wr_link1'] ?>"
alt="<?= $lists[$i]['wr_1'] ?>"><? } else { ?><strong><?= $lists[$i]['wr_1'] ?></strong><? } ?>
</a>
<p class="link-desc">
<? if ($lists[$i]['wr_1'] && $lists[$i]['wr_link1']) { ?>
<a href="<?= $lists[$i]['wr_link2'] ? $lists[$i]['wr_link2'] : "javascript:void(0);" ?>" target="_blank"
<? if (!$lists[$i]['wr_link2']) { ?>style="cursor:default;" onclick="return false;" <? } ?> class="name">
<strong>
<?= $lists[$i]['wr_1'] ?>
</strong>
</a>
<? } ?>
<? if ($update_href || $delete_href) { ?>
<span class="options">
<? if ($update_href) { ?><a href="<?= $update_href ?>">*</a><? } ?>
<? if ($delete_href) { ?><a href="<?= $delete_href ?>">-</a><? } ?>
</span>
<? } ?>
</p>
</li><? }
} ?></ul>
</div>
<? } ?>
<? if($board['bo_content_tail']) { ?>
<div class="content_head">
<?=stripslashes($board['bo_content_tail']);?>
</div>
<? } ?>
<? if ($list_href || $is_checkbox || $write_href) { ?>
<div class="bo_fx txt-right" style="padding: 20px 0;">
<? if ($list_href || $write_href) { ?>
<? if ($list_href) { ?><a href="<? echo $list_href ?>" class="ui-btn">목록</a><? } ?>
<? if ($write_href) { ?>
<a href="<? echo $write_href ?>" class="ui-btn point">링크 추가</a><? } ?>
<? } ?>
<? if($admin_href){?>
<a href="<?=$board_skin_url?>/set_order.php?bo_table=<?=$bo_table?>&write_table=<?=$write_table?>" class="ui-btn">링크 관리</a>
<a href="<?=$admin_href?>" class="ui-btn admin">관리자</a><?}?>
</div>
<? } ?>
</div>
<? if ($board['bo_content_tail']) { ?>
<div class="content_head">
<?= stripslashes($board['bo_content_tail']); ?>
</div>
<? } ?>
<? if ($list_href || $is_checkbox || $write_href) { ?>
<div class="bo_fx txt-right" style="padding: 20px 0;">
<? if ($list_href || $write_href) { ?>
<? if ($list_href) { ?><a href="<? echo $list_href ?>" class="ui-btn">목록</a><? } ?>
<? if ($write_href) { ?>
<a href="<? echo $write_href ?>" class="ui-btn point">링크 추가</a><? } ?>
<? } ?>
<? if ($admin_href) { ?>
<a href="<?= $board_skin_url ?>/set_order.php?bo_table=<?= $bo_table ?>&write_table=<?= $write_table ?>" class="ui-btn">링크
관리</a>
<a href="<?= $admin_href ?>" class="ui-btn admin">관리자</a><? } ?>
</div>
<? } ?> </div>
<!-- } 게시판 목록 -->

View file

@ -1,57 +1,64 @@
<?php
include_once("./_common.php");
include_once(G5_PATH."/head.sub.php");
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
if($board['bo_write_level']<=$member['mb_level']){
?>
<form action="<?=$board_skin_url?>/set_order_update.php" name="orders" method="post" autocomplete="off">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="write_table" value="<?=$write_table?>">
<div style="max-width:1000px;margin:10px auto;">
<table class="theme-form">
<colgroup>
<?if($board['bo_use_category']&&$board['bo_category_list']){?><col style="width:100px;"><?}?>
<col style="width:150px;">
<col>
<col>
<col style="width:80px;">
</colgroup>
<tbody>
<tr>
<?if($board['bo_use_category']&&$board['bo_category_list']){?><th>카테고리</th><?}?>
<th>제목</th>
<th>배너</th>
<th>링크</th>
<th>순서</th>
</tr>
<?
$order=sql_query("select * from {$write_table} order by wr_10*1, wr_id");
for ($i=0;$row=sql_fetch_array($order);$i++){ ?>
<tr>
<?if($board['bo_use_category']&&$board['bo_category_list']){?>
<td><select name="category[<?=$row['wr_id']?>]">
<option value="">카테고리</option>
<?$cate=explode('|',$board['bo_category_list']);
for($h=0;$h<count($cate);$h++){?>
<option value="<?=$cate[$h]?>" <?=$row['ca_name']==$cate[$h] ? "selected": "";?>><?=$cate[$h]?></option>
<?}?>
</select><?}?>
</td>
<td><input type="text" name="subject[<?=$row['wr_id']?>]" value="<?=$row['wr_1']?>" style="width:100%;"></td>
<td><input type="text" name="banner[<?=$row['wr_id']?>]" value="<?=$row['wr_link1']?>" style="width:100%;"></td>
<td><input type="text" name="link[<?=$row['wr_id']?>]" value="<?=$row['wr_link2']?>" style="width:100%;"></td>
<td><input type="text" name="order[<?=$row['wr_id']?>]" value="<?=$row['wr_10']?>" size="4">
<input type="hidden" name="idx[]" value="<?=$row['wr_id']?>">
</td>
</tr>
<? } ?>
</tbody>
</table>
<br>
<div style="float:right;">
<button type="submit" class="ui-btn point">확인</button>
<a href="<?=G5_BBS_URL?>/board.php?bo_table=<?=$bo_table?>" class="ui-btn">목록으로</a>
</div>
</div>
</form>
<?}?>
include_once(G5_PATH . "/head.sub.php");
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
if ($board['bo_write_level'] <= $member['mb_level']) {
?>
<form action="<?= $board_skin_url ?>/set_order_update.php" name="orders" method="post" autocomplete="off">
<input type="hidden" name="bo_table" value="<?= $bo_table ?>">
<input type="hidden" name="write_table" value="<?= $write_table ?>">
<div style="max-width:1000px;margin:10px auto;">
<table class="theme-form">
<colgroup>
<? if ($board['bo_use_category'] && $board['bo_category_list']) { ?>
<col style="width:100px;"><? } ?>
<col style="width:150px;">
<col>
<col>
<col style="width:80px;">
</colgroup>
<tbody>
<tr>
<? if ($board['bo_use_category'] && $board['bo_category_list']) { ?>
<th>카테고리</th><? } ?>
<th>제목</th>
<th>배너</th>
<th>링크</th>
<th>순서</th>
</tr>
<?
$order = sql_query("select * from {$write_table} order by wr_10*1, wr_id");
for ($i = 0; $row = sql_fetch_array($order); $i++) { ?>
<tr>
<? if ($board['bo_use_category'] && $board['bo_category_list']) { ?>
<td><select name="category[<?= $row['wr_id'] ?>]">
<option value="">카테고리</option>
<? $cate = explode('|', $board['bo_category_list']);
for ($h = 0; $h < count($cate); $h++) { ?>
<option value="<?= $cate[$h] ?>" <?= $row['ca_name'] == $cate[$h] ? "selected" : ""; ?>><?= $cate[$h] ?>
</option>
<? } ?>
</select><? } ?>
</td>
<td><input type="text" name="subject[<?= $row['wr_id'] ?>]" value="<?= $row['wr_1'] ?>" style="width:100%;">
</td>
<td><input type="text" name="banner[<?= $row['wr_id'] ?>]" value="<?= $row['wr_link1'] ?>"
style="width:100%;">
</td>
<td><input type="text" name="link[<?= $row['wr_id'] ?>]" value="<?= $row['wr_link2'] ?>" style="width:100%;">
</td>
<td><input type="text" name="order[<?= $row['wr_id'] ?>]" value="<?= $row['wr_10'] ?>" size="4">
<input type="hidden" name="idx[]" value="<?= $row['wr_id'] ?>">
</td>
</tr>
<? } ?>
</tbody>
</table>
<br>
<div style="float:right;">
<button type="submit" class="ui-btn point">확인</button>
<a href="<?= G5_BBS_URL ?>/board.php?bo_table=<?= $bo_table ?>" class="ui-btn">목록으로</a>
</div>
</div>
</form>
<? } ?>

View file

@ -1,18 +1,17 @@
<?php
include_once("./_common.php");
for ($i=0;$i<count($idx);$i++){
$k=$idx[$i];
sql_query("update {$write_table}
for ($i = 0; $i < count($idx); $i++) {
$k = $idx[$i];
sql_query("update {$write_table}
set wr_10 = '{$order[$k]}',
wr_1 = '{$subject[$k]}',
wr_link1='{$banner[$k]}',
wr_link2='{$link[$k]}'
where wr_id='{$k}'
");
if($board['bo_use_category']&&$board['bo_category_list'] && $category[$k]!=''){
sql_query("update {$write_table} set ca_name='{$category[$k]}' where wr_id='{$k}'");
}
if ($board['bo_use_category'] && $board['bo_category_list'] && $category[$k] != '') {
sql_query("update {$write_table} set ca_name='{$category[$k]}' where wr_id='{$k}'");
}
}
goto_url('./set_order.php?bo_table='.$bo_table.'&write_table='.$write_table);
?>
goto_url('./set_order.php?bo_table=' . $bo_table . '&write_table=' . $write_table);

View file

@ -1,31 +1,34 @@
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
if (!defined("_GNUBOARD_"))
exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH . '/thumbnail.lib.php');
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
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($board['bo_table_width']==0) $width="100%";?>
if ($board['bo_table_width'] == 0)
$width = "100%"; ?>
<!-- 링크 버튼 시작 { -->
<div id="bo_v_bot">
<? ob_start(); ?>
<div class="bo_v_com">
<a href="<? echo $list_href ?>" class="ui-btn left">목록</a>
<? if ($update_href) { ?><a href="<? echo $update_href ?>" class="ui-btn">수정</a><? } ?>
<? if ($delete_href) { ?><a href="<? echo $delete_href ?>" class="ui-btn admin" onclick="del(this.href); return false;">삭제</a><? } ?>
<? if ($write_href) { ?><a href="<? echo $write_href ?>" class="ui-btn point">링크 추가</a><? } ?>
</div>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?>
<? ob_start(); ?>
<div class="bo_v_com">
<a href="<? echo $list_href ?>" class="ui-btn left">목록</a>
<? if ($update_href) { ?><a href="<? echo $update_href ?>" class="ui-btn">수정</a><? } ?>
<? if ($delete_href) { ?><a href="<? echo $delete_href ?>" class="ui-btn admin"
onclick="del(this.href); return false;">삭제</a><? } ?>
<? if ($write_href) { ?><a href="<? echo $write_href ?>" class="ui-btn point">링크 추가</a><? } ?>
</div>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?>
</div>
<!-- } 링크 버튼 -->
<div class="board-viewer">
<div class="contents">
<!-- 본문 내용 시작 { -->
<div id="bo_v_con"><? echo get_view_thumbnail($view['content']); ?></div>
<?//echo $view['rich_content']; // {이미지:0} 과 같은 코드를 사용할 경우 ?>
<!-- } 본문 내용 -->
</div>
<div class="contents">
<!-- 본문 내용 시작 { -->
<div id="bo_v_con"><? echo get_view_thumbnail($view['content']); ?></div>
<?//echo $view['rich_content']; // {이미지:0} 과 같은 코드를 사용할 경우 ?>
<!-- } 본문 내용 -->
</div>
</div>
<!-- } 게시글 읽기 -->

View file

@ -1,373 +1,365 @@
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if (!defined('_GNUBOARD_'))
exit; // 개별 페이지 접근 불가
$cmt_link = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_comment=1 and wr_parent='{$wr_id}' and wr_content!='옷장'");
$clo = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_comment=1 and wr_parent='{$wr_id}' and wr_content='옷장'");
$cmt_link = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_comment=1 and wr_parent='{$wr_id}' and wr_content!='옷장'");
$clo = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_comment=1 and wr_parent='{$wr_id}' and wr_content='옷장'");
?>
<div class="board-comment-view">
<script>
// 글자수 제한
var char_min = parseInt(<? echo $comment_min ?>); // 최소
var char_max = parseInt(<? echo $comment_max ?>); // 최대
</script>
<?
if($member['mb_level']>=$board['bo_comment_level']){
?>
<div class="board-comment-list">
<?if($cmt_link['cnt']>0){?>
<strong>로그</strong><?}?>
<?
$cmt_amt = count($list);
for ($i=0; $i<$cmt_amt; $i++) {
if($list[$i]['wr_content']=='옷장') continue;
$comment_id = $list[$i]['wr_id'];
$cmt_depth = ""; // 댓글단계
$cmt_depth = strlen($list[$i]['wr_comment_reply']) * 10;
$comment = $list[$i]['content'];
$comment2 = $list[$i]['content1'];
<script>
// 글자수 제한
var char_min = parseInt(<? echo $comment_min ?>); // 최소
var char_max = parseInt(<? echo $comment_max ?>); // 최대
</script>
<?
if ($member['mb_level'] >= $board['bo_comment_level']) {
?>
<div class="board-comment-list">
<? if ($cmt_link['cnt'] > 0) { ?>
<strong>로그</strong><? } ?>
<?
$cmt_amt = count($list);
for ($i = 0; $i < $cmt_amt; $i++) {
if ($list[$i]['wr_content'] == '옷장')
continue;
$comment_id = $list[$i]['wr_id'];
$cmt_depth = ""; // 댓글단계
$cmt_depth = strlen($list[$i]['wr_comment_reply']) * 10;
$comment = $list[$i]['content'];
$comment2 = $list[$i]['content1'];
$cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결
?>
<div class="item" id="c_<? echo $comment_id ?>">
<div class="co-content">
<div class="co-inner">
<? $co_links=explode(PHP_EOL,$list[$i]['wr_content']);
if(count($co_links)>0){
$co_list=array();
for($k=0;$k<count($co_links);$k++){
$co_list[$k]=explode('|',$co_links[$k]);
$c_link='<a href="'.$co_list[$k][1].'" class="ui-btn" target="_blank">'.$co_list[$k][0].'</a>';
echo $c_link;
}
}
?>
</div>
$cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결
?>
<div class="item" id="c_<? echo $comment_id ?>">
<div class="co-content">
<div class="co-inner">
<? $co_links = explode(PHP_EOL, $list[$i]['wr_content']);
if (count($co_links) > 0) {
$co_list = array();
for ($k = 0; $k < count($co_links); $k++) {
$co_list[$k] = explode('|', $co_links[$k]);
$c_link = '<a href="' . $co_list[$k][1] . '" class="ui-btn" target="_blank">' . $co_list[$k][0] . '</a>';
echo $c_link;
}
}
?>
</div>
<div class="co-info">
<? if($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) {
$query_string = clean_query_string($_SERVER['QUERY_STRING']);
<div class="co-info">
<? if ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) {
$query_string = clean_query_string($_SERVER['QUERY_STRING']);
if($w == 'cu') {
$sql = " select wr_id, wr_content, mb_id from $write_table where wr_id = '$c_id' and wr_is_comment = '1' ";
$cmt = sql_fetch($sql);
if (!($is_admin || ($member['mb_id'] == $cmt['mb_id'] && $cmt['mb_id'])))
$cmt['wr_content'] = '';
$c_wr_content = $cmt['wr_content'];
}
if ($w == 'cu') {
$sql = " select wr_id, wr_content, mb_id from $write_table where wr_id = '$c_id' and wr_is_comment = '1' ";
$cmt = sql_fetch($sql);
if (!($is_admin || ($member['mb_id'] == $cmt['mb_id'] && $cmt['mb_id'])))
$cmt['wr_content'] = '';
$c_wr_content = $cmt['wr_content'];
}
$c_edit_href = './board.php?'.$query_string.'&amp;c_id='.$comment_id.'&amp;w=cu#bo_vc_w';
?>
<? if ($list[$i]['is_edit']) { ?><span><a href="javascript:comment_box('<? echo $comment_id ?>', 'cu','link');">m</a></span><? } ?>
<? if ($list[$i]['is_del']) { ?><span><a href="<? echo $list[$i]['del_link']; ?>" onclick="return comment_delete();">d</a></span><? } ?>
<? } ?>
</div>
$c_edit_href = './board.php?' . $query_string . '&amp;c_id=' . $comment_id . '&amp;w=cu#bo_vc_w';
?>
<? if ($list[$i]['is_edit']) { ?><span><a
href="javascript:comment_box('<? echo $comment_id ?>', 'cu','link');">m</a></span><? } ?>
<? if ($list[$i]['is_del']) { ?><span><a href="<? echo $list[$i]['del_link']; ?>"
onclick="return comment_delete();">d</a></span><? } ?>
<? } ?>
</div>
</div>
</div>
<span id="edit_<? echo $comment_id ?>"></span><!-- 수정 -->
</div>
<span id="edit_<? echo $comment_id ?>"></span><!-- 수정 -->
</div>
<input type="hidden" value="<? echo strstr($list[$i]['wr_option'],"secret") ?>" id="secret_comment_<? echo $comment_id ?>">
<textarea id="save_comment_<? echo $comment_id ?>" style="display:none"><? echo get_text($list[$i]['content1'], 0) ?></textarea>
<input type="hidden" id="save_cl_<?=$comment_id?>" name="bf_content" >
<input type="hidden" id="save_order_<?=$comment_id?>" name="wr_10">
<input type="hidden" value="<? echo strstr($list[$i]['wr_option'], "secret") ?>"
id="secret_comment_<? echo $comment_id ?>">
<textarea id="save_comment_<? echo $comment_id ?>"
style="display:none"><? echo get_text($list[$i]['content1'], 0) ?></textarea>
<input type="hidden" id="save_cl_<?= $comment_id ?>" name="bf_content">
<input type="hidden" id="save_order_<?= $comment_id ?>" name="wr_10">
<? } ?>
<? } ?>
</div>
</div>
<? }
if ($view['mb_id']==$member['mb_id']) {
if($w == '')
$w = 'c';
?>
<? }
if ($view['mb_id'] == $member['mb_id']) {
if ($w == '')
$w = 'c';
?>
<div class="board-clothes-list board-comment-list">
<?if($clo['cnt']>0){?>
<strong>옷장</strong>
<?}?>
<?
$clothes=sql_query("select * from {$write_table} where wr_content='옷장' and wr_parent='{$wr_id}' and wr_is_comment=1 order by wr_10 asc");
for ($k=0;$cl=sql_fetch_array($clothes); $k++) {
$comment_id = $cl['wr_id'];
?>
<div class="item" id="cl_<? echo $comment_id ?>">
<div class="co-content">
<div class="co-inner">
<? $files=get_file($bo_table,$comment_id);
$filelink=G5_DATA_URL.'/file/'.$bo_table.'/'.$files[0]['file']; ?>
<a href="<?=$filelink?>" target="_blank"><?=$files[0]['content']?></a>
<div class="board-clothes-list board-comment-list">
<? if ($clo['cnt'] > 0) { ?>
<strong>옷장</strong>
<? } ?>
<?
$clothes = sql_query("select * from {$write_table} where wr_content='옷장' and wr_parent='{$wr_id}' and wr_is_comment=1 order by wr_10 asc");
for ($k = 0; $cl = sql_fetch_array($clothes); $k++) {
$comment_id = $cl['wr_id'];
?>
<div class="item" id="cl_<? echo $comment_id ?>">
<div class="co-content">
<div class="co-inner">
<? $files = get_file($bo_table, $comment_id);
$filelink = G5_DATA_URL . '/file/' . $bo_table . '/' . $files[0]['file']; ?>
<a href="<?= $filelink ?>" target="_blank"><?= $files[0]['content'] ?></a>
</div>
</div>
<div class="co-info">
<? if($member['mb_id']==$cl['mb_id']) {
$query_string = clean_query_string($_SERVER['QUERY_STRING']);
<div class="co-info">
<? if ($member['mb_id'] == $cl['mb_id']) {
$query_string = clean_query_string($_SERVER['QUERY_STRING']);
if($w == 'cu') {
$sql = " select wr_id, wr_content, mb_id from $write_table where wr_id = '$c_id' and wr_is_comment = '1' ";
$cmt = sql_fetch($sql);
if (!($is_admin || ($member['mb_id'] == $cmt['mb_id'] && $cmt['mb_id'])))
$cmt['wr_content'] = '';
$c_wr_content = $cmt['wr_content'];
}
$token = '';
if ($w == 'cu') {
$sql = " select wr_id, wr_content, mb_id from $write_table where wr_id = '$c_id' and wr_is_comment = '1' ";
$cmt = sql_fetch($sql);
if (!($is_admin || ($member['mb_id'] == $cmt['mb_id'] && $cmt['mb_id'])))
$cmt['wr_content'] = '';
$c_wr_content = $cmt['wr_content'];
}
$token = '';
if ($member['mb_id'])
{
if ($cl['mb_id'] === $member['mb_id'] || $is_admin)
{
set_session('ss_delete_comment_'.$cl['wr_id'].'_token', $token = uniqid(time()));
$cl['del_link'] = './delete_comment.php?bo_table='.$bo_table.'&amp;comment_id='.$cl['wr_id'].'&amp;token='.$token.'&amp;page='.$page.$qstr;
}
}
else
{
if (!$cl['mb_id']) {
$cl['del_link'] = './password.php?w=x&amp;bo_table='.$bo_table.'&amp;comment_id='.$cl['wr_id'].'&amp;page='.$page.$qstr;
}
}
$c_edit_href = './board.php?'.$query_string.'&amp;c_id='.$comment_id.'&amp;w=cu#bo_cl_w';
if ($member['mb_id']) {
if ($cl['mb_id'] === $member['mb_id'] || $is_admin) {
set_session('ss_delete_comment_' . $cl['wr_id'] . '_token', $token = uniqid(time()));
$cl['del_link'] = './delete_comment.php?bo_table=' . $bo_table . '&amp;comment_id=' . $cl['wr_id'] . '&amp;token=' . $token . '&amp;page=' . $page . $qstr;
}
} else {
if (!$cl['mb_id']) {
$cl['del_link'] = './password.php?w=x&amp;bo_table=' . $bo_table . '&amp;comment_id=' . $cl['wr_id'] . '&amp;page=' . $page . $qstr;
}
}
$c_edit_href = './board.php?' . $query_string . '&amp;c_id=' . $comment_id . '&amp;w=cu#bo_cl_w';
?>
<span><a href="javascript:comment_box('<? echo $comment_id ?>', 'cu', 'clo');">m</a></span>
<span><a href="<? echo $cl['del_link']; ?>" onclick="return comment_delete();">d</a></span>
<? } ?>
</div>
?>
<span><a href="javascript:comment_box('<? echo $comment_id ?>', 'cu', 'clo');">m</a></span>
<span><a href="<? echo $cl['del_link']; ?>" onclick="return comment_delete();">d</a></span>
<? } ?>
</div>
</div>
</div>
<span id="edit_cl_<? echo $comment_id ?>"></span><!-- 수정 -->
</div>
<span id="edit_cl_<? echo $comment_id ?>"></span><!-- 수정 -->
</div>
<input type="hidden" value="<? echo strstr($cl['wr_option'],"secret") ?>" id="secret_comment_<? echo $comment_id ?>">
<textarea id="save_comment_<? echo $comment_id ?>" style="display:none">옷장</textarea>
<input type="hidden" id="save_cl_<?=$comment_id?>" name="bf_content" value="<?=$files[0]['content']?>" >
<input type="hidden" id="save_order_<?=$comment_id?>" name="wr_10" value="<?=$cl['wr_10']?>">
<? } ?>
<input type="hidden" value="<? echo strstr($cl['wr_option'], "secret") ?>"
id="secret_comment_<? echo $comment_id ?>">
<textarea id="save_comment_<? echo $comment_id ?>" style="display:none">옷장</textarea>
<input type="hidden" id="save_cl_<?= $comment_id ?>" name="bf_content" value="<?= $files[0]['content'] ?>">
<input type="hidden" id="save_order_<?= $comment_id ?>" name="wr_10" value="<?= $cl['wr_10'] ?>">
<? } ?>
</div>
<!-- 댓글 쓰기 시작 { -->
<?if($cmt_link['cnt']==0) {?><p class="txt-left add"><a href="javascript:comment_box('', 'c','link');">▶ 로그 링크 추가</a></p><?}?>
<p class="add txt-right"><a href="javascript:comment_box('', 'c','clo');"> 의상 추가</a></p>
<div id="bo_vc_w" class="board-comment-write" style="display:none;">
<form name="fviewcomment" action="./write_comment_update.php" onsubmit="return fviewcomment_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="w" value="<? echo $w ?>" id="w">
<input type="hidden" name="bo_table" value="<? echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<? echo $wr_id ?>">
<input type="hidden" name="comment_id" value="<? echo $c_id ?>" id="comment_id">
<input type="hidden" name="sca" value="<? echo $sca ?>">
<input type="hidden" name="sfl" value="<? echo $sfl ?>">
<input type="hidden" name="stx" value="<? echo $stx ?>">
<input type="hidden" name="spt" value="<? echo $spt ?>">
<input type="hidden" name="page" value="<? echo $page ?>">
</div>
<!-- 댓글 쓰기 시작 { -->
<? if ($cmt_link['cnt'] == 0) { ?>
<p class="txt-left add"><a href="javascript:comment_box('', 'c','link');"> 로그 링크 추가</a></p><? } ?>
<p class="add txt-right"><a href="javascript:comment_box('', 'c','clo');"> 의상 추가</a></p>
<div id="bo_vc_w" class="board-comment-write" style="display:none;">
<form name="fviewcomment" action="./write_comment_update.php" onsubmit="return fviewcomment_submit(this);"
method="post" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="w" value="<? echo $w ?>" id="w">
<input type="hidden" name="bo_table" value="<? echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<? echo $wr_id ?>">
<input type="hidden" name="comment_id" value="<? echo $c_id ?>" id="comment_id">
<input type="hidden" name="sca" value="<? echo $sca ?>">
<input type="hidden" name="sfl" value="<? echo $sfl ?>">
<input type="hidden" name="stx" value="<? echo $stx ?>">
<input type="hidden" name="spt" value="<? echo $spt ?>">
<input type="hidden" name="page" value="<? echo $page ?>">
<div class="board-comment-form">
<div class="board-comment-form">
<input type="text" name="bf_content" id="bf_content" placeholder="의상 이름" style="width:80%"><input type="text" name="wr_10" id="wr_10" placeholder="순서" style="width:20%;"><input type="file" name="bf_file" id="bf_file" class="frm_file frm_input full upload-data on">
<? if ($comment_min || $comment_max) { ?><strong id="char_cnt"><span id="char_count"></span>글자</strong><? } ?>
<textarea id="wr_content" name="wr_content" maxlength="10000" required class="required" placeholder="제목|링크로 로그를 링크할 수 있습니다. 여러개 입력시 엔터로 구분해주세요. 예시:
<input type="text" name="bf_content" id="bf_content" placeholder="의상 이름" style="width:80%"><input type="text"
name="wr_10" id="wr_10" placeholder="순서" style="width:20%;"><input type="file" name="bf_file" id="bf_file"
class="frm_file frm_input full upload-data on">
<? if ($comment_min || $comment_max) { ?><strong id="char_cnt"><span id="char_count"></span>글자</strong><? } ?>
<textarea id="wr_content" name="wr_content" maxlength="10000" required class="required" placeholder="제목|링크로 로그를 링크할 수 있습니다. 여러개 입력시 엔터로 구분해주세요. 예시:
링크1|http://url-1
링크2|http://url-2
링크3|http://url-3
..."
<? if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<? } ?>><? echo $c_wr_content; ?></textarea>
<? if ($comment_min || $comment_max) { ?><script> check_byte('wr_content', 'char_count'); </script><? } ?>
<script>
$(document).on( "keyup change", "textarea#wr_content[maxlength]", function(){
var str = $(this).val()
var mx = parseInt($(this).attr("maxlength"))
if (str.length > mx) {
$(this).val(str.substr(0, mx));
return false;
}
});
</script>
..." <? if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');" <? } ?>><? echo $c_wr_content; ?></textarea>
<? if ($comment_min || $comment_max) { ?>
<script> check_byte('wr_content', 'char_count'); </script><? } ?>
<script>
$(document).on("keyup change", "textarea#wr_content[maxlength]", function () {
var str = $(this).val()
var mx = parseInt($(this).attr("maxlength"))
if (str.length > mx) {
$(this).val(str.substr(0, mx));
return false;
}
});
</script>
<p style="display:none;"><input type="checkbox" name="secret" value="1" id="secret"> <label for="secret">비밀글</label></p>
<p style="display:none;"><input type="checkbox" name="secret" value="1" id="secret"> <label
for="secret">비밀글</label></p>
<div class="btn_confirm">
<button type="submit" id="btn_submit" class="ui-btn">등록</button>
</div>
</div>
<div class="btn_confirm">
<button type="submit" id="btn_submit" class="ui-btn">등록</button>
</div>
</div>
</form>
</div>
<? } ?>
</form>
</div>
<? } ?>
</div>
<script>
var save_before = '';
var save_html = document.getElementById('bo_vc_w').innerHTML;
var save_before = '';
var save_html = document.getElementById('bo_vc_w').innerHTML;
function fviewcomment_submit(f)
{
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
function fviewcomment_submit(f) {
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
var subject = "";
var content = "";
$.ajax({
url: g5_bbs_url+"/ajax.filter.php",
type: "POST",
data: {
"subject": "",
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
subject = data.subject;
content = data.content;
}
});
var subject = "";
var content = "";
$.ajax({
url: g5_bbs_url + "/ajax.filter.php",
type: "POST",
data: {
"subject": "",
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function (data, textStatus) {
subject = data.subject;
content = data.content;
}
});
if (content) {
alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
f.wr_content.focus();
return false;
}
if (content) {
alert("내용에 금지단어('" + content + "')가 포함되어있습니다");
f.wr_content.focus();
return false;
}
// 양쪽 공백 없애기
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
document.getElementById('wr_content').value = document.getElementById('wr_content').value.replace(pattern, "");
if (char_min > 0 || char_max > 0)
{
check_byte('wr_content', 'char_count');
var cnt = parseInt(document.getElementById('char_count').innerHTML);
if (char_min > 0 && char_min > cnt)
{
alert("댓글은 "+char_min+"글자 이상 쓰셔야 합니다.");
return false;
} else if (char_max > 0 && char_max < cnt)
{
alert("댓글은 "+char_max+"글자 이하로 쓰셔야 합니다.");
return false;
}
}
else if (!document.getElementById('wr_content').value)
{
alert("댓글을 입력하여 주십시오.");
return false;
}
// 양쪽 공백 없애기
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
document.getElementById('wr_content').value = document.getElementById('wr_content').value.replace(pattern, "");
if (char_min > 0 || char_max > 0) {
check_byte('wr_content', 'char_count');
var cnt = parseInt(document.getElementById('char_count').innerHTML);
if (char_min > 0 && char_min > cnt) {
alert("댓글은 " + char_min + "글자 이상 쓰셔야 합니다.");
return false;
} else if (char_max > 0 && char_max < cnt) {
alert("댓글은 " + char_max + "글자 이하로 쓰셔야 합니다.");
return false;
}
}
else if (!document.getElementById('wr_content').value) {
alert("댓글을 입력하여 주십시오.");
return false;
}
if (typeof(f.wr_name) != 'undefined')
{
f.wr_name.value = f.wr_name.value.replace(pattern, "");
if (f.wr_name.value == '')
{
alert('이름이 입력되지 않았습니다.');
f.wr_name.focus();
return false;
}
}
if (typeof (f.wr_name) != 'undefined') {
f.wr_name.value = f.wr_name.value.replace(pattern, "");
if (f.wr_name.value == '') {
alert('이름이 입력되지 않았습니다.');
f.wr_name.focus();
return false;
}
}
if (typeof(f.wr_password) != 'undefined')
{
f.wr_password.value = f.wr_password.value.replace(pattern, "");
if (f.wr_password.value == '')
{
alert('비밀번호가 입력되지 않았습니다.');
f.wr_password.focus();
return false;
}
}
if (typeof (f.wr_password) != 'undefined') {
f.wr_password.value = f.wr_password.value.replace(pattern, "");
if (f.wr_password.value == '') {
alert('비밀번호가 입력되지 않았습니다.');
f.wr_password.focus();
return false;
}
}
set_comment_token(f);
set_comment_token(f);
document.getElementById("btn_submit").disabled = "disabled";
document.getElementById("btn_submit").disabled = "disabled";
return true;
}
return true;
}
function comment_box(comment_id, work, type)
{
var el_id;
// 댓글 아이디가 넘어오면 답변, 수정
if (comment_id)
{
if (work == 'c')
el_id = 'reply_' + comment_id;
else{
if(type=='clo')
el_id = 'edit_cl_' + comment_id;
else
el_id = 'edit_' + comment_id;
}
}
else
el_id = 'bo_vc_w';
function comment_box(comment_id, work, type) {
var el_id;
// 댓글 아이디가 넘어오면 답변, 수정
if (comment_id) {
if (work == 'c')
el_id = 'reply_' + comment_id;
else {
if (type == 'clo')
el_id = 'edit_cl_' + comment_id;
else
el_id = 'edit_' + comment_id;
}
}
else
el_id = 'bo_vc_w';
if (save_before != el_id)
{
if (save_before)
{
document.getElementById(save_before).style.display = 'none';
document.getElementById(save_before).innerHTML = '';
}
if (save_before != el_id) {
if (save_before) {
document.getElementById(save_before).style.display = 'none';
document.getElementById(save_before).innerHTML = '';
}
document.getElementById(el_id).style.display = '';
document.getElementById(el_id).innerHTML = save_html;
document.getElementById(el_id).style.display = '';
document.getElementById(el_id).innerHTML = save_html;
// 댓글 수정
if (work == 'cu')
{
$('#btn_submit').text('수정');
document.getElementById('wr_content').value = document.getElementById('save_comment_' + comment_id).value;
if(type=='clo'){
document.getElementById('wr_content').value = '옷장';
document.getElementById('bf_content').value = document.getElementById('save_cl_' + comment_id).value;
document.getElementById('wr_10').value = document.getElementById('save_order_'+comment_id).value;
}
if (typeof char_count != 'undefined')
check_byte('wr_content', 'char_count');
if (document.getElementById('secret_comment_'+comment_id).value)
document.getElementById('secret').checked = true;
else
document.getElementById('secret').checked = false;
}
// 댓글 수정
if (work == 'cu') {
$('#btn_submit').text('수정');
document.getElementById('wr_content').value = document.getElementById('save_comment_' + comment_id).value;
if (type == 'clo') {
document.getElementById('wr_content').value = '옷장';
document.getElementById('bf_content').value = document.getElementById('save_cl_' + comment_id).value;
document.getElementById('wr_10').value = document.getElementById('save_order_' + comment_id).value;
}
if (typeof char_count != 'undefined')
check_byte('wr_content', 'char_count');
if (document.getElementById('secret_comment_' + comment_id).value)
document.getElementById('secret').checked = true;
else
document.getElementById('secret').checked = false;
}
document.getElementById('comment_id').value = comment_id;
document.getElementById('w').value = work;
document.getElementById('comment_id').value = comment_id;
document.getElementById('w').value = work;
save_before = el_id;
}
if(type=='clo'){
$('#'+el_id+' #wr_content').hide();
$('#'+el_id+' #bf_content, #'+el_id+' #bf_file, #'+el_id+' #wr_10').show();
if(work=='c'){
$('#'+el_id+' #wr_content').text('옷장');
}
}
if (type=='link')
{
if(work=='c'){
$('#'+el_id+' #wr_content').text('');
}
$('#'+el_id+' #bf_content, #'+el_id+' #bf_file, #'+el_id+' #wr_10').hide();
$('#'+el_id+' #wr_content').show();
}
}
save_before = el_id;
}
if (type == 'clo') {
$('#' + el_id + ' #wr_content').hide();
$('#' + el_id + ' #bf_content, #' + el_id + ' #bf_file, #' + el_id + ' #wr_10').show();
if (work == 'c') {
$('#' + el_id + ' #wr_content').text('옷장');
}
}
if (type == 'link') {
if (work == 'c') {
$('#' + el_id + ' #wr_content').text('');
}
$('#' + el_id + ' #bf_content, #' + el_id + ' #bf_file, #' + el_id + ' #wr_10').hide();
$('#' + el_id + ' #wr_content').show();
}
}
function comment_delete()
{
return confirm("이 댓글을 삭제하시겠습니까?");
}
function comment_delete() {
return confirm("이 댓글을 삭제하시겠습니까?");
}
// 댓글 입력폼이 보이도록 처리하기위해서 추가 (root님)
// 댓글 입력폼이 보이도록 처리하기위해서 추가 (root님)
<? if($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) { ?>
// sns 등록
$(function() {
$("#bo_vc_send_sns").load(
"<? echo G5_SNS_URL; ?>/view_comment_write.sns.skin.php?bo_table=<? echo $bo_table; ?>",
function() {
save_html = document.getElementById('bo_vc_w').innerHTML;
}
);
});
<? } ?>
<? if ($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) { ?>
// sns 등록
$(function () {
$("#bo_vc_send_sns").load(
"<? echo G5_SNS_URL; ?>/view_comment_write.sns.skin.php?bo_table=<? echo $bo_table; ?>",
function () {
save_html = document.getElementById('bo_vc_w').innerHTML;
}
);
});
<? } ?>
</script>

View file

@ -1,24 +1,26 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if (!defined('_GNUBOARD_'))
exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
$category_option = "";
if($is_category && $board['bo_category_list']){
if ($is_category && $board['bo_category_list']) {
$categories = explode("|", $board['bo_category_list']); // 구분자가 | 로 되어 있음
for ($i=0; $i<count($categories); $i++) {
$category = trim($categories[$i]);
if (!$category) continue;
$categories = explode("|", $board['bo_category_list']); // 구분자가 | 로 되어 있음
for ($i = 0; $i < count($categories); $i++) {
$category = trim($categories[$i]);
if (!$category)
continue;
$category_option .= "<option value=\"$categories[$i]\"";
if ($category == $ca_name) {
$category_option .= ' selected="selected"';
}
$category_option .= ">$categories[$i]</option>\n";
}
$category_option .= "<option value=\"$categories[$i]\"";
if ($category == $ca_name) {
$category_option .= ' selected="selected"';
}
$category_option .= ">$categories[$i]</option>\n";
}
}
?>
@ -26,191 +28,199 @@ if($is_category && $board['bo_category_list']){
<hr class="padding">
<section id="bo_w">
<!-- 게시물 작성/수정 시작 { -->
<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="w" value="<?php echo $w ?>">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="wr_subject" value="링크">
<input type="hidden" name="wr_content" value="링크">
<?php
$option = '';
$option_hidden = '';
if ($is_notice || $is_html || $is_secret || $is_mail) {
$option = '';
if ($is_notice) {
//$option .= "\n".'<input type="checkbox" id="notice" name="notice" value="1" '.$notice_checked.'>'."\n".'<label for="notice">공지</label>';
}
<!-- 게시물 작성/수정 시작 { -->
<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="w" value="<?php echo $w ?>">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="wr_subject" value="링크">
<input type="hidden" name="wr_content" value="링크">
<?php
$option = '';
$option_hidden = '';
if ($is_notice || $is_html || $is_secret || $is_mail) {
$option = '';
if ($is_notice) {
//$option .= "\n".'<input type="checkbox" id="notice" name="notice" value="1" '.$notice_checked.'>'."\n".'<label for="notice">공지</label>';
}
if ($is_html) {
if ($is_dhtml_editor) {
$option_hidden .= '<input type="hidden" value="html1" name="html">';
} else {
$option .= "\n".'<input type="checkbox" id="html" name="html" onclick="html_auto_br(this);" value="'.$html_value.'" '.$html_checked.'>'."\n".'<label for="html">html</label>';
}
}
if ($is_html) {
if ($is_dhtml_editor) {
$option_hidden .= '<input type="hidden" value="html1" name="html">';
} else {
$option .= "\n" . '<input type="checkbox" id="html" name="html" onclick="html_auto_br(this);" value="' . $html_value . '" ' . $html_checked . '>' . "\n" . '<label for="html">html</label>';
}
}
if ($is_secret) {
if ($is_admin || $is_secret==1) {
$option .= "\n".'<input type="checkbox" id="secret" name="secret" value="secret" '.$secret_checked.'>'."\n".'<label for="secret">비밀글</label>';
} else {
$option_hidden .= '<input type="hidden" name="secret" value="secret">';
}
}
if ($is_secret) {
if ($is_admin || $is_secret == 1) {
$option .= "\n" . '<input type="checkbox" id="secret" name="secret" value="secret" ' . $secret_checked . '>' . "\n" . '<label for="secret">비밀글</label>';
} else {
$option_hidden .= '<input type="hidden" name="secret" value="secret">';
}
}
if ($is_mail) {
$option .= "\n".'<input type="checkbox" id="mail" name="mail" value="mail" '.$recv_email_checked.'>'."\n".'<label for="mail">답변메일받기</label>';
}
}
if ($is_mail) {
$option .= "\n" . '<input type="checkbox" id="mail" name="mail" value="mail" ' . $recv_email_checked . '>' . "\n" . '<label for="mail">답변메일받기</label>';
}
}
echo $option_hidden;
?>
echo $option_hidden;
?>
<div class="board-write theme-box">
<? if($is_category){?>
<dl>
<dt style="line-height:150%;">카테고리</dt>
<dd><select name="ca_name" id="ca_name" required class="required" >
<option value="">선택하세요</option>
<?php echo $category_option ?>
</select>
</dd>
</dl>
<?}?>
<dl>
<dt>제목</dt>
<dd><div class="subject" style="margin-top: 20px;">
<input type="text" name="wr_1" value="<?=$write['wr_1']?>" class="frm_input full" maxlength="255">
</div></dd>
</dl>
<dl>
<dt>배너</dt>
<dd><div class="wr_link1" style="margin-top: 20px;">
<input type="text" name="wr_link1" value="<?php echo $write['wr_link1'] ?>" class="frm_input full" maxlength="255">
<?=help("img 태그를 제외한 순수 이미지 링크만 입력(ex. http://link.com/banner.png) 없을시 제목이 출력됩니다.");?>
</div></dd>
</dl>
<dl>
<dt>링크</dt>
<dd><div class="wr_link2" style="margin-top: 20px;">
<input type="text" name="wr_link2" value="<?php echo $write['wr_link2'] ?>" class="frm_input full" maxlength="255">
</div></dd>
</dl>
<dl>
<dt>순서</dt>
<dd><div class="wr_10">
<input type="text" name="wr_10" value="<?=$w=='u' ? $write['wr_10']:"";?>" >
<?=help("* 순서는 1이 가장 처음으로 순서를 정하지 않을 경우 먼저 등록한 순서대로 정렬됩니다.");?>
</div>
</dd>
</dl>
</div>
<div class="board-write theme-box">
<? if ($is_category) { ?>
<dl>
<dt style="line-height:150%;">카테고리</dt>
<dd><select name="ca_name" id="ca_name" required class="required">
<option value="">선택하세요</option>
<?php echo $category_option ?>
</select>
</dd>
</dl>
<? } ?>
<dl>
<dt>제목</dt>
<dd>
<div class="subject" style="margin-top: 20px;">
<input type="text" name="wr_1" value="<?= $write['wr_1'] ?>" class="frm_input full" maxlength="255">
</div>
</dd>
</dl>
<dl>
<dt>배너</dt>
<dd>
<div class="wr_link1" style="margin-top: 20px;">
<input type="text" name="wr_link1" value="<?php echo $write['wr_link1'] ?>" class="frm_input full"
maxlength="255">
<?= help("img 태그를 제외한 순수 이미지 링크만 입력(ex. http://link.com/banner.png) 없을시 제목이 출력됩니다."); ?>
</div>
</dd>
</dl>
<dl>
<dt>링크</dt>
<dd>
<div class="wr_link2" style="margin-top: 20px;">
<input type="text" name="wr_link2" value="<?php echo $write['wr_link2'] ?>" class="frm_input full"
maxlength="255">
</div>
</dd>
</dl>
<dl>
<dt>순서</dt>
<dd>
<div class="wr_10">
<input type="text" name="wr_10" value="<?= $w == 'u' ? $write['wr_10'] : ""; ?>">
<?= help("* 순서는 1이 가장 처음으로 순서를 정하지 않을 경우 먼저 등록한 순서대로 정렬됩니다."); ?>
</div>
</dd>
</dl>
</div>
<hr class="padding" />
<div class="btn_confirm txt-center">
<input type="submit" value="작성완료" id="btn_submit" accesskey="s" class="btn_submit ui-btn point">
<a href="./board.php?bo_table=<?php echo $bo_table ?>" class="btn_cancel ui-btn">취소</a>
</div>
</form>
<hr class="padding" />
<div class="btn_confirm txt-center">
<input type="submit" value="작성완료" id="btn_submit" accesskey="s" class="btn_submit ui-btn point">
<a href="./board.php?bo_table=<?php echo $bo_table ?>" class="btn_cancel ui-btn">취소</a>
</div>
</form>
<script>
<?php if($write_min || $write_max) { ?>
// 글자수 제한
var char_min = parseInt(<?php echo $write_min; ?>); // 최소
var char_max = parseInt(<?php echo $write_max; ?>); // 최대
check_byte("wr_content", "char_count");
<script>
<?php if ($write_min || $write_max) { ?>
// 글자수 제한
var char_min = parseInt(<?php echo $write_min; ?>); // 최소
var char_max = parseInt(<?php echo $write_max; ?>); // 최대
check_byte("wr_content", "char_count");
$(function() {
$("#wr_content").on("keyup", function() {
check_byte("wr_content", "char_count");
});
});
$(function () {
$("#wr_content").on("keyup", function () {
check_byte("wr_content", "char_count");
});
});
<?php } ?>
<?php } ?>
function html_auto_br(obj)
{
if (obj.checked) {
result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다.");
if (result)
obj.value = "html2";
else
obj.value = "html1";
}
else
obj.value = "";
}
function html_auto_br(obj) {
if (obj.checked) {
result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다.");
if (result)
obj.value = "html2";
else
obj.value = "html1";
}
else
obj.value = "";
}
function fwrite_submit(f)
{
<?php echo $editor_js; // 에디터 사용시 자바스크립트에서 내용을 폼필드로 넣어주며 내용이 입력되었는지 검사함 ?>
function fwrite_submit(f) {
<?php echo $editor_js; // 에디터 사용시 자바스크립트에서 내용을 폼필드로 넣어주며 내용이 입력되었는지 검사함 ?>
var subject = "";
var content = "";
$.ajax({
url: g5_bbs_url+"/ajax.filter.php",
type: "POST",
data: {
"subject": f.wr_subject.value,
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
subject = data.subject;
content = data.content;
}
});
var subject = "";
var content = "";
$.ajax({
url: g5_bbs_url + "/ajax.filter.php",
type: "POST",
data: {
"subject": f.wr_subject.value,
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function (data, textStatus) {
subject = data.subject;
content = data.content;
}
});
if (subject) {
alert("제목에 금지단어('"+subject+"')가 포함되어있습니다");
f.wr_subject.focus();
return false;
}
if (subject) {
alert("제목에 금지단어('" + subject + "')가 포함되어있습니다");
f.wr_subject.focus();
return false;
}
if (content) {
alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
if (typeof(ed_wr_content) != "undefined")
ed_wr_content.returnFalse();
else
f.wr_content.focus();
return false;
}
if (content) {
alert("내용에 금지단어('" + content + "')가 포함되어있습니다");
if (typeof (ed_wr_content) != "undefined")
ed_wr_content.returnFalse();
else
f.wr_content.focus();
return false;
}
if (document.getElementById("char_count")) {
if (char_min > 0 || char_max > 0) {
var cnt = parseInt(check_byte("wr_content", "char_count"));
if (char_min > 0 && char_min > cnt) {
alert("내용은 "+char_min+"글자 이상 쓰셔야 합니다.");
return false;
}
else if (char_max > 0 && char_max < cnt) {
alert("내용은 "+char_max+"글자 이하로 쓰셔야 합니다.");
return false;
}
}
}
document.getElementById("btn_submit").disabled = "disabled";
if (document.getElementById("char_count")) {
if (char_min > 0 || char_max > 0) {
var cnt = parseInt(check_byte("wr_content", "char_count"));
if (char_min > 0 && char_min > cnt) {
alert("내용은 " + char_min + "글자 이상 쓰셔야 합니다.");
return false;
}
else if (char_max > 0 && char_max < cnt) {
alert("내용은 " + char_max + "글자 이하로 쓰셔야 합니다.");
return false;
}
}
}
document.getElementById("btn_submit").disabled = "disabled";
return true;
}
$(".wr_8").on("change",function(){
if($(this).val()=='wr_1'){
$("#crop").css("display","block");
}else {
$("#crop").css("display","none");
}
});
</script>
return true;
}
$(".wr_8").on("change", function () {
if ($(this).val() == 'wr_1') {
$("#crop").css("display", "block");
} else {
$("#crop").css("display", "none");
}
});
</script>
</section>
<!-- } 게시물 작성/수정 -->

View file

@ -1,44 +1,48 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
/**
* @var string|int $bf_content
*/
if (!defined("_GNUBOARD_"))
exit; // 개별 페이지 접근 불가
$customer_sql = "";
$temp_wr_id = $comment_id;
$wr_num = $wr['wr_num'];
if(!$wr_num) $wr_num = $comment['wr_num'];
include_once($board_skin_path.'/upload_file.php');
if($_FILES['bf_file']['name']){
$files=upload_c_file('bf_file',$bo_table);
$file=sql_fetch("select * from {$g5['board_file_table']} where bo_table='{$bo_table}' and wr_id='{$comment_id}' and bf_no='0'");
$sql_common="bf_source='{$files['source']}',
if (!$wr_num)
$wr_num = $comment['wr_num'];
include_once($board_skin_path . '/upload_file.php');
if ($_FILES['bf_file']['name']) {
$files = upload_c_file('bf_file', $bo_table);
$file = sql_fetch("select * from {$g5['board_file_table']} where bo_table='{$bo_table}' and wr_id='{$comment_id}' and bf_no='0'");
$sql_common = "bf_source='{$files['source']}',
bf_file='{$files['name']}',
bf_filesize='{$files['size']}',
bf_width = '{$files['img'][0]}',
bf_height = '{$files['img'][1]}',
bf_type = '{$files['img'][2]}',
bf_content = '{$bf_content}',
bf_datetime = '".G5_TIME_YMDHIS."' ";
if($file['wr_id']){
sql_query("update {$g5['board_file_table']}
bf_datetime = '" . G5_TIME_YMDHIS . "' ";
if ($file['wr_id']) {
sql_query("update {$g5['board_file_table']}
set {$sql_common}
where bo_table = '{$bo_table}' and wr_id='{$comment_id}' and bf_no = '0'
");
}else{
sql_query("insert into {$g5['board_file_table']}
} else {
sql_query("insert into {$g5['board_file_table']}
set {$sql_common},
wr_id = '{$comment_id}' ,
bo_table = '{$bo_table}' ,
bf_no = '0'
");
}
}
}
}
if($w=='cu' && $bf_content){
sql_query("update {$g5['board_file_table']}
if ($w == 'cu' && $bf_content) {
sql_query("update {$g5['board_file_table']}
set bf_content = '{$bf_content}'
where wr_id ='{$comment_id}' and
bo_table = '{$bo_table}' and
bf_no = '0'
bo_table = '{$bo_table}' and
bf_no = '0'
");
}
?>

View file

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