에디터로 올린 이미지를 먼저 썸네일로 노출하는 방법 채택완료
불량닭발
2년 전
조회 1,921
그누보드 5.4버전 사용 중입니다.
첨부파일과 에디터에서 동시에 이미지를 올렸을때 에디터 이미지를 먼저 썸네일로 노출하고, 에디터 이미지 없을 때 첨부파일 이미지를 노출하고 싶은데요.
단순하게
</p>
<p> if(isset($row['bf_file']) && $row['bf_file']) {
$filename = $row['bf_file'];
$filepath = G5_DATA_PATH.'/file/'.$bo_table;
$alt = get_text($row['bf_content']);
} else {
$write = get_thumbnail_find_cache($bo_table, $wr_id, 'content');
$edt = true;
if( $matches = get_editor_image($write['wr_content'], false) ){
for($i=0; $i<count($matches[1]); $i++)
{
// 이미지 path 구함
$p = parse_url($matches[1][$i]);
if(strpos($p['path'], '/'.G5_DATA_DIR.'/') != 0)
$data_path = preg_replace('/^\/.*\/'.G5_DATA_DIR.'/', '/'.G5_DATA_DIR, $p['path']);
else
$data_path = $p['path'];</p>
<p> $srcfile = G5_PATH.$data_path;</p>
<p> if(preg_match("/\.({$config['cf_image_extension']})$/i", $srcfile) && is_file($srcfile)) {
$size = @getimagesize($srcfile);
if(empty($size))
continue;</p>
<p> $filename = basename($srcfile);
$filepath = dirname($srcfile);</p>
<p> preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $matches[0][$i], $malt);
$alt = isset($malt[1]) ? get_text($malt[1]) : '';</p>
<p> break;
}</p>
<p> $filename = run_replace('get_editor_filename', $filename, $p);
} //end for
} //end if
}</p>
<p>
이부분을 뒤집으니 에디터 이미지는 썸네일로잘 나오는데 첨부파일 이미지가 모두 노 이미지로 뜨네요.
다른글 찾아봤는데 조금씩 틀려서 다시 질문 드려 봅니다.
감사합니다.
그리고 여기서 특정한 게시판만 이부분을 적용 할 수 있을까요?
if ($bo_table != 'free') {
}
구문을 정확하게 몰라서 잘 적용이 안되네요...
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인