채택완료

에디터이미지 혹은 파일첨부 이미지 리스트에서 띄우기

Copy
<ul id="list" class="portfolio_list da-thumbs">	        <?php for ($i=0; $i<count($list); $i++) {            if($i>0 && ($i % $bo_gallery_cols == 0))                $style = 'clear:both;';            else                $style = '';            if ($i == 0) $k = 0;            $k += 1;            if ($k % $bo_gallery_cols == 0) $style .= "margin:0 !important;";         ?>	    <li class="col-sm-12 col-md-6 col-lg-3 thumbnail">                    <?php                    $wrid = $list[$i][wr_id];                    $sql_img = sql_fetch ("select* from g5_board_file where wr_id = '$wrid' and bo_table='$bo_table' and bf_no = '0'");					$zoomimg_style= 'cursor: url('.$board_skin_url.'/highslide/graphics/zoomin.cur), pointer;outline: none;position:absolute;right:5px;bottom:5px;';                    if($sql_img['bf_file']){                    $img_links = '/data/file/'.$bo_table.'/'.$sql_img[bf_file];                    }else{                        $matches = get_editor_image($list[$i]['wr_content']);                        preg_match("/src=[\'\"]?([^>\'\"]+[^>\'\"]+)/i", $matches[1][0], $m);                        // 이미지 path 구함                        $p = parse_url($m[1]);                        if(strpos($p['path'], '/'.G5_DATA_DIR.'/') != 0)                            $data_path = preg_replace('/^\/.*\/'.G5_DATA_DIR.'/', '/'.G5_DATA_DIR, $p['path']);                        else                            $data_path = $p['path'];                        $img_links = $data_path;                    }?>                    <a href="#" data-toggle="modal" data-target="#Modal2" ></a>                    <div class="modal fade" id="Modal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">					<div class="modal-dialog" style="margin-top:130px;">					<button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="window.location.reload();" style="  margin-top: -30px; font-size: 50px; color: #fff; opacity: 1;">×</button>					<img src="<?php echo $img_links?>" style="width:100%;">					<button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="window.location.reload();" style="  margin-top: 10px; font-size: 50px; color: #fff; opacity: 1;">×</button>					</div>					</div>					<a href="<?php echo $list[$i]['href']?>">                    <?php if ($list[$i]['is_notice']) { // 공지사항  ?>                        <strong style="width:<?php echo $board['bo_gallery_width'] ?>px;height:<?php echo $board['bo_gallery_height'] ?>px">공지</strong>                    <?php } else {                        $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  '.$mobile_img_st.' src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.($board['bo_gallery_width']-1).'" height="'.$board['bo_gallery_height'].'">';                        } else {                            $img_content = '<img src="'.$board_skin_url.'/img/noimg.png" alt="no_imgage" style="width:100%;height:auto" ">';                        }                        echo $img_content;                    }                     ?>                    </a>            <article style="display: block;">			 <a href="#" data-toggle="modal" data-target="#Modal2" >                <h3><?php                echo $list[$i]['icon_reply'];                if ($is_category && $list[$i]['ca_name']) {                 ?>                <span class="label label-info"><a href="<?php echo $list[$i]['ca_name_href'] ?>" class="bo_cate_link"><?php echo $list[$i]['ca_name'] ?></a></span>                <?php } ?>                                   <?php echo $list[$i]['subject'] ?>                    <?php if ($list[$i]['comment_cnt']) { ?><span class="sound_only">댓글</span><?php echo $list[$i]['comment_cnt']; ?><span class="sound_only">개</span><?php } ?>				</h3>			</a>            </article>        </li>        <?php } ?>        <?php if (count($list) == 0) { echo "<li class=\"text-center\">게시물이 없습니다.</li>"; } ?>    </ul>

 

링크1번 보시면 클릭시 이미지가 뜨긴하는데 첫번째 이미지만 뜨네요

 

어디부분이 잘못된건지 제 3의눈으로좀 짚어주세요 ㅠㅠ

|

답변 1개 / 댓글 1개

채택된 답변
+20 포인트
if ($i == 0) $k = 0;
$k += 1;

요부분이 잘못된듯..... 

답변에 대한 댓글 1개

view에서 이미지파일을 넘겨주고 리스트에서 레이어에 넣어줘야될듯한데 복잡하네요 ㅠ 파일첨부와 에디터 ㄷㄷ

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