1:1문의 답변 파일첨부 기능 추가

This commit is contained in:
thisgun
2023-01-03 14:53:08 +09:00
parent c3272f9170
commit abfeee5e92
13 changed files with 252 additions and 24 deletions

View File

@ -149,9 +149,9 @@
#bo_w .bo_w_select select {border:1px solid #d0d3db;background:#fff;width:100%}
#bo_w .bo_w_link label {position:absolute;top:1px;left:1px;border-radius:3px 0 0 3px;width:45px;height:43px;line-height:43px;font-size:1.2em;text-align:center;color:#b2b2b2}
#bo_w .bo_w_link .frm_input {padding-left:50px}
#bo_w .bo_w_flie .lb_icon {position:absolute;top:0px;left:0px;border-radius:3px 0 0 3px;width:45px;height:43px;line-height:43px;font-size:1.2em;text-align:center;color:#b2b2b2}
#bo_w .bo_w_flie .frm_file {padding-left:50px}
#bo_w .bo_w_flie .file_wr {position:relative;color:#000;vertical-align:middle;margin:0}
#bo_w .bo_w_flie .lb_icon, .form_01 .bo_w_flie .lb_icon {position:absolute;top:0px;left:0px;border-radius:3px 0 0 3px;width:45px;height:43px;line-height:43px;font-size:1.2em;text-align:center;color:#b2b2b2}
#bo_w .bo_w_flie .frm_file, .form_01 .bo_w_flie .frm_file {padding-left:50px}
#bo_w .bo_w_flie .file_wr, .form_01 .bo_w_flie .file_wr {position:relative;color:#000;vertical-align:middle;margin:0}
#bo_w .bo_w_flie .frm_input {margin:5px 0 0}
.filebox .btn_file {display:inline-block;position:absolute;right:8px;top:8px;border:1px solid #3a8afd;border-radius:3px;width:60px;height:30px;color:#3a8afd;font-size:1em;line-height:30px;font-weight:bold;background:#fff;text-align:center;vertical-align:middle;cursor:pointer}

View File

@ -11,7 +11,43 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
</div>
</h2>
<div id="ans_con">
<?php
// 파일 출력
if(isset($answer['img_count']) && $answer['img_count']) {
echo "<div id=\"bo_v_img\">\n";
for ($i=0; $i<$answer['img_count']; $i++) {
echo get_view_thumbnail($answer['img_file'][$i], $qaconfig['qa_image_width']);
}
echo "</div>\n";
}
?>
<?php echo get_view_thumbnail(conv_content($answer['qa_content'], $answer['qa_html']), $qaconfig['qa_image_width']); ?>
<?php if(isset($answer['download_count']) && $answer['download_count']) { ?>
<!-- 첨부파일 시작 { -->
<section id="bo_v_file">
<h2>첨부파일</h2>
<ul>
<?php
// 가변 파일
for ($i=0; $i<$answer['download_count']; $i++) {
?>
<li>
<i class="fa fa-download" aria-hidden="true"></i>
<a href="<?php echo $answer['download_href'][$i]; ?>" class="view_file_download" download>
<strong><?php echo $answer['download_source'][$i] ?></strong>
</a>
</li>
<?php
}
?>
</ul>
</section>
<!-- } 첨부파일 끝 -->
<?php } ?>
</div>
<button id="btn_ans_btn" class="btn_b03 btn"><i class="fa fa-ellipsis-v" aria-hidden="true"></i><span class="sound_only">게시판 리스트 옵션</span></button>

View File

@ -9,7 +9,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<h2>답변등록</h2>
<form name="fanswer" method="post" action="./qawrite_update.php" onsubmit="return fwrite_submit(this);" autocomplete="off">
<form name="fanswer" method="post" action="./qawrite_update.php" onsubmit="return fwrite_submit(this);" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="qa_id" value="<?php echo $view['qa_id']; ?>">
<input type="hidden" name="w" value="a">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
@ -46,6 +46,21 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<label for="qa_content" class="sound_only">내용<strong>필수</strong></label>
<?php echo $editor_html; // 에디터 사용시는 에디터로, 아니면 textarea 로 노출 ?>
</li>
<li class="bo_w_flie">
<div class="file_wr filebox">
<input type="text" class="fileName" readonly="readonly" placeholder="파일을 첨부하세요">
<label for="bf_file[1]"><i class="fa fa-download lb_icon" aria-hidden="true"></i><span class="sound_only">파일 #1</span><span class="btn_file">파일첨부</span></label>
<input type="file" name="bf_file[1]" id="bf_file[1]" title="파일첨부 1 : 용량 <?php echo $upload_max_filesize; ?> 이하만 업로드 가능" class="frm_file uploadBtn">
</div>
<br>
<div class="file_wr filebox">
<input type="text" class="fileName" readonly="readonly" placeholder="파일을 첨부하세요">
<label for="bf_file[2]"><i class="fa fa-download lb_icon" aria-hidden="true"></i><span class="sound_only">파일 #2</span><span class="btn_file">파일첨부</span></label>
<input type="file" name="bf_file[2]" id="bf_file[2]" title="파일첨부 2 : 용량 <?php echo $upload_max_filesize; ?> 이하만 업로드 가능" class="frm_file uploadBtn">
</div>
</li>
</ul>
</div>