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

다른 사이트 복사이미지가 리스트 목록에서 나오게 할려면... 채택완료

다조아해 6년 전 조회 2,842

첨부파일 이미지가 있거나

유튜브 주소가 입력되면 리스트 목록에서 이미지가 보여지게 게시판을 사용하고 있습니다.

 

그런데.. 내용에 다른 사이트 이미지를 복사해서 넣거나 소스로 해서 올리면 이미지가 목록에 나오게 하고 싶은데 아래 소스를 어떻게 수정해야 할까요?

 

</strong></p>

<pre>
            <?php
            for ($i=0; $i<count($list); $i++) {
            ?>
            <div class="gall_li <?php if ($wr_id == $list[$i]['wr_id']) { ?>gall_now<?php } ?>">
                <?php if ($list[$i]['wr_10']) {  ?>
                    <!-- 유튜브 동영상 시작 { -->
                    <?php
                    $youtube_link = $list[$i]['wr_10'];
                    $youtube_url = parse_url($youtube_link);
                    parse_str($youtube_url['query']);
                ?>
                <?php if($v){ ?>
                <div class="youtubeWrap">
                    <iframe width="728" height="450" src="//www.youtube.com/embed/<?php echo $v; ?>?feature=player_detailpage&vq=hd720" frameborder="0" allowfullscreen></iframe>
                </div>
                <?php } ?>
                <!-- } 유튜브 동영상 끝 -->
                <?php } else {  ?>
                <!-- 이미지 시작 { -->
                <a href="<?php echo $list[$i]['href'] ?>" class="gall_img">
                    <?php
             $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_mobile_gallery_width'], $board['bo_mobile_gallery_height']);
            if($thumb['src']) {
               $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_mobile_gallery_width'].'" height="'.$board['bo_mobile_gallery_height'].'">';
            } else {
               $img_content = '';
             }
             echo $img_content;
         }

         {
                        $v_img_count = count($list[$i]['file']);
                            if($v_img_count && !$img_content) {
                            if ($list[$i]['file'][0]['view']) {
                            echo strip_tags(get_view_thumbnail($list[$i]['file'][0]['view']), '<img>');
                            }
                        }
                    ?>
                </a>
                <!-- } 이미지 끝 -->
                <?php } ?>
            </div></pre>

<p><strong>

 

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

답변 1개

채택된 답변
+20 포인트
6년 전

참고만 해 보세요.

preg_match("/]*src=[\"']?([^>\"']+)[\"']?[^>]*>/i", $list[$i]['wr_content'], $matches); echo $matches['0'];

?>

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

박스피카
3년 전
혹시 첫번째 이미지만 가제올 방법은 없을가요 ?

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

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

로그인