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

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
에디터이미지 혹은 파일첨부 이미지 리스트에서 띄우기

QA

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

답변 1

본문

    <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

if ($i == 0) $k = 0;
$k += 1;

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

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