게시판 체크박스 나타나게하는 방법 문의드립니다 ㅜ
관련링크
본문
게시판 체크박스 선택시 게시글에 나타나게하고싶은데
아직 코딩이 너무 미숙해 어떻게 수정 해야할지 모르겟습니당 ㅠㅠ
write.skin.php
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
$tNum="협력사모집";
$sNum="협력사모집";
$g5['title'] = "";
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
include_once(G5_THEME_PATH.'/sub_head.php');
?>
<?php
if (!defined("_INDEX_") && !defined("_NOVISUAL_")){ ?>
<div class="sub_visual" style="background:url('/theme/jysolution/img/subvisual<?=$topmenu_tNum[$tNum]?>.png')">
<div class="sub_top_text">
<h3><?php echo $tNum ?></h3>
</div>
</div>
<div class="lnb_wrap">
<?php include_once(G5_THEME_PATH.'/mildmap.php'); ?>
</div>
<?php }
?>
<section id="bo_w" class="width common">
<h2 class="bo_w_name"><?php echo $sNum?> 글쓰기</h2>
<!-- 게시물 작성/수정 시작 { -->
<form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off" style="width:<?php echo $width; ?>">
<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 ?>">
<?php
$option = '';
$option_hidden = '';
if ($is_notice || $is_esg || $is_secret || $is_mail) {
$option = '';
if ($is_notice) {
$option .= PHP_EOL.'<li class="chk_box"><input type="checkbox" id="notice" name="notice" class="selec_chk" value="1" '.$notice_checked.'>'.PHP_EOL.'<label for="notice"><span></span>공지</label></li>';
}
if ($is_esg) {
if ($is_esg) {
$option_hidden .= '<input type="hidden" value="esg" name="esg">';
} else {
$option .= $option .= PHP_EOL.'<li class="chk_box"><input type="checkbox" id="esg" name="esg" class="selec_chk" value="3" '.$esg_checked.'>'.PHP_EOL.'<label for="esg"><span></span>esg</label></li>';
}
}
if ($is_secret) {
if ($is_admin || $is_secret==1) {
$option .= PHP_EOL.'<li class="chk_box"><input type="checkbox" id="secret" name="secret" class="selec_chk" value="secret" '.$secret_checked.'>'.PHP_EOL.'<label for="secret"><span></span>비밀글</label></li>';
} else {
$option_hidden .= '<input type="hidden" name="secret" value="secret">';
}
}
if ($is_mail) {
$option .= PHP_EOL.'<li class="chk_box"><input type="checkbox" id="mail" name="mail" class="selec_chk" value="mail" '.$recv_email_checked.'>'.PHP_EOL.'<label for="mail"><span></span>답변메일받기</label></li>';
}
}
echo $option_hidden;
?>
<div class="write_wrap">
<?php if($is_name){?>
<div class="write_box required">
<label for="wr_name" class="bwcon_title">이름</label>
<div class="write_content"><input type="text" name="wr_name" value="<?php echo $name;?>" id="wr_name" required class="" placeholder="이름"></div>
</div>
<?php }?>
<?php if($is_password){?>
<div class="write_box <?php echo $password_required;?>">
<label for="wr_password" class="bwcon_title">패스워드</label>
<div class="write_content"><input type="password" name="wr_password" id="wr_password" <?php echo $password_required;?> class="" placeholder="비밀번호" autocomplete="new-password"></div>
</div>
<?php }?>
<?php if($is_email){?>
<div class="write_box">
<label for="wr_email" class="bwcon_title">이메일</label>
<div class="write_content"><input type="text" name="wr_email" value="<?php echo $email;?>" id="wr_email" class="email " placeholder="이메일"></div>
</div>
<?php }?>
<!-- <?php if($is_homepage){?>
<div class="write_box">
<label for="wr_homepage" class="bwcon_title">홈페이지</label>
<div class="write_content"><input type="text" name="wr_homepage" value="<?php echo $homepage;?>" id="wr_homepage" class="" placeholder="홈페이지"></div>
</div>
<?php }?> -->
</div>
<div class="write_wrap">
<?php if($option){?>
<div class="write_box">
<label for="" class="bwcon_title">옵션</label>
<div class="write_content"><?php echo $option ?></div>
</div>
<?php }?>
<?php if($is_category){?>
<div class="write_box required">
<label for="ca_name" class="bwcon_title">분류</label>
<div class="write_content">
<select name="ca_name" id="ca_name" required>
<option value="">분류를 선택하세요</option>
<?php echo $category_option ?>
</select>
</div>
</div>
<?php }?>
<div class="write_box required">
<label for="wr_subject" class="bwcon_title">제목</label>
<div class="write_content">
<input type="text" name="wr_subject" value="<?php echo $subject ?>" id="wr_subject" required class="" size="50" maxlength="255" placeholder="제목">
<?php if ($is_member) { // 임시 저장된 글 기능 ?>
<script src="<?php echo G5_JS_URL; ?>/autosave.js"></script>
<?php if($editor_content_js) echo $editor_content_js; ?>
<button type="button" id="btn_autosave" class="btn_frmline">임시 저장된 글 (<span id="autosave_count"><?php echo $autosave_count; ?></span>)</button>
<div id="autosave_pop">
<strong>임시 저장된 글 목록</strong>
<ul></ul>
<div><button type="button" class="autosave_close">닫기</button></div>
</div>
<?php } ?>
</div>
</div>
<div class="write_box required">
<label for="" class="bwcon_title">연락처</label>
<div class="write_content"><input type="text" name="wr_1" id="wr_1" required value="<?=$write['wr_1']?>" placeholder="연락처"></div>
</div>
<div class="write_box required">
<label for="" class="bwcon_title">사업자번호</label>
<div class="write_content"><input type="text" name="wr_2" id="wr_2ㄴ" required value="<?=$write['wr_2']?>" placeholder="사업자번호"></div>
</div>
<div class="write_box required">
<label for="" class="bwcon_title">담당자이름</label>
<div class="write_content"><input type="text" name="wr_3" id="wr_3" required value="<?=$write['wr_3']?>" placeholder="담당자이름"></div>
</div>
<div class="write_box required">
<label for="" class="bwcon_title">제휴제안 내용</label>
<div class="write_content">
<input type="checkbox" name="wr_4" id="wr_4" r <?=($write['wr4[1]'])?"checked":"";?> value="ESG 및 지속가능성">ESG 및 지속가능성
<input type="checkbox" name="wr4[2]" id="wr4[2]" <?=($write['wr3[2]'])?"checked":"";?> value="특허(산업재산권)">특허(산업재산권)
<input type="checkbox" name="wr4[3]" id="wr4[3]" <?=($write['wr3[3]'])?"checked":"";?> value="R&D">R&D
<input type="checkbox" name="wr4[4]" id="wr4[4]" <?=($write['wr3[4]'])?"checked":"";?> value="ISO">ISO
<input type="checkbox" name="wr4[5]" id="wr4[5]" <?=($write['wr3[5]'])?"checked":"";?> value="인증">인증
<input type="checkbox" name="wr4[6]" id="wr4[6]" <?=($write['wr3[6]'])?"checked":"";?> value="교육"> 교육
<input type="checkbox" name="wr4[6]" id="wr4[6]" <?=($write['wr3[6]'])?"checked":"";?> value="기타">기타 </div>
</div>
</div>
<div class="write_wrap">
<label for="wr_content" class="sound_only">내용<strong>필수</strong></label>
<div class="wr_content <?php echo $is_dhtml_editor ? $config['cf_editor'] : ''; ?>">
<?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>
</div>
<?php $i=1; ?>
<div class="write_wrap">
<?php for ($i=1; $is_link && $i<=G5_LINK_COUNT; $i++) { ?>
<div class="write_box">
<label for="wr_link<?php echo $i ?>" class="bwcon_title">링크 #<?php echo $i ?></label>
<div class="write_content"><input type="text" name="wr_link<?php echo $i ?>" value="<?php if($w=="u"){ echo $write['wr_link'.$i]; } ?>" id="wr_link<?php echo $i ?>" class="" placeholder="https://"></div>
</div>
<?php } ?>
</div>
<?php
if($file_count){echo '<div class="write_wrap">';}
for ($i=0; $is_file && $i<$file_count; $i++)
{
?>
<div class="write_box">
<label for="bf_file_<?php echo $i+1 ?>" class="bwcon_title">파일 #<?php echo $i+1 ?></label>
<div class="write_content">
<input type="text" autocomplete="off" placeholder="파일을 첨부해 주세요." readonly="readonly" class="file_name">
<label class="file_upload">업로드<input type="file" name="bf_file[]" id="bf_file_<?php echo $i+1 ?>" class="hidden_file" title="파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능"></label>
</div>
</div>
<?php if ($is_file_content) { ?>
<div class="write_box">
<label for="bf_file_<?php echo $i+1 ?>_title" class="bwcon_title">파일 #<?php echo $i+1 ?> 설명</label>
<div class="write_content">
<input type="text" name="bf_content[]" id="bf_file_<?php echo $i+1 ?>_title" value="<?php echo ($w == 'u') ? $file[$i]['bf_content'] : ''; ?>" title="파일 설명을 입력해주세요." placeholder="파일 설명을 입력해주세요.">
</div>
</div>
<?php } ?>
<?php if($w == 'u' && $file[$i]['file']) { ?>
<div class="write_box">
<label for="" class="bwcon_title">파일 #<?php echo $i+1 ?> 관리</label>
<div class="write_content">
<span class="file_del"><input type="checkbox" id="bf_file_del<?php echo $i ?>" name="bf_file_del[<?php echo $i; ?>]" value="1"><span></span><label for="bf_file_del<?php echo $i ?>"><?php echo $file[$i]['source'].'('.$file[$i]['size'].')'; ?> 파일 삭제</label></span>
</div>
</div>
<?php } ?>
<?php
}
if($file_count){echo '</div>';}
?>
<?php if ($is_use_captcha) { //자동등록방지 ?>
<div class="write_wrap">
<?php echo $captcha_html ?>
</div>
<?php } ?>
<div class="btn_confirm write_div">
<a href="<?php echo get_pretty_url($bo_table); ?>" class="btn_cancel btn">취소</a>
<button type="submit" id="btn_submit" accesskey="s" class="btn_submit btn">작성완료</button>
</div>
</form>
<script>
$(function(){
$(".hidden_file").on("change", function(){
$(this).parent().parent().find(".file_name").val($(this).val());
});
});
<?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;
}
}
}
<?php echo $captcha_js; // 캡챠 사용시 자바스크립트에서 입력된 캡챠를 검사함 ?>
document.getElementById("btn_submit").disabled = "disabled";
return true;
}
</script>
</section>
<!-- } 게시물 작성/수정 끝 -->
view.skin.php
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
$tNum="협력사모집";
$sNum="협력사모집";
$g5['title'] = "";
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
include_once(G5_THEME_PATH.'/sub_head.php');
?>
<?php
if (!defined("_INDEX_") && !defined("_NOVISUAL_")){ ?>
<div class="sub_visual" style="background:url('/theme/jysolution/img/subvisual<?=$topmenu_tNum[$tNum]?>.png')">
<div class="sub_top_text">
<h3><?php echo $tNum ?></h3>
</div>
</div>
<div class="lnb_wrap">
<?php include_once(G5_THEME_PATH.'/mildmap.php'); ?>
</div>
<?php }
?>
<!-- https://sir.kr/g5_tip/17852?sfl=wr_subject%7C%7Cwr_content&stx=%EB%AA%A8%EC%95%84%EB%B9%84%EC%A6%88 모아비즈님 스마트 에디터 참고 -->
<script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script>
<!-- 게시물 읽기 시작 { -->
<article id="bo_v" class="width common">
<div class="bo_v_topcon">
<?php if ($category_name) { ?>
<span class="bo_v_cate"><?php echo $view['ca_name']; // 분류 출력 끝 ?></span>
<?php } ?>
<ul class="btn_bo_user bo_v_com">
<li><a href="<?php echo $list_href ?>" class="btn_b01 btn" title="목록"><span class="view_btn">목록</span></a></li>
<?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b01 btn" title="글쓰기"><span class="view_btn">글쓰기</span></a></li><?php } ?>
<?php if ($update_href) { ?><li><a href="<?php echo $update_href ?>" class="btn_b01 btn"><span class="view_btn">수정</span></a></li><?php } ?>
<?php if ($delete_href) { ?><li><a href="<?php echo $delete_href ?>" class="btn_b01 btn" onclick="del(this.href); return false;"><span class="view_btn">삭제</span></a></li><?php } ?>
<?php if($update_href || $delete_href || $copy_href || $move_href || $search_href) { ?>
<!-- <li>
<button type="button" class="btn_more_opt is_view_btn btn_b01 btn"><i class="fa fa-ellipsis-v" aria-hidden="true"></i><span class="sound_only">게시판 리스트 옵션</span></button>
<ul class="more_opt is_view_btn">
<?php if ($copy_href) { ?><li><a href="<?php echo $copy_href ?>" onclick="board_move(this.href); return false;">복사<i class="fa fa-files-o" aria-hidden="true"></i></a></li><?php } ?>
<?php if ($move_href) { ?><li><a href="<?php echo $move_href ?>" onclick="board_move(this.href); return false;">이동<i class="fa fa-arrows" aria-hidden="true"></i></a></li><?php } ?>
<?php if ($search_href) { ?><li><a href="<?php echo $search_href ?>">검색<i class="fa fa-search" aria-hidden="true"></i></a></li><?php } ?>
</ul>
</li> -->
<?php } ?>
</ul>
</div>
<header>
<h2 id="bo_v_title">
<span class="bo_v_tit">
<?php
echo cut_str(get_text($view['wr_subject']), 70); // 글제목 출력
?></span>
</h2>
</header>
<section id="bo_v_info">
<h2>페이지 정보</h2>
<div class="profile_info">
<div class="pf_img"><?php echo get_member_profile_img($view['mb_id']) ?></div>
<ul class="profile_info_ct">
<li><span class="pro_title"><i class="ri-user-3-line"></i></span><p><?php echo $view['name'] ?></p></li>
<li><span class="pro_call pro_title"><i class="ri-phone-line"></i></span><p><?php echo $view['wr_1']?$view['wr_1']:"-"; ?>
</p></li>
<li><span class="pro_call pro_title">사업자번호</span><p><?php echo $view['wr_2']?$view['wr_2']:"-"; ?>
</p></li>
<li><span class="pro_call pro_title">담당자이름</span><p><?php echo $view['wr_3']?$view['wr_3']:"-"; ?>
</p></li>
<li><span class="pro_call pro_title">제휴제안 내용</span><p><?php echo $view['wr_4']?$view['wr_4']:"-"; ?>
</p></li>
</ul>
<ul class="profile_info_day">
<li><span class="pro_title"><i class="ri-calendar-line"></i></span><p><?php echo date("Y-m-d", strtotime($view['wr_datetime'])) ?></p></li>
</ul>
</div>
<!-- 게시물 상단 버튼 시작 { -->
<div id="bo_v_top">
<?php ob_start(); ?>
<script>
jQuery(function($){
// 게시판 보기 버튼 옵션
$(".btn_more_opt.is_view_btn").on("click", function(e) {
e.stopPropagation();
$(".more_opt.is_view_btn").toggle();
})
;
$(document).on("click", function (e) {
if(!$(e.target).closest('.is_view_btn').length) {
$(".more_opt.is_view_btn").hide();
}
});
});
</script>
<?php
$link_buttons = ob_get_contents();
ob_end_flush();
?>
</div>
<!-- } 게시물 상단 버튼 끝 -->
</section>
<section id="bo_v_atc">
<h2 id="bo_v_atc_title">본문</h2>
<?php
// 파일 출력
$v_img_count = count($view['file']);
if($v_img_count) {
echo "<div id=\"bo_v_img\">\n";
foreach($view['file'] as $view_file) {
echo get_file_thumbnail($view_file);
}
echo "</div>\n";
}
?>
<!-- 본문 내용 시작 { -->
<div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div>
<?php //echo $view['rich_content']; // view_image($view, '0', '') 과 같은 코드를 사용할 경우 ?>
<!-- } 본문 내용 끝 -->
<?php if ($is_signature) { ?><p><?php echo $signature ?></p><?php } ?>
<!-- 추천 비추천 시작 { -->
<?php if ( $good_href || $nogood_href) { ?>
<div id="bo_v_act">
<?php if ($good_href) { ?>
<span class="bo_v_act_gng">
<a href="<?php echo $good_href.'&'.$qstr ?>" id="good_button" class="bo_v_good"><i class="fa fa-thumbs-o-up" aria-hidden="true"></i><span class="sound_only">추천</span><strong><?php echo number_format($view['wr_good']) ?></strong></a>
<b id="bo_v_act_good"></b>
</span>
<?php } ?>
<?php if ($nogood_href) { ?>
<span class="bo_v_act_gng">
<a href="<?php echo $nogood_href.'&'.$qstr ?>" id="nogood_button" class="bo_v_nogood"><i class="fa fa-thumbs-o-down" aria-hidden="true"></i><span class="sound_only">비추천</span><strong><?php echo number_format($view['wr_nogood']) ?></strong></a>
<b id="bo_v_act_nogood"></b>
</span>
<?php } ?>
</div>
<?php } else {
if($board['bo_use_good'] || $board['bo_use_nogood']) {
?>
<div id="bo_v_act">
<?php if($board['bo_use_good']) { ?><span class="bo_v_good"><i class="fa fa-thumbs-o-up" aria-hidden="true"></i><span class="sound_only">추천</span><strong><?php echo number_format($view['wr_good']) ?></strong></span><?php } ?>
<?php if($board['bo_use_nogood']) { ?><span class="bo_v_nogood"><i class="fa fa-thumbs-o-down" aria-hidden="true"></i><span class="sound_only">비추천</span><strong><?php echo number_format($view['wr_nogood']) ?></strong></span><?php } ?>
</div>
<?php
}
}
?>
<!-- } 추천 비추천 끝 -->
</section>
<div class="bo_v_file_wrap">
<?php
$cnt = 0;
if ($view['file']['count']) {
for ($i=0; $i<count($view['file']); $i++) {
if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view'])
$cnt++;
}
}
?>
<?php if($cnt) { ?>
<!-- 첨부파일 시작 { -->
<section id="bo_v_file">
<h2>첨부파일</h2>
<ul>
<?php
// 가변 파일
for ($i=0; $i<count($view['file']); $i++) {
if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view']) {
?>
<li>
<i class="fa fa-folder-open" aria-hidden="true"></i>
<a href="<?php echo $view['file'][$i]['href']; ?>" class="view_file_download">
<strong><?php echo $view['file'][$i]['source'] ?></strong> <?php echo $view['file'][$i]['content'] ?> (<?php echo $view['file'][$i]['size'] ?>)
</a>
<br>
<!-- <span class="bo_v_file_cnt"><?php echo $view['file'][$i]['download'] ?>회 다운로드 | DATE : <?php echo $view['file'][$i]['datetime'] ?></span> -->
</li>
<?php
}
}
?>
</ul>
</section>
<!-- } 첨부파일 끝 -->
<?php } ?>
<?php if(isset($view['link']) && array_filter($view['link'])) { ?>
<!-- 관련링크 시작 { -->
<section id="bo_v_link">
<h2>관련링크</h2>
<ul>
<?php
// 링크
$cnt = 0;
for ($i=1; $i<=count($view['link']); $i++) {
if ($view['link'][$i]) {
$cnt++;
$link = cut_str($view['link'][$i], 70);
?>
<li>
<i class="fa fa-link" aria-hidden="true"></i>
<a href="<?php echo $view['link_href'][$i] ?>" target="_blank">
<strong><?php echo $link ?></strong>
</a>
<br>
<!-- <span class="bo_v_link_cnt"><?php echo $view['link_hit'][$i] ?>회 연결</span> -->
</li>
<?php
}
}
?>
</ul>
</section>
<!-- } 관련링크 끝 -->
<?php } ?>
</div>
<?php
// 코멘트 입출력
include_once(G5_BBS_PATH.'/view_comment.php');
?>
</article>
<!-- } 게시판 읽기 끝 -->
<script>
<?php if ($board['bo_download_point'] < 0) { ?>
$(function() {
$("a.view_file_download").click(function() {
if(!g5_is_member) {
alert("다운로드 권한이 없습니다.\n회원이시라면 로그인 후 이용해 보십시오.");
return false;
}
var msg = "파일을 다운로드 하시면 포인트가 차감(<?php echo number_format($board['bo_download_point']) ?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?";
if(confirm(msg)) {
var href = $(this).attr("href")+"&js=on";
$(this).attr("href", href);
return true;
} else {
return false;
}
});
});
<?php } ?>
function board_move(href)
{
window.open(href, "boardmove", "left=50, top=50, width=500, height=550, scrollbars=1");
}
</script>
<script>
$(function() {
$("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;
});
// 추천, 비추천
$("#good_button, #nogood_button").click(function() {
var $tx;
if(this.id == "good_button")
$tx = $("#bo_v_act_good");
else
$tx = $("#bo_v_act_nogood");
excute_good(this.href, $(this), $tx);
return false;
});
// 이미지 리사이즈
$("#bo_v_atc").viewimageresize();
});
function excute_good(href, $el, $tx)
{
$.post(
href,
{ js: "on" },
function(data) {
if(data.error) {
alert(data.error);
return false;
}
if(data.count) {
$el.find("strong").text(number_format(String(data.count)));
if($tx.attr("id").search("nogood") > -1) {
$tx.text("이 글을 비추천하셨습니다.");
$tx.fadeIn(200).delay(2500).fadeOut(200);
} else {
$tx.text("이 글을 추천하셨습니다.");
$tx.fadeIn(200).delay(2500).fadeOut(200);
}
}
}, "json"
);
}
</script>
<!-- } 게시글 읽기 끝 -->
!-->!-->
답변 2
다음 코드가 도움이 될지 모르겠습니다.
write.skin.php
<?php
$wr_4_sample = [
'ESG 및 지속가능성',
'특허(산업재산권)',
'R&D',
'ISO',
'인증',
'교육',
'기타',
];
$write['wr_4'] = explode(',', $write['wr_4']);
?>
<div class="write_content">
<?php
foreach ($wr_4_sample as $k => $v) {
$wr_4_chkd = '';
if (in_array($v, $write['wr_4']) == true) {
$wr_4_chkd = ' checked';
}
?>
<input type="checkbox" name="wr_4[]" id="wr_4_<?php echo $k; ?>"<?php echo $wr_4_chkd; ?> value="<?php echo $v; ?>"> <?php echo $v; ?>
<?php
}
?>
</div>
write_update.head.skin.php
<?php
$wr_4 = '';
if (isset($_POST['wr_4']) == true && is_array($_POST['wr_4']) == true) {
$wr_4 = implode(',', $_POST['wr_4']);
}
?>
view.skin.php
<li>
<span class="pro_call pro_title">제휴제안 내용</span>
<p><?php echo empty($view['wr_4']) == false ? $view['wr_4']:"-"; ?></p>
</li>
<input type="checkbox" name="wr_4" id="wr_4" r <?=($write['wr4[1]'])?"checked":"";?> value="ESG 및 지속가능성">ESG 및 지속가능성
<input type="checkbox" name="wr4[2]" id="wr4[2]" <?=($write['wr3[2]'])?"checked":"";?> value="특허(산업재산권)">특허(산업재산권)
<input type="checkbox" name="wr4[3]" id="wr4[3]" <?=($write['wr3[3]'])?"checked":"";?> value="R&D">R&D
<input type="checkbox" name="wr4[4]" id="wr4[4]" <?=($write['wr3[4]'])?"checked":"";?> value="ISO">ISO
<input type="checkbox" name="wr4[5]" id="wr4[5]" <?=($write['wr3[5]'])?"checked":"";?> value="인증">인증
<input type="checkbox" name="wr4[6]" id="wr4[6]" <?=($write['wr3[6]'])?"checked":"";?> value="교육"> 교육
<input type="checkbox" name="wr4[6]" id="wr4[6]" <?=($write['wr3[6]'])?"checked":"";?> value="기타">기타 </div>
여기 보면 wr4[2] 이렇게 되어있는데요
wr_4[2]
wr_4[3]
네임값을 위 형식으로 바꾸세요
덧. 캡챠 안나오네요
!-->
답변을 작성하시기 전에 로그인 해주세요.