본문에서 이미지 추출 > 그누보드5 팁자료실

그누보드5 팁자료실

본문에서 이미지 추출 정보

본문에서 이미지 추출

본문

if(0 == preg_match("/<img[^>]*src=[\"']?([^>\"']+)[\"']?[^>]*>/i", $write[wr_content], $match)){ 
$file = sql_fetch("select * from g5_board_file where bo_table='$bo_table' and wr_id='$write[wr_id]' and bf_no='0'"); 
$imgurl = thumbnail($g5[path]."/data/file/$bo_table/$file[bf_file]","144","99",0,1); 
} else{ 
$exp = explode("/data/",$match[1]); 
$imgurl = thumbnail("$g5[path]/data/".$exp[1],"144","99",0,1); // img/imgart.png 
}

추천
2
  • 복사

댓글 5개

그냥 컨텐츠에 이미지 태그가 있으면 board_file 테이블 접속해서 썸네일 있으면 url 불러오고 아니면 썸네일을 생성한다는 뜻이에요^^
© SIRSOFT
현재 페이지 제일 처음으로