채택완료

list 갤러리에서 lightbox 적용 image 불러오기 문제

2017-06-05 (월) 16:44:17 3,910

말 그대로 list_skin.php 에서 write.skin에서 편집해 올린 image를 lightbox에서 창띄어 자기 자신  

image출력할려고 하는데 image를 못 찾네요  

<?=$list[$i]['href']?> 이부분이 문제 인것 같은데 뭘 써야 image를 불러오는지 모르겠네요  

고수님들 조언 부탁 드립니다.

아래 코드 상태임  

<ul class="list-unstyled thumbnail" style="padding:10px; margin-bottom:5px;">
                                           
                                            <!-- gallery picture -->
                                            <li>
                                                <a href="<?=$list[$i]['href']?>" data-lightbox="example-set">
                                                <?php
                                                if ($list[$i]['is_notice']) { // 공지사항  ?>
                                                    <img src="<?php echo $board['bo_gallery_width'].'X'.$board['bo_gallery_height']; ?>/ffffff/?text=공지" class="img-responsive">
                                                <?php } else {
                                                    $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], true, false, ''); // false, true 이미지 확장

                                                    if($thumb['src']) {
                                                        $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" class="img-responsive">';
                                                    } else {
                                                        $img_content = '<img src="http://placehold.it/'.$board['bo_gallery_width'].'X'.$board['bo_gallery_height'].'/ffffff/?text=no+image" class="img-responsive">';
                                                    }

                                                    echo $img_content;
                                                }
                                                 ?>
                                                 <i class="fa fa-eye"></i>
                                                </a>
                                            </li>
                                            <!-- li class="text-center h5"><i class="fa fa-fw fa-user"></i><?php echo $list[$i]['name'] ?></li -->
                                           
                                        </ul> 

|

답변 4개

채택된 답변
+20 포인트

이렇게 변경 하시면 되실듯 합니다 

<ul class="list-unstyled thumbnail" style="padding:10px; margin-bottom:5px;">

<!-- gallery picture -->

<li>

<?php

$img_content=$pop_image = ""; 

if ($list[$i]['is_notice']) { // 공지사항  

$pop_image = $board['bo_gallery_width'].'X'.$board['bo_gallery_height'].'/ffffff/?text=공지'; 

$img_content = '<img src="'.$pop_image.'" class="img-responsive">';

} else {

    $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], true, false, ''); // false, true 이미지 확장 

    if($thumb['src']) {

$pop_image  = $thumb['src'];

$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" class="img-responsive">';

    } else {

$pop_image  ='http://placehold.it/'.$board['bo_gallery_width'].'X'.$board['bo_gallery_height'].'/ffffff/?text=no+image';

$img_content = '<img src="'.$pop_image.'" class="img-responsive">';

    }

}

?>

<a href="<?=$pop_image?>" data-lightbox="example-set">

<?php  echo $img_content; ?> <i class="fa fa-eye"></i>

</a>

</li>

<!-- li class="text-center h5"><i class="fa fa-fw fa-user"></i><?php echo $list[$i]['name'] ?></li -->

</ul>

2017-06-06 (화) 03:31:16

와~ 대단하십니다. 이런 심오한 가르침을 ...  

2017-06-05 (월) 19:01:42
반응이 없네요 ~! <?=$list[$i]['href']?> 대신 쓰라는건가요 ?

<?echo $list[$i]['file'][$i]['path'].'/'.$list[$i]['file'][$i]['file']?> // 게시판 설정에서 목록에서 파일사용 체크 

이부분이 첨부파일의 경로입니다.

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