1:1문의 게시판에서 답변을 달때 파일첨부 기능

1:1문의 게시판에서 답변을 달때 파일첨부 기능

QA

1:1문의 게시판에서 답변을 달때 파일첨부 기능

답변 1

본문

1:1문의 게시판에서 답변을 달때도 파일첨부를 할수있는 기능이 있나요?

 

믈론 출력이 될때도 파일첨부가 출력이 되야합니다.

 

방법좀 알려주세요..

이 질문에 댓글 쓰기 :

답변 1

qna skin 디렉토리 가셔서

view.answerform.skin.php 파일을 열어서

<form name="fanswer" method="post" action="./qawrite_update.php" onsubmit="return fwrite_submit(this);" autocomplete="off" enctype="multipart/form-data">

추가합니다.

 

그리고 write.skin.php 파일에 있는 첨부 모양을 그대로 복사해 옵니다. 아래 참고

<li class="bo_w_flie">
    <div class="file_wr">
        <label for="bf_file_1" class="lb_icon"><i class="fa fa-download" aria-hidden="true"></i><span class="sound_only"> 파일 #1</span></label>
        <input type="file" name="bf_file[1]" id="bf_file_1" title="파일첨부 1 :  용량 <?php echo $upload_max_filesize; ?> 이하만 업로드 가능" class="frm_file">
        <?php if($w == 'u' && $write['qa_file1']) { ?>
        <input type="checkbox" id="bf_file_del1" name="bf_file_del[1]" value="1"> <label for="bf_file_del1"><?php echo $write['qa_source1']; ?> 파일 삭제</label>
        <?php } ?>
    </div>
</li>

<li class="bo_w_flie">
    <div class="file_wr">
        <label for="bf_file_2" class="lb_icon"><i class="fa fa-download" aria-hidden="true"></i><span class="sound_only"> 파일 #2</span></label>
        <input type="file" name="bf_file[2]" id="bf_file_2" title="파일첨부 2 :  용량 <?php echo $upload_max_filesize; ?> 이하만 업로드 가능" class="frm_file">
        <?php if($w == 'u' && $write['qa_file2']) { ?>
        <input type="checkbox" id="bf_file_del2" name="bf_file_del[2]" value="1"> <label for="bf_file_del2"><?php echo $write['qa_source2']; ?> 파일 삭제</label>
        <?php } ?>
    </div>
</li>

 

view.answerform.skin.php 파일에 넣어 줍니다.

반드시 <form ~~~> </form> 사이에 넣으셔야 합니다.

 

 

view.answer.skin.php 파일을 열어서

<a href="/bbs/qadownload.php?qa_id=<?php echo $answer['qa_id']; ?>&no=1"><?echo $answer['qa_file1']; ?></a>

이것을 적당한 위치에 넣어 줍니다.

 

이대로 해서 클릭을 하게 되면 잘못된 접근 어쩌고 뜹니다.

/bbs/qadownload.php 파일을 엽니다.

if (!get_session('ss_qa_view_'.$qa_id))
    alert('잘못된 접근입니다.');

이 부분을 과감하게 주석으로 막아 버립니다.

외부에서 링크를 못 걸게 하기 위함인데 문의글을 읽었을 때 부모글만 ss_qa_view_숫자 형식으로 세션을 생성하기에 답변글까지 생성해 주기엔 너무 귀찮...

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 10
© SIRSOFT
현재 페이지 제일 처음으로