다른 사이트 복사이미지가 리스트 목록에서 나오게 할려면...
본문
첨부파일 이미지가 있거나
유튜브 주소가 입력되면
리스트 목록에서 이미지가 보여지게 게시판을 사용하고 있습니다.
그런데..
내용에 다른 사이트 이미지를 복사해서 넣거나 소스로 해서 올리면 이미지가 목록에 나오게 하고 싶은데 아래 소스를 어떻게 수정해야 할까요?
<?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>
!-->
답변 1
참고만 해 보세요.
<?php
preg_match("/<img[^>]*src=[\"']?([^>\"']+)[\"']?[^>]*>/i", $list[$i]['wr_content'], $matches);
echo $matches['0'];
?>
답변을 작성하시기 전에 로그인 해주세요.