여분필드 체크 옵션기능이 안되요 ㅠㅠ
본문
제가 여분필드를 이용해서 게시판가지고 삽질하고 있습니다 ㅠㅠ 다른 여분필드들은 다 잘되는데
제가 실력이 없어서 체크가 되는 옵션을 넣으려고 하니 체크가 안되네요 제가 여분필드 사용법을 잘몰라서 그누스터디 홈페이지 보고 따라서 했는데 입력하는 필드는 되는데 체크하는 필드가 안됩니다.
그누스터디 홈페이지 주소는 https://gnustudy.com/bbs/board.php?bo_table=skin_board&wr_id=151
제가 저 홈페이지 보고 한 소스인데
저는 여분필드가 많이 필요해서 10개더 추가 했습니다.
제가 맞게 했는지 소스좀 봐주세요
write.skin.php
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
?>
<section id="bo_w">
<h2 class="sound_only"><?php echo $g5['title'] ?></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_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;
?>
<?php if ($is_category) { ?>
<div class="bo_w_select write_div">
<label for="ca_name" class="sound_only">분류<strong>필수</strong></label>
<select name="ca_name" id="ca_name" required>
<option value="">분류를 선택하세요</option>
<?php echo $category_option ?>
</select>
</div>
<?php } ?>
<div class="bo_w_info write_div">
<?php if ($is_name) { ?>
<label for="wr_name" class="sound_only">이름<strong>필수</strong></label>
<input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input required" placeholder="이름">
<?php } ?>
<?php if ($is_password) { ?>
<label for="wr_password" class="sound_only">비밀번호<strong>필수</strong></label>
<input type="password" name="wr_password" id="wr_password" <?php echo $password_required ?> class="frm_input <?php echo $password_required ?>" placeholder="비밀번호">
<?php } ?>
<?php if ($is_email) { ?>
<label for="wr_email" class="sound_only">이메일</label>
<input type="text" name="wr_email" value="<?php echo $email ?>" id="wr_email" class="frm_input email " placeholder="이메일">
<?php } ?>
</div>
<?php if ($is_homepage) { ?>
<div class="write_div">
<label for="wr_homepage" class="sound_only">홈페이지</label>
<input type="text" name="wr_homepage" value="<?php echo $homepage ?>" id="wr_homepage" class="frm_input full_input" size="50" placeholder="홈페이지">
</div>
<?php } ?>
<tr>
<th scope="row"><label for="wr_1">접수번호</label></th>
<td><input type="text" name="wr_1" value="<?php echo $write['wr_1'] ?>" id="wr_1" required class="frm_input" size="20"></td>
</tr>
<tr>
<th scope="row"><label for="wr_2">상담일</label></th>
<td><input type="text" name="wr_2" value="<?php echo $write['wr_2'] ?>" id="wr_2" required class="frm_input" size="20"></td>
</tr>
<tr>
<th scope="row"><label for="wr_3">회차</label></th>
<td><input type="text" name="wr_3" value="<?php echo $write['wr_3'] ?>" id="wr_3" required class="frm_input" size="20"></td>
</tr>
<tr>
<th scope="row"><label for="wr_4">내담자</label></th>
<td><input type="text" name="wr_4" value="<?php echo $write['wr_4'] ?>" id="wr_4" required class="frm_input" size="20"></td>
</tr>
<th scope="row"><label for="wr_5">상담시간</label></th>
<td><input type="text" name="wr_5" value="<?php echo $write['wr_5'] ?>" id="wr_5" class="frm_input" size="20"></td>
<p>
<?php $option1 = explode($write['wr_7']); ?>
옵션1 :
<input type="checkbox" name="option1[0]" value="사과"<?php echo ($option1[0] == "사과") ? " checked" : "";?>> 사과
<input type="checkbox" name="option1[1]" value="수박"<?php echo ($option1[1] == "수박") ? " checked" : "";?>> 수박
<input type="checkbox" name="option1[2]" value="딸기"<?php echo ($option1[2] == "딸기") ? " checked" : "";?>> 딸기
<input type="checkbox" name="option1[3]" value="포도"<?php echo ($option1[3] == "포도") ? " checked" : "";?>> 포도
<input type="checkbox" name="option1[4]" value="참외"<?php echo ($option1[4] == "참외") ? " checked" : "";?>>
참외 <br />
<?php if ($option) { ?>
</p>
<div class="write_div">
<span class="sound_only">옵션</span>
<?php echo $option ?>
</div>
<?php } ?>
<div class="bo_w_tit write_div">
<label for="wr_subject" class="sound_only">제목<strong>필수</strong></label>
<div id="autosave_wrapper write_div">
<input type="text" name="wr_subject" value="<?php echo $subject ?>" id="wr_subject" required class="frm_input full_input required" 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_div">
<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 for ($i=1; $is_link && $i<=G5_LINK_COUNT; $i++) { ?>
<div class="bo_w_link write_div">
<label for="wr_link<?php echo $i ?>"><i class="fa fa-link" aria-hidden="true"></i><span class="sound_only"> 링크 #<?php echo $i ?></span></label>
<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="frm_input full_input" size="50">
</div>
<?php } ?>
<?php for ($i=0; $is_file && $i<$file_count; $i++) { ?>
<div class="bo_w_flie write_div">
<div class="file_wr write_div">
<label for="bf_file_<?php echo $i+1 ?>" class="lb_icon"><i class="fa fa-download" aria-hidden="true"></i><span class="sound_only"> 파일 #<?php echo $i+1 ?></span></label>
<input type="file" name="bf_file[]" id="bf_file_<?php echo $i+1 ?>" title="파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file ">
</div>
<?php if ($is_file_content) { ?>
<input type="text" name="bf_content[]" value="<?php echo ($w == 'u') ? $file[$i]['bf_content'] : ''; ?>" title="파일 설명을 입력해주세요." class="full_input frm_input" size="50" placeholder="파일 설명을 입력해주세요.">
<?php } ?>
<?php if($w == 'u' && $file[$i]['file']) { ?>
<span class="file_del">
<input type="checkbox" id="bf_file_del<?php echo $i ?>" name="bf_file_del[<?php echo $i; ?>]" value="1"> <label for="bf_file_del<?php echo $i ?>"><?php echo $file[$i]['source'].'('.$file[$i]['size'].')'; ?> 파일 삭제</label>
</span>
<?php } ?>
</div>
<?php } ?>
<?php if ($is_use_captcha) { //자동등록방지 ?>
<div class="write_div">
<?php echo $captcha_html ?>
</div>
<?php } ?>
<div class="btn_confirm write_div">
<a href="./board.php?bo_table=<?php echo $bo_table ?>" class="btn_cancel btn">취소</a>
<input type="submit" value="작성완료" id="btn_submit" accesskey="s" class="btn_submit btn">
</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;
}
}
}
<?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');
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
?>
<script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script>
<!-- 게시물 읽기 시작 { -->
<article id="bo_v" style="width:<?php echo $width; ?> font-weight: bold font-weight: bold font-weight: bold font-weight: bold font-weight: bold font-weight: bold">
<header>
<h2 id="bo_v_title">
<?php if ($category_name) { ?>
<span class="bo_v_cate"><?php echo $view['ca_name']; // 분류 출력 끝 ?></span>
<?php } ?>
</h2>
</header>
<!-- 새창으로 인쇄 -->
<script type="text/javascript">
var win=null;
function printIt(printThis) {
win = window.open('','offprint','width=900 height=1000');
self.focus();
win.document.open();
win.document.write('<'+'html'+'><'+'head'+'><'+'style'+'>');
win.document.write('body, td { font-family: Verdana; font-size: 10pt;}');
win.document.write('<'+'/'+'style'+'><'+'/'+'head'+'><'+'body'+'>');
win.document.write(printThis);
win.document.write('<'+'/'+'body'+'><'+'/'+'html'+'>');
win.document.close();
win.print();
win.close();
}
</script>
<div style="float:right">
<a href="javascript:printIt(document.getElementById('printme').innerHTML)"><span class="btn_print" title='출력하기'>출력하기<i class='fa fa-print'></i></span></a><p>
</div>
<!-- 본문 내용 시작 { -->
<section id="bo_v_atc">
<h2 id="bo_v_atc_title">본문</h2>
<div id="printme"><!-- 본문 내용 시작 { -->
<div id="bo_v_con">
<table width="748" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="38" align="center"><div class="aa"><img src=<?php echo G5_IMG_URL ?>/aa.gif width="253" height="34" /></div></td>
</tr>
<tr>
<td height="3" align="center"><img src="<?php echo G5_IMG_URL ?>/aa2.gif" width="100" height="3" /></td>
</tr>
<tr>
<!-- 동료상담 기록지 옵션기능 시작(1) -->
<td><table width="826" border="1" cellspacing="0" cellpadding="0">
<tr>
<td height="30" align="center">접수번호</td>
<td height="30"> <?php echo $view['wr_1'] ?></td>
<td height="30" align="center">상 담 일</td>
<td width="180" height="30"> <?php echo $view['wr_2'] ?></td>
<td width="35" align="center">회차</td>
<td width="94"> <?php echo $view['wr_3'] ?></td>
</tr>
<tr>
<td height="30" align="center">내담자</td>
<td width="384" height="30"><table width="384" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="149"> <?php echo $view['wr_4'] ?></td>
<td width="36">성별:</td>
<td width="199"> </td>
</tr>
</table></td>
<td width="57" height="30" align="center">상담시간</td>
<td height="30" colspan="3"> <?php echo $view['wr_5'] ?></td>
</tr>
<tr>
<td height="30" align="center">연락처☎</td>
<td width="384" height="30"> </td>
<td width="57" height="30" align="center">상담장소</td>
<td height="30" colspan="3"> </td>
</tr>
<tr>
<td height="30" align="center">장애정도</td>
<td width="384" height="30"> </td>
<td width="57" height="30" align="center">보장구/<br />
고려사항</td>
<td height="30" colspan="3"> </td>
</tr>
<tr>
<td height="30" align="center">상담방법</td>
<td height="30" colspan="5"><table width="741" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- 옵션 체크 기능들 추가 -->
<td width="598" height="13">
<?php $option1 = explode($view['wr_7']); ?>
<input type="checkbox" name="option1[0]" value="사과"<?php echo ($option1[0] == "사과") ? " checked" : "";?>> 사과
<input type="checkbox" name="option1[1]" value="수박"<?php echo ($option1[1] == "수박") ? " checked" : "";?>> 수박
<input type="checkbox" name="option1[2]" value="딸기"<?php echo ($option1[2] == "딸기") ? " checked" : "";?>> 딸기
<input type="checkbox" name="option1[3]" value="포도"<?php echo ($option1[3] == "포도") ? " checked" : "";?>> 포도
<input type="checkbox" name="option1[4]" value="참외"<?php echo ($option1[4] == "참외") ? " checked" : "";?>> 참외
</td>
<td width="10">(</td>
<td width="121"> </td>
<td width="12">)</td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" align="center">상담유형</td>
<td height="30" colspan="5"><table width="561" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="369" height="13"> </td>
<td width="10">(</td>
<td width="179"> </td>
<td width="10">)</td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" align="center">상담목적</td>
<td height="30" colspan="5"> <?php
echo cut_str(get_text($view['wr_subject']), 70); // 글제목 출력
?></td>
</tr>
<tr>
<td width="62" align="center">상담<br />
내용/<br />
생활패턴</td>
<td colspan="5"><table width="748" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="116" height="30" align="center">관련자/소속</td>
<td width="240"> </td>
<td width="116" align="center">연락처</td>
<td width="264"> </td>
</tr>
<tr>
<td height="30" colspan="4" valign="top"> ※ 전 회차 상담내용을 간략하게 작성</td>
</tr>
<tr>
<td colspan="4"><table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="760"> ※ 지난 상담 이후 변화에 관한 탐색과 변화노력을 인정, 지지, 격려</td>
<!-- 동료상담 기록지 옵션기능 끝(1) -->
</tr>
<tr>
<!-- 동료상담 기록지 내용 출력 시작 -->
<td height="151" valign="top"> <?php echo get_view_thumbnail($view['content']); ?></td>
<!-- 동료상담 기록지 내용 출력 끝 -->
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<!-- 동료상담 기록지 옵션기능 시작(2) -->
<td height="46" align="center">상담가<br />
의견</td>
<td height="46" colspan="5"> </td>
</tr>
<tr>
<td height="37" align="center">지원내용</td>
<td height="37" colspan="5"><table width="561" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="369" height="13"> </td>
<td width="10">(</td>
<td width="179"> </td>
<td width="10">)</td>
</tr>
</table></td>
</tr>
<tr>
<td height="39" align="center">진행형태</td>
<td height="39" colspan="5"><table width="561" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="369" height="13"> </td>
<td width="10">(</td>
<td width="179"> </td>
<td width="10">)</td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" align="center">상담가</td>
<td height="30"><table width="389" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="359" height="13"> </td>
<td width="10">(</td>
<td width="13" align="center">인</td>
<td width="12">)</td>
</tr>
</table></td>
<td height="30" align="center">수퍼<br />
바이저</td>
<td height="30" colspan="3"><table width="312" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="282" height="13"> </td>
<td width="10">(</td>
<td width="13" align="center">인</td>
<td width="12">)</td>
<!-- 동료상담 기록지 옵션기능 끝(2) -->
</tr>
</table></td>
</tr>
<tr></tr>
</table></td>
</tr>
<tr></tr>
<tr></tr>
<tr>
<td align="center"><img src="<?php echo G5_IMG_URL ?>/aa3.gif" width="595" height="54" /></td>
</tr>
</table>
</div>
<!-- } 본문 내용 끝 -->
</div><p> </p>
<!-- 추천 비추천 시작 { -->
<?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"><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"><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"><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"><span class="sound_only">비추천</span><strong><?php echo number_format($view['wr_nogood']) ?></strong></span><?php } ?>
</div>
<?php
}
}
?>
<!-- } 추천 비추천 끝 -->
</section>
<div id="bo_v_share">
<?php if ($scrap_href) { ?><a href="<?php echo $scrap_href; ?>" target="_blank" class="btn btn_b03" onclick="win_scrap(this.href); return false;"><i class="fa fa-thumb-tack" aria-hidden="true"></i> 스크랩</a><?php } ?>
<?php
include_once(G5_SNS_PATH."/view.sns.skin.php");
?>
</div>
<?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-download" aria-hidden="true"></i>
<a href="<?php echo $view['file'][$i]['href']; ?>" class="view_file_download">
<strong><?php echo $view['file'][$i]['source'] ?></strong>
</a>
<?php echo $view['file'][$i]['content'] ?> (<?php echo $view['file'][$i]['size'] ?>)
<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'][1]) && $view['link'][1]) { ?>
<!-- 관련링크 시작 { -->
<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>
<span class="bo_v_link_cnt"><?php echo $view['link_hit'][$i] ?>회 연결</span>
</li>
<?php
}
}
?>
</ul>
</section>
<!-- } 관련링크 끝 -->
<?php } ?>
<!-- 게시물 상단 버튼 시작 { -->
<div id="bo_v_top">
<?php
ob_start();
?>
<ul class="bo_v_left">
<?php if ($update_href) { ?><li><a href="<?php echo $update_href ?>" class="btn_b01 btn"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> 수정</a></li><?php } ?>
<?php if ($delete_href) { ?><li><a href="<?php echo $delete_href ?>" class="btn_b01 btn" onclick="del(this.href); return false;"><i class="fa fa-trash-o" aria-hidden="true"></i> 삭제</a></li><?php } ?>
<?php if ($copy_href) { ?><li><a href="<?php echo $copy_href ?>" class="btn_admin btn" 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 ?>" class="btn_admin btn" 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 ?>" class="btn_b01 btn"><i class="fa fa-search" aria-hidden="true"></i> 검색</a></li><?php } ?>
</ul>
<ul class="bo_v_com">
<li><a href="<?php echo $list_href ?>" class="btn_b01 btn"><i class="fa fa-list" aria-hidden="true"></i> 목록</a></li&
답변 1
긴 글을 작성하셨네요.
작성하신 소스중
<?php $option1 = explode($write['wr_7']); ?>
잘못된 방식입니다. PHP의 explode 함수 사용법을 참고해세요.
<?php $option1 = explode(",", $write['wr_7']); ?>
이렇게 무엇으로 구분할 것인지가 들어가야합니다.
참고하셨던
https://gnustudy.com/bbs/board.php?bo_table=skin_board&wr_id=151 를 자세히 읽어보시길 바랍니다.
그리고 중요한 부분이 DB에 작성하는 부분인데
이 부분은 참고하셨던 웹페이지의
write_update.skin.php
쉼표를 포함해서 하나로 합친 후 해당 필드에 다시 넣는 내용입니다.
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$wr_1 = "$option1[0],$option1[1],$option1[2],$option1[3],$option1[4]"; // 옵션1
$wr_2 = "$option2[0],$option2[1],$option2[2]"; // 옵션2
sql_query(" update $write_table set wr_1 = '$wr_1', wr_2 = '$wr_2' where wr_id = '$wr_id' ");
?>
DB에 작성해서 들어가는 부분이기 때문에 아주 중요합니다.
아무쪼록 잘 해결되시고 원하시는 기능을 잘 구현하시길 바랍니다.
!-->