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

에디터5 썸네일 추출 채택완료

돼지코구뇽 11년 전 조회 5,091
 
</strong><font face="돋움, dotum, helvetica"><span style="font-size: 12px; line-height: 21.600000381469727px"><b><div style="display: inline !important"><? for ($i=0; $i<count($list); $i++) </div>
<div>        {</div>
<div>        // 썸네일 이미지가 존재하지 않는다면</div>
<div>        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];</div>
<div>        // 업로드된 파일이 이미지라면</div>
<div>        if (preg_match("/\.(jpg|gif|png)$/i", $file) && file_exists($file)) {</div>
<div><span class="Apple-tab-span" style="white-space: pre">		</span>$thumb = thumbnail($file, $thumb_width, $thumb_height, 0, 1, 90, 0, "",  $filter, $noimg); // 0 그대로 2 확대</div>
<div>       } else { //에디터에서 삽입한 이미지</div>
<div><span class="Apple-tab-span" style="white-space: pre">								</span>$edit_img = $list[$i]['wr_content'];</div>
<div><span class="Apple-tab-span" style="white-space: pre">							</span>if (eregi("data/cheditor5[^<>]*\.(gif|jp[e]?g|png|bmp)", $edit_img, $tmp)) { // data/cheditor------</div>
<div><span class="Apple-tab-span" style="white-space: pre">								</span>$file = $g4[path].'/' . $tmp[0]; // 파일명</div>
<div><span class="Apple-tab-span" style="white-space: pre">								</span>$thumb=thumbnail($file, $img_width, $img_height, 0, 1, 90, 0, "",  $filter, $noimg); //언샾마스크추가</div>
<div><span class="Apple-tab-span" style="white-space: pre">							</span>}</div>
<div><span class="Apple-tab-span" style="white-space: pre">	</span>    }</div>
<div><span class="Apple-tab-span" style="white-space: pre">		</span>echo "<div class='col-md-4 col-sm-6'>";</div>
<div><span class="Apple-tab-span" style="white-space: pre">		</span>echo "<div class='thumbnail'>";</div>
<div><span class="Apple-tab-span" style="white-space: pre">		</span>echo "<div class='thumbnail-view' style='margin: 0 auto; width: 100%;'>";</div>
<div><span class="Apple-tab-span" style="white-space: pre">		</span>echo "<a href='{$list[$i][href]}' class='thumbnail-view-hover ui-lightbox'>";</div>
<div><span class="Apple-tab-span" style="white-space: pre">		</span>echo "<span class='hidden-xs' style='position: absolute;right: 10px;bottom: 10px;font-size: 14px; color: #fff;'><i class='fa fa-eye'></i> ";</div>
<div><span class="Apple-tab-span" style="white-space: pre">		</span>echo $list[$i][wr_hit];</div>
<div><span class="Apple-tab-span" style="white-space: pre">		</span>echo " <i class='fa fa-thumbs-up'></i> ";</div>
<div>    <span class="Apple-tab-span" style="white-space: pre">	</span>echo $list[$i][wr_good];</div>
<div><span class="Apple-tab-span" style="white-space: pre">		</span>echo " <i class='fa fa-thumbs-down'></i> ";</div>
<div>    <span class="Apple-tab-span" style="white-space: pre">	</span>echo $list[$i][wr_nogood];</div>
<div><span class="Apple-tab-span" style="white-space: pre">		</span>echo "</a>";</div>
<div>    if ($wr_id == $list[$i][wr_id]) {</div>
<div><span class="Apple-tab-span" style="white-space: pre">	</span>$thumfile = "<img src='$thumb' alt='".$list[$i][subject]."' />";</div>
<div>    } else {</div>

<div style="display: inline !important"><span class="Apple-tab-span" style="white-space: pre">	</span>$thumfile = "<img src='$thumb' alt='".$list[$i][subject]."' />";</div></b></span></font><strong style="font-family: 돋움, dotum, helvetica; font-size: 12px; line-height: 21.600000381469727px">
 
이미지 3.png
체디터가 업그레이드 되면서 (불당썸 적용) 썸네일이 생성이 안되고 있습니다.
또한 이미지가 없을경우 '해당게시판 / img / noimg.gif 를 출력할려고합니다
프로그램 고수분들 도와주세요!
 
댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
</span></font>
<div><pre style="line-height: normal">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); //언샾마스크추가
}</pre><pre style="line-height: normal"><span style="font-family: 굴림; font-size: 10pt; line-height: 1.5">
추출 방법은 여기에 정규식으로 이미 나와 있습니다. 
어디에 저장이 되는지 먼저 확인을 해보시는것이 좋으실것 같구요
eregi는 현재 사용을 잘 않하지 않나요
로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

돼지코구뇽
11년 전
안되네요. ㅠㅠ 불당썸 자체라서 경로를 봐야할듯하네요..

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

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

로그인