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 <?php
include_once('../../../common.php'); include_once('../../../common.php');
?>

View file

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

View file

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

View file

@ -1,8 +1,8 @@
<?php <?php
include_once("./_common.php"); include_once("./_common.php");
for ($i=0;$i<count($idx);$i++){ for ($i = 0; $i < count($idx); $i++) {
$k=$idx[$i]; $k = $idx[$i];
sql_query("update {$write_table} sql_query("update {$write_table}
set wr_10 = '{$order[$k]}', set wr_10 = '{$order[$k]}',
wr_1 = '{$subject[$k]}', wr_1 = '{$subject[$k]}',
@ -10,9 +10,8 @@ for ($i=0;$i<count($idx);$i++){
wr_link2='{$link[$k]}' wr_link2='{$link[$k]}'
where wr_id='{$k}' where wr_id='{$k}'
"); ");
if($board['bo_use_category']&&$board['bo_category_list'] && $category[$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}'"); 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,17 +1,20 @@
<? <?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
include_once(G5_LIB_PATH.'/thumbnail.lib.php'); exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH . '/thumbnail.lib.php');
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨 // 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"> <div id="bo_v_bot">
<? ob_start(); ?> <? ob_start(); ?>
<div class="bo_v_com"> <div class="bo_v_com">
<a href="<? echo $list_href ?>" class="ui-btn left">목록</a> <a href="<? echo $list_href ?>" class="ui-btn left">목록</a>
<? if ($update_href) { ?><a href="<? echo $update_href ?>" class="ui-btn">수정</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 ($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><? } ?> <? if ($write_href) { ?><a href="<? echo $write_href ?>" class="ui-btn point">링크 추가</a><? } ?>
</div> </div>
<? <?
@ -21,11 +24,11 @@ if($board['bo_table_width']==0) $width="100%";?>
</div> </div>
<!-- } 링크 버튼 --> <!-- } 링크 버튼 -->
<div class="board-viewer"> <div class="board-viewer">
<div class="contents"> <div class="contents">
<!-- 본문 내용 시작 { --> <!-- 본문 내용 시작 { -->
<div id="bo_v_con"><? echo get_view_thumbnail($view['content']); ?></div> <div id="bo_v_con"><? echo get_view_thumbnail($view['content']); ?></div>
<?//echo $view['rich_content']; // {이미지:0} 과 같은 코드를 사용할 경우 ?> <?//echo $view['rich_content']; // {이미지:0} 과 같은 코드를 사용할 경우 ?>
<!-- } 본문 내용 --> <!-- } 본문 내용 -->
</div> </div>
</div> </div>
<!-- } 게시글 읽기 --> <!-- } 게시글 읽기 -->

View file

@ -1,25 +1,27 @@
<? <?
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!='옷장'"); $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='옷장'"); $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"> <div class="board-comment-view">
<script> <script>
// 글자수 제한 // 글자수 제한
var char_min = parseInt(<? echo $comment_min ?>); // 최소 var char_min = parseInt(<? echo $comment_min ?>); // 최소
var char_max = parseInt(<? echo $comment_max ?>); // 최대 var char_max = parseInt(<? echo $comment_max ?>); // 최대
</script> </script>
<? <?
if($member['mb_level']>=$board['bo_comment_level']){ if ($member['mb_level'] >= $board['bo_comment_level']) {
?> ?>
<div class="board-comment-list"> <div class="board-comment-list">
<?if($cmt_link['cnt']>0){?> <? if ($cmt_link['cnt'] > 0) { ?>
<strong>로그</strong><?}?> <strong>로그</strong><? } ?>
<? <?
$cmt_amt = count($list); $cmt_amt = count($list);
for ($i=0; $i<$cmt_amt; $i++) { for ($i = 0; $i < $cmt_amt; $i++) {
if($list[$i]['wr_content']=='옷장') continue; if ($list[$i]['wr_content'] == '옷장')
continue;
$comment_id = $list[$i]['wr_id']; $comment_id = $list[$i]['wr_id'];
$cmt_depth = ""; // 댓글단계 $cmt_depth = ""; // 댓글단계
$cmt_depth = strlen($list[$i]['wr_comment_reply']) * 10; $cmt_depth = strlen($list[$i]['wr_comment_reply']) * 10;
@ -31,12 +33,12 @@ if($member['mb_level']>=$board['bo_comment_level']){
<div class="item" id="c_<? echo $comment_id ?>"> <div class="item" id="c_<? echo $comment_id ?>">
<div class="co-content"> <div class="co-content">
<div class="co-inner"> <div class="co-inner">
<? $co_links=explode(PHP_EOL,$list[$i]['wr_content']); <? $co_links = explode(PHP_EOL, $list[$i]['wr_content']);
if(count($co_links)>0){ if (count($co_links) > 0) {
$co_list=array(); $co_list = array();
for($k=0;$k<count($co_links);$k++){ for ($k = 0; $k < count($co_links); $k++) {
$co_list[$k]=explode('|',$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>'; $c_link = '<a href="' . $co_list[$k][1] . '" class="ui-btn" target="_blank">' . $co_list[$k][0] . '</a>';
echo $c_link; echo $c_link;
} }
} }
@ -44,10 +46,10 @@ if($member['mb_level']>=$board['bo_comment_level']){
</div> </div>
<div class="co-info"> <div class="co-info">
<? if($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) { <? if ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) {
$query_string = clean_query_string($_SERVER['QUERY_STRING']); $query_string = clean_query_string($_SERVER['QUERY_STRING']);
if($w == 'cu') { if ($w == 'cu') {
$sql = " select wr_id, wr_content, mb_id from $write_table where wr_id = '$c_id' and wr_is_comment = '1' "; $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); $cmt = sql_fetch($sql);
if (!($is_admin || ($member['mb_id'] == $cmt['mb_id'] && $cmt['mb_id']))) if (!($is_admin || ($member['mb_id'] == $cmt['mb_id'] && $cmt['mb_id'])))
@ -55,10 +57,12 @@ if($member['mb_level']>=$board['bo_comment_level']){
$c_wr_content = $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'; $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_edit']) { ?><span><a
<? if ($list[$i]['is_del']) { ?><span><a href="<? echo $list[$i]['del_link']; ?>" onclick="return comment_delete();">d</a></span><? } ?> 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>
@ -67,44 +71,46 @@ if($member['mb_level']>=$board['bo_comment_level']){
<span id="edit_<? echo $comment_id ?>"></span><!-- 수정 --> <span id="edit_<? echo $comment_id ?>"></span><!-- 수정 -->
</div> </div>
<input type="hidden" value="<? echo strstr($list[$i]['wr_option'],"secret") ?>" id="secret_comment_<? echo $comment_id ?>"> <input type="hidden" value="<? echo strstr($list[$i]['wr_option'], "secret") ?>"
<textarea id="save_comment_<? echo $comment_id ?>" style="display:none"><? echo get_text($list[$i]['content1'], 0) ?></textarea> id="secret_comment_<? echo $comment_id ?>">
<input type="hidden" id="save_cl_<?=$comment_id?>" name="bf_content" > <textarea id="save_comment_<? echo $comment_id ?>"
<input type="hidden" id="save_order_<?=$comment_id?>" name="wr_10"> 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 ($view['mb_id'] == $member['mb_id']) {
if($w == '') if ($w == '')
$w = 'c'; $w = 'c';
?> ?>
<div class="board-clothes-list board-comment-list"> <div class="board-clothes-list board-comment-list">
<?if($clo['cnt']>0){?> <? if ($clo['cnt'] > 0) { ?>
<strong>옷장</strong> <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"); $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++) { for ($k = 0; $cl = sql_fetch_array($clothes); $k++) {
$comment_id = $cl['wr_id']; $comment_id = $cl['wr_id'];
?> ?>
<div class="item" id="cl_<? echo $comment_id ?>"> <div class="item" id="cl_<? echo $comment_id ?>">
<div class="co-content"> <div class="co-content">
<div class="co-inner"> <div class="co-inner">
<? $files=get_file($bo_table,$comment_id); <? $files = get_file($bo_table, $comment_id);
$filelink=G5_DATA_URL.'/file/'.$bo_table.'/'.$files[0]['file']; ?> $filelink = G5_DATA_URL . '/file/' . $bo_table . '/' . $files[0]['file']; ?>
<a href="<?=$filelink?>" target="_blank"><?=$files[0]['content']?></a> <a href="<?= $filelink ?>" target="_blank"><?= $files[0]['content'] ?></a>
</div> </div>
<div class="co-info"> <div class="co-info">
<? if($member['mb_id']==$cl['mb_id']) { <? if ($member['mb_id'] == $cl['mb_id']) {
$query_string = clean_query_string($_SERVER['QUERY_STRING']); $query_string = clean_query_string($_SERVER['QUERY_STRING']);
if($w == 'cu') { if ($w == 'cu') {
$sql = " select wr_id, wr_content, mb_id from $write_table where wr_id = '$c_id' and wr_is_comment = '1' "; $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); $cmt = sql_fetch($sql);
if (!($is_admin || ($member['mb_id'] == $cmt['mb_id'] && $cmt['mb_id']))) if (!($is_admin || ($member['mb_id'] == $cmt['mb_id'] && $cmt['mb_id'])))
@ -113,21 +119,17 @@ if ($view['mb_id']==$member['mb_id']) {
} }
$token = ''; $token = '';
if ($member['mb_id']) if ($member['mb_id']) {
{ if ($cl['mb_id'] === $member['mb_id'] || $is_admin) {
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;
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 {
else
{
if (!$cl['mb_id']) { 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; $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'; $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="javascript:comment_box('<? echo $comment_id ?>', 'cu', 'clo');">m</a></span>
@ -140,18 +142,21 @@ if ($view['mb_id']==$member['mb_id']) {
<span id="edit_cl_<? echo $comment_id ?>"></span><!-- 수정 --> <span id="edit_cl_<? echo $comment_id ?>"></span><!-- 수정 -->
</div> </div>
<input type="hidden" value="<? echo strstr($cl['wr_option'],"secret") ?>" id="secret_comment_<? echo $comment_id ?>"> <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> <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_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" id="save_order_<?= $comment_id ?>" name="wr_10" value="<?= $cl['wr_10'] ?>">
<? } ?> <? } ?>
</div> </div>
<!-- 댓글 쓰기 시작 { --> <!-- 댓글 쓰기 시작 { -->
<?if($cmt_link['cnt']==0) {?><p class="txt-left add"><a href="javascript:comment_box('', 'c','link');">▶ 로그 링크 추가</a></p><?}?> <? if ($cmt_link['cnt'] == 0) { ?>
<p class="add txt-right"><a href="javascript:comment_box('', 'c','clo');"> 의상 추가</a></p> <p class="txt-left add"><a href="javascript:comment_box('', 'c','link');"> 로그 링크 추가</a></p><? } ?>
<div id="bo_vc_w" class="board-comment-write" style="display:none;"> <p class="add txt-right"><a href="javascript:comment_box('', 'c','clo');"> 의상 추가</a></p>
<form name="fviewcomment" action="./write_comment_update.php" onsubmit="return fviewcomment_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off"> <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="w" value="<? echo $w ?>" id="w">
<input type="hidden" name="bo_table" value="<? echo $bo_table ?>"> <input type="hidden" name="bo_table" value="<? echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<? echo $wr_id ?>"> <input type="hidden" name="wr_id" value="<? echo $wr_id ?>">
@ -164,17 +169,19 @@ if ($view['mb_id']==$member['mb_id']) {
<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"> <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><? } ?> <? 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="제목|링크로 로그를 링크할 수 있습니다. 여러개 입력시 엔터로 구분해주세요. 예시: <textarea id="wr_content" name="wr_content" maxlength="10000" required class="required" placeholder="제목|링크로 로그를 링크할 수 있습니다. 여러개 입력시 엔터로 구분해주세요. 예시:
링크1|http://url-1 링크1|http://url-1
링크2|http://url-2 링크2|http://url-2
링크3|http://url-3 링크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) { ?>onkeyup="check_byte('wr_content', 'char_count');"<? } ?>><? echo $c_wr_content; ?></textarea> <? if ($comment_min || $comment_max) { ?>
<? if ($comment_min || $comment_max) { ?><script> check_byte('wr_content', 'char_count'); </script><? } ?> <script> check_byte('wr_content', 'char_count'); </script><? } ?>
<script> <script>
$(document).on( "keyup change", "textarea#wr_content[maxlength]", function(){ $(document).on("keyup change", "textarea#wr_content[maxlength]", function () {
var str = $(this).val() var str = $(this).val()
var mx = parseInt($(this).attr("maxlength")) var mx = parseInt($(this).attr("maxlength"))
if (str.length > mx) { if (str.length > mx) {
@ -184,7 +191,8 @@ if ($view['mb_id']==$member['mb_id']) {
}); });
</script> </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"> <div class="btn_confirm">
<button type="submit" id="btn_submit" class="ui-btn">등록</button> <button type="submit" id="btn_submit" class="ui-btn">등록</button>
@ -192,24 +200,23 @@ if ($view['mb_id']==$member['mb_id']) {
</div> </div>
</form> </form>
</div> </div>
<? } ?> <? } ?>
</div> </div>
<script> <script>
var save_before = ''; var save_before = '';
var save_html = document.getElementById('bo_vc_w').innerHTML; var save_html = document.getElementById('bo_vc_w').innerHTML;
function fviewcomment_submit(f) function fviewcomment_submit(f) {
{
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자 var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
var subject = ""; var subject = "";
var content = ""; var content = "";
$.ajax({ $.ajax({
url: g5_bbs_url+"/ajax.filter.php", url: g5_bbs_url + "/ajax.filter.php",
type: "POST", type: "POST",
data: { data: {
"subject": "", "subject": "",
@ -218,14 +225,14 @@ function fviewcomment_submit(f)
dataType: "json", dataType: "json",
async: false, async: false,
cache: false, cache: false,
success: function(data, textStatus) { success: function (data, textStatus) {
subject = data.subject; subject = data.subject;
content = data.content; content = data.content;
} }
}); });
if (content) { if (content) {
alert("내용에 금지단어('"+content+"')가 포함되어있습니다"); alert("내용에 금지단어('" + content + "')가 포함되어있습니다");
f.wr_content.focus(); f.wr_content.focus();
return false; return false;
} }
@ -233,42 +240,34 @@ function fviewcomment_submit(f)
// 양쪽 공백 없애기 // 양쪽 공백 없애기
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자 var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
document.getElementById('wr_content').value = document.getElementById('wr_content').value.replace(pattern, ""); document.getElementById('wr_content').value = document.getElementById('wr_content').value.replace(pattern, "");
if (char_min > 0 || char_max > 0) if (char_min > 0 || char_max > 0) {
{
check_byte('wr_content', 'char_count'); check_byte('wr_content', 'char_count');
var cnt = parseInt(document.getElementById('char_count').innerHTML); var cnt = parseInt(document.getElementById('char_count').innerHTML);
if (char_min > 0 && char_min > cnt) if (char_min > 0 && char_min > cnt) {
{ alert("댓글은 " + char_min + "글자 이상 쓰셔야 합니다.");
alert("댓글은 "+char_min+"글자 이상 쓰셔야 합니다.");
return false; return false;
} else if (char_max > 0 && char_max < cnt) } else if (char_max > 0 && char_max < cnt) {
{ alert("댓글은 " + char_max + "글자 이하로 쓰셔야 합니다.");
alert("댓글은 "+char_max+"글자 이하로 쓰셔야 합니다.");
return false; return false;
} }
} }
else if (!document.getElementById('wr_content').value) else if (!document.getElementById('wr_content').value) {
{
alert("댓글을 입력하여 주십시오."); alert("댓글을 입력하여 주십시오.");
return false; return false;
} }
if (typeof(f.wr_name) != 'undefined') if (typeof (f.wr_name) != 'undefined') {
{
f.wr_name.value = f.wr_name.value.replace(pattern, ""); f.wr_name.value = f.wr_name.value.replace(pattern, "");
if (f.wr_name.value == '') if (f.wr_name.value == '') {
{
alert('이름이 입력되지 않았습니다.'); alert('이름이 입력되지 않았습니다.');
f.wr_name.focus(); f.wr_name.focus();
return false; return false;
} }
} }
if (typeof(f.wr_password) != 'undefined') if (typeof (f.wr_password) != 'undefined') {
{
f.wr_password.value = f.wr_password.value.replace(pattern, ""); f.wr_password.value = f.wr_password.value.replace(pattern, "");
if (f.wr_password.value == '') if (f.wr_password.value == '') {
{
alert('비밀번호가 입력되지 않았습니다.'); alert('비밀번호가 입력되지 않았습니다.');
f.wr_password.focus(); f.wr_password.focus();
return false; return false;
@ -281,18 +280,16 @@ function fviewcomment_submit(f)
document.getElementById("btn_submit").disabled = "disabled"; document.getElementById("btn_submit").disabled = "disabled";
return true; return true;
} }
function comment_box(comment_id, work, type) function comment_box(comment_id, work, type) {
{
var el_id; var el_id;
// 댓글 아이디가 넘어오면 답변, 수정 // 댓글 아이디가 넘어오면 답변, 수정
if (comment_id) if (comment_id) {
{
if (work == 'c') if (work == 'c')
el_id = 'reply_' + comment_id; el_id = 'reply_' + comment_id;
else{ else {
if(type=='clo') if (type == 'clo')
el_id = 'edit_cl_' + comment_id; el_id = 'edit_cl_' + comment_id;
else else
el_id = 'edit_' + comment_id; el_id = 'edit_' + comment_id;
@ -301,10 +298,8 @@ function comment_box(comment_id, work, type)
else else
el_id = 'bo_vc_w'; el_id = 'bo_vc_w';
if (save_before != el_id) if (save_before != el_id) {
{ if (save_before) {
if (save_before)
{
document.getElementById(save_before).style.display = 'none'; document.getElementById(save_before).style.display = 'none';
document.getElementById(save_before).innerHTML = ''; document.getElementById(save_before).innerHTML = '';
} }
@ -313,18 +308,17 @@ function comment_box(comment_id, work, type)
document.getElementById(el_id).innerHTML = save_html; document.getElementById(el_id).innerHTML = save_html;
// 댓글 수정 // 댓글 수정
if (work == 'cu') if (work == 'cu') {
{
$('#btn_submit').text('수정'); $('#btn_submit').text('수정');
document.getElementById('wr_content').value = document.getElementById('save_comment_' + comment_id).value; document.getElementById('wr_content').value = document.getElementById('save_comment_' + comment_id).value;
if(type=='clo'){ if (type == 'clo') {
document.getElementById('wr_content').value = '옷장'; document.getElementById('wr_content').value = '옷장';
document.getElementById('bf_content').value = document.getElementById('save_cl_' + comment_id).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; document.getElementById('wr_10').value = document.getElementById('save_order_' + comment_id).value;
} }
if (typeof char_count != 'undefined') if (typeof char_count != 'undefined')
check_byte('wr_content', 'char_count'); check_byte('wr_content', 'char_count');
if (document.getElementById('secret_comment_'+comment_id).value) if (document.getElementById('secret_comment_' + comment_id).value)
document.getElementById('secret').checked = true; document.getElementById('secret').checked = true;
else else
document.getElementById('secret').checked = false; document.getElementById('secret').checked = false;
@ -335,39 +329,37 @@ function comment_box(comment_id, work, type)
save_before = el_id; save_before = el_id;
} }
if(type=='clo'){ if (type == 'clo') {
$('#'+el_id+' #wr_content').hide(); $('#' + el_id + ' #wr_content').hide();
$('#'+el_id+' #bf_content, #'+el_id+' #bf_file, #'+el_id+' #wr_10').show(); $('#' + el_id + ' #bf_content, #' + el_id + ' #bf_file, #' + el_id + ' #wr_10').show();
if(work=='c'){ if (work == 'c') {
$('#'+el_id+' #wr_content').text('옷장'); $('#' + el_id + ' #wr_content').text('옷장');
} }
} }
if (type=='link') if (type == 'link') {
{ if (work == 'c') {
if(work=='c'){ $('#' + el_id + ' #wr_content').text('');
$('#'+el_id+' #wr_content').text(''); }
$('#' + el_id + ' #bf_content, #' + el_id + ' #bf_file, #' + el_id + ' #wr_10').hide();
$('#' + el_id + ' #wr_content').show();
} }
$('#'+el_id+' #bf_content, #'+el_id+' #bf_file, #'+el_id+' #wr_10').hide();
$('#'+el_id+' #wr_content').show();
} }
}
function comment_delete() function comment_delete() {
{
return confirm("이 댓글을 삭제하시겠습니까?"); return confirm("이 댓글을 삭제하시겠습니까?");
} }
// 댓글 입력폼이 보이도록 처리하기위해서 추가 (root님) // 댓글 입력폼이 보이도록 처리하기위해서 추가 (root님)
<? if($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) { ?> <? if ($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) { ?>
// sns 등록 // sns 등록
$(function() { $(function () {
$("#bo_vc_send_sns").load( $("#bo_vc_send_sns").load(
"<? echo G5_SNS_URL; ?>/view_comment_write.sns.skin.php?bo_table=<? echo $bo_table; ?>", "<? echo G5_SNS_URL; ?>/view_comment_write.sns.skin.php?bo_table=<? echo $bo_table; ?>",
function() { function () {
save_html = document.getElementById('bo_vc_w').innerHTML; save_html = document.getElementById('bo_vc_w').innerHTML;
} }
); );
}); });
<? } ?> <? } ?>
</script> </script>

View file

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

View file

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

View file

@ -1,4 +1,4 @@
<?php <?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");
?>