no 이미지 적용

no 이미지 적용

QA

no 이미지 적용

답변 1

본문

                    <?php

                    if (!$list[$i]['is_notice']) {

                        $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);

 

                        if($thumb['src']) {

                            $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'" class="list_img"  

 

onerror="this.src='/img/list_s.jpg'">';

 

이거 이렇게 추가 했는데 오류가 나는데. 경로 문제인가용?

                     

이 질문에 댓글 쓰기 :

답변 1

if($thumb['src']) { 

윗 줄 삭제하고 이렇게.. 

$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'" class="list_img" onerror=\'this.src="/img/list_s.jpg"\'>'; 

위에서 if($thumb['src']) { 여기를 삭제했으면 밑에 닫는 부분 } 이 있을 텐데 거기도 삭제 

 

전체를 보면 대략 이렇게..

<?php

if (!$list[$i]['is_notice']) {

    $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);

    $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'" class="list_img" onerror=\'this.src="/img/list_s.jpg"\'>';

    echo $img_content;

}

?>

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