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

최신글 이미지 없을때 출력 안하려면 채택완료

존재하는 11년 전 조회 5,979
최신글에 첨부된 이미지가 없을때에는 출력 안되게 하려면
 
어떻게 수정하면 되나요??
 
 
 
</div>
<div>         <div class="gall_img">             
             <a class="img_a" href="<?php echo $list[$i]['href'] ?>">                 
     <?php                
                        $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $imgwidth, $imgheight);                     
                        if($thumb['src']) {
                            $img_content = '<img class="img_left" src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$imgwidth.'" height="'.$imgheight.'">';
                        } else {
                            $img_content = '<div class="no_img" style="width:'.$imgwidth.'px;height:'.$imgheight.'px">no image</div>';
                        }                
                        echo $img_content;                           
                     ?> 
                </a>                
            </div>
            <div class="gall_text">
            <?php
            //echo $list[$i]['icon_reply']." ";
            echo "<a href=\"".$list[$i]['href']."\">";
            if ($list[$i]['is_notice'])
                echo "<strong>".$list[$i]['subject']."</strong>";
            else
                echo $list[$i]['subject'];</div>
<div>            if ($list[$i]['comment_cnt'])
                echo $list[$i]['comment_cnt'];</div>
<div>            echo "</a>";</div>
<div>            // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
            // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }</div>
<div>            if (isset($list[$i]['icon_new'])) echo " " . $list[$i]['icon_new'];
            if (isset($list[$i]['icon_hot'])) echo " " . $list[$i]['icon_hot'];
           
            if (isset($list[$i]['icon_link'])) echo " " . $list[$i]['icon_link'];
            if (isset($list[$i]['icon_secret'])) echo " " . $list[$i]['icon_secret'];
             ?>
             </div></div>
<div> </div>
<div> 
댓글을 작성하려면 로그인이 필요합니다.

답변 2개

채택된 답변
+20 포인트
11년 전
그러면 질문이 잘못 됬네요 저 부분이 아닌 for문 부분을 보여주셔야되요 
로그인 후 평가할 수 있습니다

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

11년 전
04 $thumb = get_list_thumbnail($bo_table$list[$i]['wr_id'], $imgwidth$imgheight);
05 if($thumb['src']) {
06 $img_content '.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$imgwidth.'" height="'.$imgheight.'">';
07 else {
08 $img_content '
.$imgwidth.'px;height:'.$imgheight.'px">no image
'; //이부분을 
$img_content =''; 하면 안나오게 되겠죠?
09 }
10 echo $img_content;
로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

존재하는
11년 전
그부분만 수정하면.. 이미지 파일은 사라지는데.. 제목이 남아있어요??

이미지가 없으면 제목과 함께 나오지 않게 하려구요,.

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

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

로그인