첨부파일 1번이 없을 때 썸네일 이미지 출력 오류

첨부파일 1번이 없을 때 썸네일 이미지 출력 오류

QA

첨부파일 1번이 없을 때 썸네일 이미지 출력 오류

본문

view에선 첨부파일이 2부터 보이도록 설정하였고

list에선 첨부파일 1이 없을 시 no-img로 대체되도록 하였습니다.

 

분명 첨부파일1을 첨부하였는데도 모든 썸네일 이미지가 no-img로 나오는데

view가 문제인지 list가 문제인지 제대로 돌아가지않는 문제점을 모르겠습니다...

 

고수분들 어느 부분이 문제점인지 알려주세요 ㅜㅜ

 

갤러리 게시판 view.skin.php 코드


        <?php
        // 파일 출력
        $v_img_count = count($view['file']);
        if($v_img_count) {
            echo "<div id=\"bo_v_img\">\n";
 
            for ($i=1; $i<=count($view['file']); $i++) {
                if ($view['file'][$i]['view']) {
                    //echo $view['file'][$i]['view'];
                    echo get_view_thumbnail($view['file'][$i]['view']);
                }
            }
 
            echo "</div>\n";
        }
         ?>

 

갤러리 게시판 list.skin.php 코드


                                <?php
                        if ($list[$i]['is_notice']) { // 공지사항  ?>
                                <span class="is_notice" style="<?php echo $line_height_style; ?>">공지</span>
                                <?php } else {
                            $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], false, true);
 
                            if($list[$i]['file'][0]['file']) {
                                $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" >';
                            } else {
                                $img_content = '<img src="/img/no-img.jpg">';
                            }
 
                            echo run_replace('thumb_image_tag', $img_content, $thumb);
                        }
                         ?>

이 질문에 댓글 쓰기 :

답변 4

list는 view 처럼 첨부파일 가져오는 변수가 기본으로 설정 안되있을겁니다.


                                <?php
                        if ($list[$i]['is_notice']) { // 공지사항  ?>
                                <span class="is_notice" style="<?php echo $line_height_style; ?>">공지</span>
                                <?php } else {
             $list_file = get_file($bo_table, $list[$i]['wr_id']);
                            $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], false, true);
 
                              if($list_file[0][file]) {
                                $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" >';
                            } else {
                                $img_content = '<img src="/img/no-img.jpg">';
                            }
 
                            echo run_replace('thumb_image_tag', $img_content, $thumb);
                        }
                         ?>
 

이렇게 해보세요

 

$list_file = get_file($bo_table, $list[$i]['wr_id']);

   if($list_file[0][file]) {

추가입니다.

 

 

게시판 설정에서 파일을 가지고 오게 하셨나요? 가지고 오게하셨으면 해당 변수에 제대로 값이 들어가 있나 체크를 해보셔야 할거 같습니다.


<?php
                        if ($list[$i]['is_notice']) { // 공지사항  ?>
                            <span class="is_notice" style="<?php echo $line_height_style; ?>">공지</span>
                       <?php } else {
                            $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], false, true);
                            if($thumb['src']&&$list[$i]['file'][0]['file']) {
                                $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" >';
                            } else {
                                $img_content = '<img src="../images/common/no-img.jpg">';
                            }
                            echo $img_content;
                        }
                         ?> 

목록에서 이미지가 안나오는 것은

관리자페이지 -->게시판관리--> 목록에서 화일사용에 체크하세요

 

답변을 작성하시기 전에 로그인 해주세요.
전체 52
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT