테스트 사이트 - 개발 중인 베타 버전입니다

1:1 문의게시판 리스트에서 첨부파일 갯수를 표시하고 싶습니다. 채택완료

9년 전 조회 4,295

안녕하세요.

 

1:1 문의게시판의 게시물에 첨부된 첨부파일 총 개수를 리스트 제목옆에 출력하려고 하는데 잘 안되네요

 

</span></p><p><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(245, 248, 249);"><? </span><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(245, 248, 249);">if ($list[$i]['file']['count']) echo "파일갯수 : {$list[$i]['file']['count']} "; </span><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(245, 248, 249);">?></span> </p><p style="font-size: 14.6667px;"><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(245, 248, 249);"><? </span><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(245, 248, 249);">echo $list[$i]['file']['count']; </span><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(245, 248, 249);">?></span> </p><div><p style="font-size: 14.6667px;"><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(245, 248, 249);"><? </span><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(245, 248, 249);">echo $list[$i]['bf_file']['count']; </span><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(245, 248, 249);">?></span> </p></div><div><p style="font-size: 14.6667px;"><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(245, 248, 249);"><? </span><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(245, 248, 249);">echo $list[$i]['qa_file']['count']; </span><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(245, 248, 249);">?></span> </p></div><div><p><span style="font-size: 12px; color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; background-color: rgb(245, 248, 249);"><? </span><span style="background-color: rgb(245, 248, 249);"><font color="#333333" face="돋움, Dotum, sans-serif"><span style="font-size: 12px;">echo $list[$i]['qa_source']['count']; </span></font></span><span style="font-size: 12px; color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; background-color: rgb(245, 248, 249);">?></span></p></div><p><span style="color: rgb(51, 51, 51); font-family: 돋움, Dotum, sans-serif; font-size: 12px; background-color: rgb(245, 248, 249);">

 

다 해봤는데 안되네요... 도움 부탁드립니다.

감사합니다.

아래는 관련된 코드들입니다.

list.skin.php에서 제목출력 부분

</span></font></p><p style="margin-left: 0px;"><font color="#333333" face="돋움, Dotum, sans-serif"><span style="font-size: 12px;"><td class="td_subject" style="width:400px; padding-left:30px;"></span></font></p><p style="margin-left: 40px;"><font color="#333333" face="돋움, Dotum, sans-serif"><span style="font-size: 12px;"><a href="<?php echo $list[$i]['view_href']; ?>"></span></font></p><p style="margin-left: 80px;"><font color="#333333" face="돋움, Dotum, sans-serif"><span style="font-size: 12px;"><?php echo $list[$i]['subject']; ?></span></font></p><p style="margin-left: 40px;"><font color="#333333" face="돋움, Dotum, sans-serif"><span style="font-size: 12px;"></a></span></font></p><p style="margin-left: 40px;"><font color="#333333" face="돋움, Dotum, sans-serif"><span style="font-size: 12px;"><?php echo $list[$i]['icon_file']; ?></span></font></p><p><font color="#333333" face="돋움, Dotum, sans-serif"><span style="background-color: rgb(245, 248, 249); font-size: 12px;"></span></font></p><p style="margin-left: 0px;"><font color="#333333" face="돋움, Dotum, sans-serif"><span style="font-size: 12px;"></td></span></font></p><p style="margin-left: 0px;"><font color="#333333" face="돋움, Dotum, sans-serif"><span style="font-size: 12px;">

write.skin.php에서 파일첨부 부분

</span></font></p><p><font color="#333333" face="돋움, Dotum, sans-serif"><span style="font-size: 12px;"><input type="file" name="bf_file[1]" title="파일첨부 1 :  용량 <?php echo $upload_max_filesize; ?> 이하만 업로드 가능" class="qa_file_upload"></span></font></p><p><font color="#333333" face="돋움, Dotum, sans-serif"><span style="font-size: 12px;"><?php if($w == 'u' && $write['qa_file1']) { ?></span></font></p><p><font color="#333333" face="돋움, Dotum, sans-serif"><span style="font-size: 12px;"><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></span></font></p><p><font color="#333333" face="돋움, Dotum, sans-serif"><span style="font-size: 12px;"><?php } ?></span></font></p><p style="font-size: 14.6667px;"><font color="#333333" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; background-color: rgb(245, 248, 249);">

 

qawrite_update.php에서 파일개수 체크하는 부분

</span></font></p><p>// 파일개수 체크</p><p>$file_count   = 0;</p><p>$upload_count = count($_FILES['bf_file']['name']);</p><p> </p><p>for ($i=1; $i<=$upload_count; $i++) {</p><p>    if($_FILES['bf_file']['name'][$i] && is_uploaded_file($_FILES['bf_file']['tmp_name'][$i]))</p><p>        $file_count++;</p><p>}</p><p> </p><p>if($file_count > 2)</p><p>    alert('첨부파일을 2개 이하로 업로드 해주십시오.');</p><div><p style="font-size: 14.6667px;"><font color="#333333" face="돋움, Dotum, sans-serif"><span style="font-size: 12px; background-color: rgb(245, 248, 249);">

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트

정상적이라면 

 

리스트에서 

$list[$i]['file']['count'] 

 

이렇게 사용하시는게 맞을거같습니다.

 

이렇게해서 출력되지 않는다면

 

print_r2($list[$i]); 해서 확인해보세요

 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

잘 안되네요ㅠ
다른 방법으로 시도해봐야겠습니다

답변 감사합니다~!

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인

전체 질문 목록

🐛 버그신고