혹시 정규식씨 아시는 분 계신가요?

혹시 정규식씨 아시는 분 계신가요?

QA

혹시 정규식씨 아시는 분 계신가요?

본문

댓글에서 에디터로 올린 이미지를 리스트에서 섬네일로 불러오는데..

 

                  <?php 
                    if (!$list[$i]['is_notice']) {
$query = " select wr_content from ".$write_table." where wr_parent = '".$list[$i]['wr_id']."' and wr_is_comment > 0 "; 
/*여러개의 글 검사 할 때*/
$result = sql_query($query); 
for($j=0; $row = sql_fetch_array($result); $j++) {
   echo get_view_thumbnail($row['wr_content'], $board['bo_gallery_width'], false); 
}
/*여러개의 글 검사 할 때*/

                       //$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 src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'"  class="list_img">';
                
                        }
                       echo $img_content; 
                       
                       
                    }
                ?>

잘나오긴 하는데 텍스트까지 출력되어 디비에서 확인해보니 

cheditor에 wr_content 안에 이미지 url이 디비에 저장되는 식이더군요,,,

 

그래서 echo get_view_thumbnail($row['wr_content'], $board['bo_gallery_width'], false);  하면

텍스트와 이미지가 함께 출력됩니다.

 

이미지만 섬네일로 뽑아오려면 $row['wr_content'], 를 정규식씨로 해야 한다는거 같은데

문제는 제가 정규식씨를 본적도 없고 1도 모릅니다. 유유

 

도움을 기다려봅니다.

이 질문에 댓글 쓰기 :

답변 1

https://sir.kr/pg_lecture/713

sir 에서 검색해도 바로 나와요

감사합니다. 이미지 불러오고 그걸 팝업으로 띄우려니 이렇게 복잡해졌습니다.
되긴 되는데 맞는건지 모르겠습니다.ㅋ

    <img style="cursor:pointer;" src=" <?php
                    if (!$list[$i]['is_notice']) {
$query = " select wr_content from ".$write_table." where wr_parent = '".$list[$i]['wr_id']."' and wr_is_comment > 0 ";

$result = sql_query($query);



for($j=0; $row = sql_fetch_array($result); $j++) {
preg_match_all("/<img[^>]*src=[\"']?([^>\"']+)[\"']?[^>]*>/i", $row['wr_content'],$matches);

echo  get_view_thumbnail($matches[1][0], $board['bo_gallery_width'], false);

}
 
                    }
    ?>" onclick="window.open('<?php
                    if (!$list[$i]['is_notice']) {
$query = " select wr_content from ".$write_table." where wr_parent = '".$list[$i]['wr_id']."' and wr_is_comment > 0 ";

$result = sql_query($query);



for($j=0; $row = sql_fetch_array($result); $j++) {
preg_match_all("/<img[^>]*src=[\"']?([^>\"']+)[\"']?[^>]*>/i", $row['wr_content'],$matches);

echo  get_view_thumbnail($matches[1][0], $board['bo_gallery_width'], false);

}

 
                    }
    ?>','asd','scrollbars=yes,width=650,height=750,top=10,left=20');">

답변을 작성하시기 전에 로그인 해주세요.
전체 0 | RSS
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT