그누보드 리스트 페이지에서 첨부파일 유무로 썸네일 출력 채택완료
쭈나요법
2년 전
조회 2,011
안녕하세요 그누보드 초보라 소스를 이것저것 넣어 봐도 적용이 안 돼서 문의드립니다 ㅠㅠ
제가 해당 스킨에서 첨부파일 필드를 2개 쓰고 있는데, 리스트 페이지에서 첨부파일 1번 유무로 썸네일 설정을 하고 싶습니다!
첨부파일 1번에 이미지가 들어 있을 때 --- 1번 파일 이미지 썸네일 출력
첨부파일 1번에 이미지가 없을 때 --- 지정한 no-img.jpg 썸네일 출력
이렇게 만들고 싶어서 소스를 이렇게저렇게 넣은 결과
잘 작동되... 는 줄 알았는데
첨부파일 1번에 이미지가 없고 2번에 있을 때 2번 썸네일이 출력되게 됩니다 ㅠㅠ
2번 필드의 유무에 관계없이 무조건 1번! 필드로만 썸네일을 출력할 수 있을까요?
고수분들 답변 부탁드립니다 ㅠㅠ
현재 해당 부분 코드는 이렇습니다
</p>
<p><?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);</p>
<p> if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" >';
} else {
$img_content = '<img src="../images/common/no-img.jpg">';
}</p>
<p> echo $img_content;
}
?> </p>
<p>
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
채택된 답변
+20 포인트
2년 전
</p>
<p><?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']&&<code>$list[$i]['file'][0]['file']</code>) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" >';
} else {
$img_content = '<img src="../images/common/no-img.jpg">';
}
echo $img_content;
}
?>
로그인 후 평가할 수 있습니다
답변에 대한 댓글 6개
�
쭈나요법
2년 전
�
들레아빠
2년 전
잘 되는데.. 아래처럼 수정해 보세요.
if($thumb['src']&&$list[$i]['file'][0]['file']) {
=>
if($list[$i]['file'][0]['file']) {
if($thumb['src']&&$list[$i]['file'][0]['file']) {
=>
if($list[$i]['file'][0]['file']) {
�
쭈나요법
2년 전
<?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="../images/common/no-img.jpg">';
}
echo $img_content;
}
?>
이렇게 넣었는데도 여전히 첫번째 필드에 사진이 있는 것도 no-img로 보이고 있습니다 ㅠㅠ
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="../images/common/no-img.jpg">';
}
echo $img_content;
}
?>
이렇게 넣었는데도 여전히 첫번째 필드에 사진이 있는 것도 no-img로 보이고 있습니다 ㅠㅠ
�
들레아빠
2년 전
다른 원인이 있는 것 같습니다.
부라우져를 닫았다가 다시 열어 보세요.
부라우져를 닫았다가 다시 열어 보세요.
�
쭈나요법
2년 전
감사합니다 해결되었습니다 ㅠㅠ
�
들레아빠
2년 전
채택 감사 합니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
코드 바꿔서 넣었더니 모든 이미지가 else에 있는 no-img.jpg로 변경됐어요