This commit is contained in:
Amberstone 2024-10-21 11:10:59 +09:00
commit 99b93b3da9
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
11 changed files with 1438 additions and 0 deletions

4
_common.php Normal file
View file

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

183
list.skin.php Normal file
View file

@ -0,0 +1,183 @@
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 ?>
<?if($board['bo_4']==2) {
add_stylesheet('<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.5.0/css/swiper.min.css">', 0); ?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.5.0/js/swiper.min.js"></script>
<?}?>
<?
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
$au_type=$board['bo_1']?$board['bo_1']:'오리지널';
$slide_space=10;
$margin="5px";
$slide_loop=($board['bo_3']) ? 'true':'false';
if($board['bo_table_width']==0) $width="100%";
$cate=array();
$lists=array();
?>
<? if($board['bo_content_head']) { ?>
<div class="board-notice">
<?=stripslashes($board['bo_content_head']);?>
</div>
<? } ?>
<div class="board-skin-basic" style="max-width:<?=$width?>;">
<!-- 게시판 카테고리 시작 { -->
<? if ($is_category && !$board['bo_4']) { ?>
<nav id="navi_category">
<ul>
<?php echo $category_option ?>
</ul>
</nav>
<? } ?>
<!-- } 게시판 카테고리 -->
<?
if($board['bo_4']=='1' && $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 desc, wr_num");
for($k=0;$row=sql_fetch_array($list_item);$k++){
$lists[$k]=get_list($row,$board,$board_skin_url);
}
?>
<div class="swiper-container" >
<?if($board['bo_4']=='1' && $is_category){?><h2><?=$cate[$h]?></h2><?}?>
<ul class="swiper-wrapper"><?
if($board['bo_2']){
$margins=explode(',',$board['bo_2']);
$margin=trim($margins[0]).'px';
if($margins[1]) $margin.=" ".trim($margins[1]).'px';
$slide_space=trim($margins[0]);
}
if(count($lists)>0){
for ($i=0; $i<count($lists); $i++) {
if($is_category) {
if(($board['bo_4']=='1' && $lists[$i]['ca_name']!=$cate[$h]) || (!$board['bo_4'] && $sca && $lists[$i]['ca_name']!=$sca)) continue;
}
if($lists[$i]['wr_file']>0){
if($lists[$i]['wr_8']=='wr_1' || $lists[$i]['wr_8']==''){
if($lists[$i]['wr_width']=='0')
$position="center top";
else
$position = "-".$lists[$i]['wr_width']."px 0";
$thumb_img = get_list_thumbnail($bo_table, $lists[$i]['wr_id'],0,$board['bo_gallery_height'],true,true,'custom',false,'',$lists[$i]['wr_height']);
if($thumb_img['src'])$thumb=$thumb_img['src'];
else $thumb="";
}else{
$idx=$lists[$i]['wr_8'];
$thumb=$lists[$i][$idx];
$position="center";
}
}else {
$thumb="";
}
?><li class="<?=$board['bo_4']==2? 'swiper-slide':'bo-list';?>" style="<?if($board['bo_4']<2){?>width:<?=$board['bo_gallery_width']+($margins[0]*2)?>px;margin:<?=$margin?>;<?}?>">
<a href="<?=$lists[$i]['href']?>" class="ui-thumb theme-box<?if(!$thumb) echo " empty";?>
<?if(strstr($lists[$i]['wr_option'],'secret')) echo "secret";?>" style="<?if($board['bo_4']<2){?>width:<?=$board['bo_gallery_width']?>px;<?}?>height:<?=$board['bo_gallery_height']?>px;<?if($thumb){?>background-image:url(<?=$thumb?>);background-repeat:no-repeat;background-position:<?=$position?>;background-size:cover;<?}else{?><?}?>">
</a>
<?if($board['bo_4']<2){?>
<a href="<?=$lists[$i]['href']?>" class="ui-profile">
<strong class="name">
<?=$lists[$i]['wr_subject']?>
</strong>
<span class="type">
<?=$lists[$i]['wr_type']?>
</span>
</a>
<?}?>
</li><? }}?></ul>
</div>
<?if($board['bo_4']==2){?>
<div class="swiper-button-next" ><a href="javascript:void(0);">&gt;</a></div>
<div class="swiper-button-prev" ><a href="javascript:void(0);">&lt;</a></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_4']==2){?>
<!-- Initialize Swiper -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.9.1/underscore-min.js"></script>
<script>
var win=$(window).width();
var space = <?=$slide_space?>;
var loop = <?=$slide_loop?>;
var s_w;
var temp=<?=$bo_gallery_cols?>;
if(win<380) s_w=2;
else if(win<450 && temp>=3) s_w=3;
else if (win<640 && temp>=4) s_w=4;
else s_w=<?=$bo_gallery_cols?>;
var swiper = new Swiper('.swiper-container', {
slidesPerView: s_w,
spaceBetween: space,
slidesPerGroup: s_w,
loop: loop,
loopFillGroupWithBlank: false,
mousewheel: true,
direction: 'horizontal',
pagination: {
el: '.swiper-pagination',
clickable: true,
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
$(window).on('resize',_.debounce(function(){
var win=$(window).width();
var temp=<?=$bo_gallery_cols?>;
if(win<380) s_w=2;
else if(win<450 && temp>=3) s_w=3;
else if (win<640 && temp>=4) s_w=4;
else s_w=<?=$bo_gallery_cols?>;
var swiper = new Swiper('.swiper-container', {
slidesPerView: s_w,
spaceBetween: space,
slidesPerGroup: s_w,
loop: loop,
loopFillGroupWithBlank: false,
mousewheel: true,
direction: 'horizontal',
pagination: {
el: '.swiper-pagination',
clickable: true,
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
},300));
</script>
<?}?>
<!-- } 게시판 목록 -->

57
set_order.php Normal file
View file

@ -0,0 +1,57 @@
<?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 (!$is_admin)
alert('관리자만 접근 가능합니다.');
if($is_admin){
?>
<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:600px;margin:10px auto;">
<ul>
<?
$order=sql_query("select * from {$write_table} where wr_reply='' and wr_is_comment=0 order by wr_10*1 asc");
$parent_type=$board['bo_1']?$board['bo_1']:'오리지널';
for ($i=0;$row=sql_fetch_array($order);$i++){ ?>
<li class="theme-box" style="margin:1px;line-height:30px;padding:0;clear:both;overflow:hidden;">
<a href="#" onclick="$(this).siblings('div').slideToggle(); return false;">
<span style="padding:0 5px">[<?=$parent_type?>]</span>
<span style="padding:0 5px"><?=$row['wr_subject']?></span></a>
<span style="padding:0 5px;"><input name="type[<?=$row['wr_id']?>]" type="text" value="<?=$row['wr_type']?>"></span>
<span style="padding:0 5px;float:right;"><input type="text" value="<?=$row['wr_10']?>" name="order[<?=$row['wr_id']?>]" size="4" style="height:28px;line-height:26px;"></span>
<?if($board['bo_use_category']&&$board['bo_category_list']){?>
<select name="category[<?=$row['wr_id']?>]" style="float:right;">
<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><?}?>
<input type="hidden" name="idx[]" value="<?=$row['wr_id']?>">
<input type="hidden" name="parents[<?=$row['wr_id']?>]" value="<?=$row['wr_parent']?>">
<?
$sub=sql_query("select * from {$write_table} where wr_reply!='' and (ca_name='{$row['wr_subject']}' or wr_9='{$row['wr_id']}') and wr_id!='{$row['wr_id']}' and wr_is_comment=0 order by wr_10*1 asc");
for ($k=0;$row2=sql_fetch_array($sub);$k++){ ?>
<div style="padding-left:10px;clear:both;">
<span style="padding:0 5px">[AU] [<?=$row2['wr_type']?>]</span>
<span style="padding:0 5px"><?=$row2['wr_subject']?></span>
<span style="padding:0 5px;"><input name="type[<?=$row2['wr_id']?>]" type="text" value="<?=$row2['wr_type']?>"></span>
<span style="padding:0 5px;float:right;"><input type="text" value="<?=$row2['wr_10']?>" name="order[<?=$row2['wr_id']?>]" size="4" style="height:28px;line-height:26px;"></span>
<input type="hidden" name="idx[]" value="<?=$row2['wr_id']?>">
<input type="hidden" name="parents[<?=$row2['wr_id']?>]" value="<?=$row['wr_parent']?>">
</div>
<? } ?>
</li>
<? } ?>
</ul>
<br>
<button type="submit" class="ui-btn point">확인</button>
<a href="<?=G5_BBS_URL?>/board.php?bo_table=<?=$bo_table?>" class="ui-btn">목록으로</a>
</div>
</form>
<?}?>

17
set_order_update.php Normal file
View file

@ -0,0 +1,17 @@
<?php
include_once("./_common.php");
for ($i=0;$i<count($idx);$i++){
$k=$idx[$i];
sql_query("update {$write_table}
set wr_10 = '{$order[$k]}',
wr_9 = '{$parents[$k]}',
wr_type = '{$type[$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_9='{$k}'");
}
}
goto_url('./set_order.php?bo_table='.$bo_table.'&write_table='.$write_table);
?>

229
style.css Normal file
View file

@ -0,0 +1,229 @@
@charset "utf-8";
#body hr.padding {height:0;padding:0;}
#body .fix-layout {max-width:1200px;}
/*목록*/
.board-notice { max-width: 300px; padding: 10px; margin: 30px auto; text-align: center; box-sizing: border-box; }
#navi_category ul {text-align:center;padding:30px 0;}
#navi_category li {display:inline-block; padding:5px 0;}
#navi_category li:before {display:inline-block; content:"|";padding:0 15px;opacity:.6;}
#navi_category li:first-child:before {display:none;content:"";}
#navi_category #bo_cate_on {font-weight:bold;}
.board-skin-basic{
position:relative;
width:100%;
padding:0 60px;
margin:30px auto 0;
box-sizing:border-box;
}
.swiper-container { width: 100%; text-align:center; }
.swiper-container h2 { padding:45px 0 20px; } /*카테고리 - 분류별 정렬시 사용*/
.swiper-container li.bo-list{
display:inline-flex;
flex-direction:column;
align-items:center;
position:relative;
padding:0;
text-align: center;
}
.swiper-container li a {display:block;}
.swiper-container li a.ui-thumb {opacity:0.8;overflow:hidden;} /*썸네일 기본*/
.swiper-container li a.ui-thumb:hover{opacity:1;filter:saturate(1);} /*마우스오버*/
.swiper-container li a.ui-profile {text-align:center;padding:10px 0 5px;} /*썸네일 하단 글씨 영역*/
.swiper-container li a.ui-profile .name, .swiper-container li a.ui-profile .type {display:block;line-height:130%;word-break:break-all;}
.swiper-container li a.ui-profile .name {font-size:15px;} /*이름*/
.swiper-container li a.ui-profile .type { display:none !important;opacity:0.7;} /* 구분내용 - 출력을 원하실 경우 display:none !important; 부분을 지워주세요. */
.swiper-container li.swiper-slide {
overflow:hidden;
padding:0;
text-align: center;
/* Center slide text vertically */
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
.swiper-slide a{position:relative;display:block;width:100%;height:100%; font-size: 20px; line-height:150%}
.board-skin-basic .swiper-button-prev, .board-skin-basic .swiper-container-rtl .swiper-button-next,
.board-skin-basic .swiper-button-next, .board-skin-basic .swiper-container-rtl .swiper-button-prev {background-image:none;font-size:44px;line-height:44px;}
.board-skin-basic .swiper-button-prev, .board-skin-basic .swiper-container-rtl .swiper-button-next {left:10px;}
.board-skin-basic .swiper-button-next, .board-skin-basic .swiper-container-rtl .swiper-button-prev {right:10px;}
/*글쓰기*/
.board-write { max-width:800px; padding: 0 10px; margin:30px auto; }
.board-write > dl {position:relative;}
.board-write > dl > dt { width:100px;position:absolute;line-height:32px;text-align:center; }
.board-write > dl > dd { width:100%;margin-left:0;padding-left:110px;box-sizing:border-box;line-height:32px;}
.board-write input.frm_input.full { width: 100%; display:block;margin:1px 0;}
.board-write .frm_input.small { width:50px;}
.board-write .frm_info{line-height:140%;}
.board-write .write-notice {
padding: 20px 10px 10px;
font-size: 11px;
}
.board-write .files {position:relative;}
.board-write .files { margin-top: 20px;}
.board-write .files .sub {position:relative;padding-left:65px; box-sizing:border-box;}
.board-write .files span.sub_tit{position:absolute;left:0;display:block;width:65px;}
.board-write .files .frm_info{padding-top:5px;}
.board-write .files .label-right {position:absolute;top:0;right:0;z-index:2;}
/*본문*/
.board-viewer {
width:100%;
display: block;
position: relative;
box-sizing:border-box;
overflow:hidden;
/*height:auto !important;*/ /*페이지 전체 스크롤 원할 경우 해당 라인 주석처리 해제*/
}
.board-viewer:after{content:"";display:block;clear:both;}
.board-viewer .body_img {
position:relative;
overflow:hidden; /*전신 이미지 스크롤 원할시 hidden 을 auto로 변경*/
float:left;
height:100%;
}
#links-box-open {display:none;}
.links-box {position:absolute;top:0;width:100%;}
.links-box .ui-links {overflow:hidden;padding:10px;}
.links-box .ui-links li {margin-bottom:2px;font-weight:bold; font-size:14px;}
#rel_link {float:left;}
#rel_link li {text-align:left;}
#rel_link li a:before {content:"◈ ";}
#rel_link li a.txt-default:before {content: "◇ ";}
#clo_link {float:right;}
#clo_link li {text-align:right;}
#clo_link li a:after {content:" ◈";}
#clo_link li a.txt-default:after {content: " ◇";}
.board-viewer .contents {
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
padding: 0 15px;
box-sizing:border-box;
float:right;
width:400px;
max-width:550px;
height:100%;
overflow:auto;
}
.board-viewer .contents::-webkit-scrollbar,.board-viewer .body_img::-webkit-scrollbar {display:none;} /*스크롤바 숨김*/
.board-viewer.clear{height:auto !important;}
.board-viewer.clear .body_img, .board-viewer.clear .contents{
float:none;
width:100% !important;
clear:both;height:auto;
}
.board-viewer.clear .contents {
margin:0 auto 30px;
}
.board-viewer.clear .body_img {text-align:center;}
.board-viewer .body-img { height:100%; }
.board-viewer .body-img img{
cursor:pointer;
max-height:100%; /* 전신 세로 최대를 스크린 사이즈에 맞게 설정 */
}
.board-comment-view {position:relative;clear:both;overflow:hidden;}
p.add { margin: 10px 0;}
p.add.txt-left {float:left;}
p.add.txt-right {float:right;}
p.add a {display:inline-block;}
#bo_vc_w {clear:both;}
#bo_v_con {padding:20px 0;}
#bo_v_bot { padding: 15px 0;}
#bo_v_bot .ui-btn {margin-bottom:2px;}
.co-content {text-align:right;}
.board-comment-list { position: relative;clear:both; }
.board-comment-list .item {
position: relative;
margin-bottom:5px;
}
.board-comment-list strong {display:block;margin:20px 0 5px;}
.board-comment-list .co-content {box-sizing:border-box;padding-right:50px;padding-bottom:5px;}
.board-comment-list .co-content .co-inner {text-align:left;}
.board-comment-list .co-info {position:absolute; width:50px; top:0;right:0;}
.board-comment-list .co-content .ui-btn {padding:0 8px; margin:0 2px;}
.board-comment-form {
position: relative;
padding-right: 80px;
}
.board-comment-form .btn_confirm {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 80px;
}
.board-comment-form .btn_confirm .ui-btn {
width: 100%;
height: 100%;
}
.board-comment-form p {
margin: 0;
padding: 5px 10px;
}
#wr_content{display:block;height:100px;}
@media all and (max-width: 640px) {
.board-category {
display: block;
width: 100%;
box-sizing: border-box;
padding: 0 10px;
}
.board-category select {
width: 100%;
}
.bo_fx {
display: block;
width: 100%;
box-sizing: border-box;
padding: 20px 10px !important;
}
.bo_fx a {
display: block;
width: 100%;
}
.board-skin-basic .swiper-button-prev, .board-skin-basic .swiper-container-rtl .swiper-button-next {left:0;}
.board-skin-basic .swiper-button-next, .board-skin-basic .swiper-container-rtl .swiper-button-prev {right:0;}
.board-viewer .body_img ,.board-viewer .contents {width:100%;float:none;clear:both;}
.board-viewer .body_img {text-align:center;}
.board-write .files .sub {padding-left:0;}
.board-write .files span.sub_tit{position:relative;}
.board-write .files .label-right {position:relative;}
#links-box-open {display:block;margin:10px auto;opacity:0.7;}
.links-box {position:relative;top:auto;overflow:hidden;display:none;}
.links-box .ui-links li {font-size:13px;}
}

46
upload_file.php Normal file
View file

@ -0,0 +1,46 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
function upload_c_file($name,$table){
$files=array();
$tmp_file=$_FILES[$name]['tmp_name'];
$filesize=$_FILES[$name]['size'];
$filename=$_FILES[$name]['name'];
$filename=get_safe_filename($filename);
$timg = @getimagesize($tmp_file);
// image type
if ( preg_match("/\.({$config['cf_image_extension']})$/i", $filename) ||
preg_match("/\.({$config['cf_flash_extension']})$/i", $filename) ) {
if ($timg['2'] < 1 || $timg['2'] > 16)
alert("업로드 불가능한 확장자입니다.","./board.php?bo_table=".$bo_table); //@200927
}else{
$files['img']=$timg;
$files['source']=$filename;
$files['size']=$filesize;
// 아래의 문자열이 들어간 파일은 -x 를 붙여서 웹경로를 알더라도 실행을 하지 못하도록 함
$filename = preg_replace("/\.(php|phtm|htm|cgi|pl|exe|jsp|asp|inc)/i", "$0-x", $filename);
$chars_array = array_merge(range(0,9), range('a','z'), range('A','Z'));
shuffle($chars_array);
$shuffle = implode('', $chars_array);
// 첨부파일 첨부시 첨부파일명에 공백이 포함되어 있으면 일부 PC에서 보이지 않거나 다운로드 되지 않는 현상이 있습니다. (길상여의 님 090925)
$file_name = abs(ip2long($_SERVER['REMOTE_ADDR'])).'_'.substr($shuffle,0,8).'_'.replace_filename($filename);
$dest_file = G5_DATA_PATH.'/file/'.$table.'/'.$file_name;
@move_uploaded_file($tmp_file, $dest_file);
@chmod($dest_file, G5_FILE_PERMISSION);
$files['link']=G5_DATA_URL.'/file/'.$table.'/'.$file_name;
$files['name']=$file_name;
if (!get_magic_quotes_gpc()) {
$files['source'] = addslashes($files['source']);
}
return $files;
}
}
?>

151
view.skin.php Normal file
View file

@ -0,0 +1,151 @@
<?
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);
if($board['bo_table_width']==0) $width="100%";
$parent_type=$board['bo_1']?$board['bo_1']:'오리지널';
// 동일캐릭터 wr_9 묶음, au명은 wr_type 사용, 캐릭터명은 wr_subject 사용.
$allow_body=450;
$content_width=400;
if($board['bo_5']) $conts=explode("|",$board['bo_5']);
if($conts[0]) $allow_body=trim($conts[0]);
if($conts[1]) $content_width=trim($conts[1]);
$rel=sql_fetch("select wr_id from {$write_table} where wr_9='{$view['wr_9']}' and wr_id!={$view['wr_9']} order by wr_10*1");
$relate=sql_query("select wr_id, wr_type from {$write_table} where wr_9='{$view['wr_9']}' and wr_id!={$view['wr_9']} order by wr_10*1, wr_reply");
$or_link = './board.php?bo_table='.$bo_table.'&amp;wr_id='.$view['wr_9'].$qstr; // @211117
$parent=sql_fetch("select wr_id, wr_type, wr_7 from {$write_table} where wr_id='{$view['wr_9']}' and wr_is_comment=0");
$cl_no=sql_query("select * from {$write_table} where wr_is_comment=1 and wr_parent='{$wr_id}' and wr_content='옷장' order by wr_10*1 ");
$cl=array();
$idx=0;
for($i=0;$clo=sql_fetch_array($cl_no);$i++){
$cl[$idx]=$clo;
$idx++;
}?>
<div class="board-viewer">
<div id="body_img" class="body_img txt-center">
<?if($view['wr_1']){?>
<div id="body_0" class="body-img"><img src="<?=$view['wr_1']?>" onclick="window.open(this.src);"></div>
<?}?>
<?
for($k=0;$k<count($cl);$k++){
$files=get_file($bo_table,$cl[$k]['wr_id']);
$filelink=G5_DATA_URL.'/file/'.$bo_table.'/'.$files[0]['file'];
?>
<div id="body_<?=$k+1?>" class="body-img" style="display:none;">
<img src="<?=$filelink?>" onclick="window.open(this.src);">
</div>
<?} ?>
<?if($rel['wr_id'] || count($cl)>0){?>
<a href="#" onclick="$(this).next().slideToggle();return false;" id="links-box-open" class="ui-btn small full">AU/옷장</a><?}?>
<div class="links-box">
<div id="rel_link" class="ui-links">
<ul>
<?if($rel['wr_id']){ //@211117 ?>
<li><a href="<?=$or_link?>" class="rel <?=$view['wr_9']!=$wr_id ? ' txt-default': '';?>"><?=($parent['wr_type']&&!$parent['wr_7']) ? $parent['wr_type']: $parent_type?></a></li>
<?for($k=0;$re=sql_fetch_array($relate);$k++){
$link = './board.php?bo_table='.$bo_table.'&amp;wr_id='.$re['wr_id'].$qstr;?>
<li><a href="<?=$link?>" class="rel <?=$re['wr_id']!=$wr_id ? ' txt-default': '';?>"><?=$re['wr_type'] ? $re['wr_type'] : $parent_type;?></a></li>
<?}?>
<?}?>
</ul>
</div>
<div id="clo_link" class="ui-links">
<ul>
<?if(count($cl)>0){?><li><a href="#body_0" class="clo" id="clo_0">기본전신</a></li><?}?>
<?
for($h=0;$h<count($cl);$h++){
$file=get_file($bo_table,$cl[$h]['wr_id']);
$file_link=G5_DATA_URL.'/file/'.$bo_table.'/'.$file[0]['file'];
?>
<li><a href="#body_<?=$h+1?>" class="clo txt-default" id="clo_<?=$h+1?>"><?=$file[0]['content']?></a></li>
<?} ?>
</ul>
</div>
</div>
</div>
<div class="contents">
<div class="content-wrap">
<!-- 본문 내용 시작 { -->
<div id="bo_v_con"><? echo get_view_thumbnail($view['content']); ?></div>
<?//echo $view['rich_content']; // {이미지:0} 과 같은 코드를 사용할 경우 ?>
<!-- } 본문 내용 -->
<?
// 코멘트 입출력
include_once(G5_BBS_PATH.'/view_comment.php');
?>
</div>
<!-- 링크 버튼 시작 { -->
<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 ($view['wr_reply']=='' && $view['mb_id']==$member['mb_id']) { ?><a href="<? echo $reply_href ?>" class="ui-btn"><?=$view['wr_subject']?> AU 등록</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>
</div>
<script>
function board_move(href)
{
window.open(href, "boardmove", "left=50, top=50, width=500, height=550, scrollbars=1");
}
$("a.view_image").click(function() {
window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no");
return false;
});
$("#clo_link a").click(function(){
var idx=$(this).attr("href");
$(".clo").addClass("txt-default");
$(this).removeClass("txt-default");
$(".body-img").fadeOut(300);
$(idx).delay(330).fadeIn(300);
return false;
});
// 레이아웃 셋팅 - 반응형
viewer_setting();
// 화면 사이즈가 변경 될 시, 레이아웃 셋팅 실행
$(window).resize(function() { viewer_setting(); });
function viewer_setting() {
var h=$("header").outerHeight();
var f=$("footer").outerHeight();
var w=$(window).height();
var off=$(".board-viewer").offset().top;
if(h>=w) h=0;
var content_height=w-f-off;
var allow_body=<?=$allow_body?>;
var content_width =<?=$content_width?>;
var viewer_width= $('.board-viewer').outerWidth();
var body_width = Math.floor(viewer_width - content_width );
if(body_width<allow_body) {
$('.board-viewer').addClass('clear');
} else {
$('.board-viewer').removeClass('clear').css('height',content_height);
$('#body_img').css('width',body_width+'px');
$('.board-viewer .contents').css('width',content_width+'px');
}
};
</script>
<!-- } 게시글 읽기 -->

373
view_comment.skin.php Normal file
View file

@ -0,0 +1,373 @@
<?
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='옷장'");
?>
<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'];
$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']);
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>
</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">
<? } ?>
</div>
<? }
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>
<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 ($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>
</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']?>">
<? } ?>
</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">
<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>
<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>
</form>
</div>
<? } ?>
</div>
<?if($member['mb_level']>=$board['bo_comment_level']){?>
<script>
var save_before = '';
var save_html = document.getElementById('bo_vc_w').innerHTML;
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;
}
});
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;
}
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;
}
}
set_comment_token(f);
document.getElementById("btn_submit").disabled = "disabled";
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';
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;
// 댓글 수정
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;
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("이 댓글을 삭제하시겠습니까?");
}
// 댓글 입력폼이 보이도록 처리하기위해서 추가 (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;
}
);
});
<? } ?>
</script>

297
write.skin.php Normal file
View file

@ -0,0 +1,297 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
$c_name=$board['bo_1'] ? $board['bo_1'] : '오리지널';
if($w=='' || $w=='r'){
$write['wr_width']=0;
$write['wr_height']=0;
$wr_type='';
}
else $wr_type=$write['wr_type'];
$category_option = "";
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;
$category_option .= "<option value=\"$categories[$i]\"";
if ($category == $ca_name) {
$category_option .= ' selected="selected"';
}
$category_option .= ">$categories[$i]</option>\n";
}
}
$parent_type=$board['bo_1']? $board['bo_1'] : "오리지널";
?>
<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="file" name="bf_file[]" style="display:none;">
<?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_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>';
}
}
echo $option_hidden;
?>
<div class="board-write theme-box">
<?if($option){?>
<dl>
<dt>옵션</dt>
<dd><?php echo $option ?></dd>
</dl>
<?}?>
<? 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="files">
<div class="sub"><span class="sub_tit">전신</span>
<input type="file" name="bf_file[0]" title="전신 등록 : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file frm_input full">
<input type="hidden" name="wr_1" value="<?=$w=='u' ? $write['wr_1']: ""?>">
<?if($w=='u' && $write['wr_1']){?>
<a href="<?=$write['wr_1']?>" class="ui-btn" target="_blank">전신 확인</a>
<input type="checkbox" id="bf_file_del0" name="bf_file_del[0]" value="wr_1"> <label for="bf_file_del0"> 등록된 전신 삭제</label><?}?>
<label for="wr_8_1" class="label-right"><input type="radio" value="wr_1" name="wr_8" id="wr_8_1" class="wr_8" <?=($write['wr_8']=='wr_1'||($board['bo_upload_count']=='1'&& ($w!='u' || !$write['wr_8']))) ? "checked" : "";?>> 전신을 썸네일로 사용&nbsp;&nbsp;</label>
<div id="crop" <?if($write['wr_8']!='wr_1'&&!($board['bo_upload_count']=='1'&& ($w!='u' || !$write['wr_8']))){?>style="display:none;"<?}?>><span class="sub_tit">크롭 지점</span>
X (왼쪽에서부터) <input type="text" name="wr_width" value="<?=$write['wr_width']?>" class="frm_input small"> px /
Y (위에서부터) <input type="text" name="wr_height" value="<?=$write['wr_height']?>" class="frm_input small"> px</p>
<?=help("* 전신을 썸네일로 사용할 경우 크롭지점을 설정합니다. 왼쪽에서부터 몇픽셀을, 위에서부터 몇픽셀을 잘라낼 것인지 숫자만 적어주세요. X지점이 0일경우 가운데로 맞춰집니다.")?>
</div>
</div>
<?if($board['bo_upload_count']>1){?><div class="sub"><span class="sub_tit">두상</span>
<input type="file" name="bf_file[1]" title="두상 등록 : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file frm_input full">
<input type="hidden" name="wr_2" value="<?=$w=='u' ? $write['wr_2']: ""?>">
<?if($w=='u' && $write['wr_2']){?>
<a href="<?=$write['wr_2']?>" class="ui-btn" target="_blank">두상 확인</a>
<input type="checkbox" id="bf_file_del1" name="bf_file_del[1]" value="wr_2"> <label for="bf_file_del1"> 등록된 두상 삭제</label><?}?>
<label class="label-right" for="wr_8_2"><input type="radio" value="wr_2" name="wr_8" class="wr_8" id="wr_8_2" <?=($write['wr_8']=='wr_2'||($board['bo_upload_count']>1 && ($w!='u' || !$write['wr_8']))) ? "checked" : "";?>> 두상을 썸네일로 사용&nbsp;&nbsp;</label>
<?=help("* 본문에는 출력되지 않습니다. 썸네일 사이즈와 다를 경우 사이즈에 맞게 늘어나거나 줄어듭니다.")?>
</div>
<?}?>
<!--
<?if($board['bo_upload_count']>2){?><div class="sub"><span class="sub_tit">흉상/기타</span>
<input type="file" name="bf_file[2]" title="흉상 등록 : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file frm_input full">
<input type="hidden" name="wr_3" value="<?=$w=='u' ? $write['wr_3']: ""?>">
<?if($w=='u' && $write['wr_3']){?>
<a href="<?=$write['wr_3']?>" class="ui-btn" target="_blank">흉상 확인</a>
<input type="checkbox" id="bf_file_del2" name="bf_file_del[2]" value="wr_3"> <label for="bf_file_del2"> 등록된 흉상 삭제</label><?}?>
<label for="wr_8_3" class="label-right"><input type="radio" value="wr_3" name="wr_8" class="wr_8" id="wr_8_3" <?=($write['wr_8']=='wr_3') ? "checked" : "";?>>흉상을 썸네일로 사용&nbsp;&nbsp;</label>
</div>
<?}?>
-->
<?=help("* 현재 설정된 썸네일 사이즈: {$board['bo_gallery_width']} x {$board['bo_gallery_height']}\n* 슬라이드형 목록 스타일에서는 가로사이즈를 사용하지 않습니다.")?>
</div>
</dd>
</dl>
<dl>
<dt>캐릭터명</dt>
<dd><div class="wr_subject" style="margin-top: 20px;">
<input type="text" name="wr_subject" value="<?php echo $write['wr_subject'] ?>" class="frm_input full required" size="50" maxlength="255" required>
<?=help("본문에는 출력되지 않습니다.")?>
</div></dd>
</dl>
<? //오리지널캐릭터 아이디값 구함
if($w=='r' || $write['wr_reply'] ) {
$uid=$write['wr_9'];
}
else {
$uid=$wr_id;
}
?>
<input type="hidden" name="wr_9" value="<?=$uid?>">
<dl>
<dt>구분</dt>
<dd><div class="wr_type">
<input type="text" name="wr_type" value="<?=$w=='u' ? $write['wr_type'] : "";?>" <?if($w=='r' || $write['wr_reply']) echo "required";?>> <?if($w!='r' && $write['wr_reply']==''){?>
<input type="checkbox" value="1" name="wr_7" <?=($write['wr_7']&&$w!='r') ? "checked":""?>> 프로필 AU 목록에 '<?=$parent_type?>'로 표기<?}?>
<?=help("커뮤 명칭, AU 명칭 등 구분용으로 사용할 내용을 입력해주세요.\n목록에 노출되는 프로필(오리지널)일 경우 출력되는 항목이 있습니다.(배포글 참조)")?>
</div>
</dd>
</dl>
<dl>
<dt>설정 내용</dt>
<dd><div class="wr_content">
<?if(!$board['bo_use_dhtml_editor']){echo help("* 게시판에서 dhtml 에디터 사용을 체크하시는것을 추천합니다.");}?>
<?php if($write_min || $write_max) { ?>
<!-- 최소/최대 글자 사용 -->
<p id="char_count_desc"> 게시판은 최소 <strong><?php echo $write_min; ?></strong>글자 이상, 최대 <strong><?php echo $write_max; ?></strong>글자 이하까지 글을 쓰실 수 있습니다.</p>
<?php } ?>
<?php echo $editor_html; // 에디터 사용시는 에디터로, 아니면 textarea 로 노출 ?>
<?php if($write_min || $write_max) { ?>
<!-- 최소/최대 글자 사용 -->
<div id="char_count_wrap"><span id="char_count"></span>글자</div>
<?php } ?>
</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이 가장 처음으로 캐릭터 목록상에서는 숫자가 클수록 최신(가장 왼쪽), AU 목록상에서는 숫자가 클수록 오리지널에서 순서가 멀어집니다. \n순서를 정하지 않을 경우 먼저 등록한 순서대로 정렬됩니다.");?>
</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>
<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");
});
});
<?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 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;
}
});
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 (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>
</section>
<!-- } 게시물 작성/수정 -->

View file

@ -0,0 +1,44 @@
<?php
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']}',
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']}
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']}
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']}
set bf_content = '{$bf_content}'
where wr_id ='{$comment_id}' and
bo_table = '{$bo_table}' and
bf_no = '0'
");
}
?>

37
write_update.skin.php Normal file
View file

@ -0,0 +1,37 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$customer_sql = "";
$temp_wr_id = $wr_id;
if($w=='' and !$wr_9) $customer_sql .=",wr_9='{$wr_id}'";
if($w=='u' && $bf_file_del){
for($i=0;$i<$board['bo_upload_count'];$i++){
if(!$bf_file_del[$i]) continue;
sql_query("update {$write_table} set {$bf_file_del[$i]}='' where wr_id='{$wr_id}'");
if($bf_file_del[$i]=='wr_1') $common_line="and bf_no='0'";
if($bf_file_del[$i]=='wr_2') $common_line="and bf_no='1'";
if($bf_file_del[$i]=='wr_3') $common_line="and bf_no='2'";
sql_query("delete from {$g5['board_file_table']} where wr_id='{$wr_id}' and bo_table='{$bo_table}' {$common_line}");
}
}
for($i=0;$i<$board['bo_upload_count'];$i++){
if($_FILES['bf_file']['name'][$i]){
$uimg=sql_fetch("select bf_file from {$g5['board_file_table']} where bo_table='{$bo_table}' and wr_id='{$wr_id}' and bf_no='{$i}'");
$ulink=G5_DATA_URL.'/file/'.$bo_table.'/'.$uimg['bf_file'];
$uid=$i+1;
$customer_sql.=", wr_{$uid}='{$ulink}'";
if($i=='0'){
sql_query("update {$g5['board_file_table']} set bf_content='기본전신' where wr_id='{$wr_id}' and bf_no='0'");
}
}
}
sql_query(" update {$write_table}
set wr_id = '{$wr_id}'
{$customer_sql}
where wr_id = '{$wr_id}' ");
?>