채택완료

에디터5 썸네일 추출

2014-03-20 (목) 14:32:16 5,275
 
Copy
<? for ($i=0; $i<count($list); $i++) 
        {
        // 썸네일 이미지가 존재하지 않는다면
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        // 업로드된 파일이 이미지라면
        if (preg_match("/\.(jpg|gif|png)$/i", $file) && file_exists($file)) {
		$thumb = thumbnail($file, $thumb_width, $thumb_height, 0, 1, 90, 0, "",  $filter, $noimg); // 0 그대로 2 확대
       } else { //에디터에서 삽입한 이미지
								$edit_img = $list[$i]['wr_content'];
							if (eregi("data/cheditor5[^<>]*\.(gif|jp[e]?g|png|bmp)", $edit_img, $tmp)) { // data/cheditor------
								$file = $g4[path].'/' . $tmp[0]; // 파일명
								$thumb=thumbnail($file, $img_width, $img_height, 0, 1, 90, 0, "",  $filter, $noimg); //언샾마스크추가
							}
	    }
		echo "<div class='col-md-4 col-sm-6'>";
		echo "<div class='thumbnail'>";
		echo "<div class='thumbnail-view' style='margin: 0 auto; width: 100%;'>";
		echo "<a href='{$list[$i][href]}' class='thumbnail-view-hover ui-lightbox'>";
		echo "<span class='hidden-xs' style='position: absolute;right: 10px;bottom: 10px;font-size: 14px; color: #fff;'><i class='fa fa-eye'></i> ";
		echo $list[$i][wr_hit];
		echo " <i class='fa fa-thumbs-up'></i> ";
    	echo $list[$i][wr_good];
		echo " <i class='fa fa-thumbs-down'></i> ";
    	echo $list[$i][wr_nogood];
		echo "</a>";
    if ($wr_id == $list[$i][wr_id]) {
	$thumfile = "<img src='$thumb' alt='".$list[$i][subject]."' />";
    } else {
	$thumfile = "<img src='$thumb' alt='".$list[$i][subject]."' />";
 

이미지 3.png


체디터가 업그레이드 되면서 (불당썸 적용) 썸네일이 생성이 안되고 있습니다.

또한 이미지가 없을경우 '해당게시판 / img / noimg.gif 를 출력할려고합니다

프로그램 고수분들 도와주세요!
 

|

답변 1개 / 댓글 1개

채택된 답변
+20 포인트
Copy
else { //에디터에서 삽입한 이미지
$edit_img = $list[$i]['wr_content'];
if (eregi("data/cheditor5[^<>]*\.(gif|jp[e]?g|png|bmp)", $edit_img, $tmp)) { // data/cheditor------
$file = $g4[path].'/' . $tmp[0]; // 파일명
$thumb=thumbnail($file, $img_width, $img_height, 0, 1, 90, 0, "", $filter, $noimg); //언샾마스크추가
}
추출 방법은 여기에 정규식으로 이미 나와 있습니다. 
어디에 저장이 되는지 먼저 확인을 해보시는것이 좋으실것 같구요
eregi는 현재 사용을 잘 않하지 않나요

답변에 대한 댓글 1개

2014-03-20 (목) 19:39:21
안되네요. ㅠㅠ 불당썸 자체라서 경로를 봐야할듯하네요..

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