http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=121268&sca=%EA%B0%A4%EB%9F%AC%EB%A6%AC&page=2
위 게시판을 사용하려고 합니다.
첨부파일로 올린 이미지가 아니라 에디터에서 올린 이미지 혹은 따로 외부 링크된 이미지를 썸네일로 가져와서 사용하고 싶은데 어떻게 해야 좋을지 모르겠어서 질문드립니다.
list.skin.php를 보면
<?
for ($i=0; $i<count($list); $i++) {
$content = $list[$i][wr_content];
// 내용에서 <img.*> 태그의 전체 코드를 얻음
preg_match("/(<img[^>]+>)/i", $content, $matches);
$img = $matches[1];
// <img.*> 태그에서 src 의 코드만 얻음
preg_match("/src\=[\"\']?([^\"\'\s\>]+)/i", $img, $matches);
$src_editor = $matches[1];
$src_image = $g4[path]."/data/file/".$bo_table."/".$list[$i][file][0][file];
$thumb = $thumb_dir."/".$list[$i][file][0][file];
$thumb_editor = $thumb_dir."/".$list[$i][wr_id];
if (!file_exists($thumb)){ //업로드이미지 썸네일 생성
$thumb = create_thumb($src_image, $thumb_width, $thumb_height, $thumb);
} else if (!file_exists($thumb) && $src_editor ){ //업로드이미지가 없을시 에디터이미지 썸네일 생성
$thumb = create_thumb($real_img_url, $thumb_width, $thumb_height, $thumb_editor);
}
if ($list[$i][file][0][file]){
$print_thumb = "<div class=\"item\"><a href=".$list[$i][href]."><img src=".$thumb." class=\"thumb\" /></a></div>";
} else if ($src_editor){
$print_thumb = "<a href=".$list[$i][href]."><img src=".$thumb_editor." class=\"thumb\" /></a>";
} else {
$print_thumb = "<img src=\"{$board_skin_path}/img/noimage.jpg\" />";
}
?>
<li>
<?=$print_thumb?>
<p>
<? if ($is_checkbox) { ?><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"><? }?><a href="<?=$list[$i][href]?>" class="title"><?=$list[$i][subject]?></a><span class='comment'> <?=$list[$i][comment_cnt]?></span>
</p>
<p class="c_gray"><?=$list[$i][datetime]?></p>
</li>
<? }?>
</ul>
</form>
라고 되어있는데 "업로드이미지가 없을 경우 에디터이미지 썸네일 생성" 부분을 볼 때 이상이 없는 것 같은데
실제로 업로드이미지가 없는 경우는 무조건 엑박이 됩니다.
어떻게 수정하면 좋을까요ㅜㅜ??
위 게시판을 사용하려고 합니다.
첨부파일로 올린 이미지가 아니라 에디터에서 올린 이미지 혹은 따로 외부 링크된 이미지를 썸네일로 가져와서 사용하고 싶은데 어떻게 해야 좋을지 모르겠어서 질문드립니다.
list.skin.php를 보면
<?
for ($i=0; $i<count($list); $i++) {
$content = $list[$i][wr_content];
// 내용에서 <img.*> 태그의 전체 코드를 얻음
preg_match("/(<img[^>]+>)/i", $content, $matches);
$img = $matches[1];
// <img.*> 태그에서 src 의 코드만 얻음
preg_match("/src\=[\"\']?([^\"\'\s\>]+)/i", $img, $matches);
$src_editor = $matches[1];
$src_image = $g4[path]."/data/file/".$bo_table."/".$list[$i][file][0][file];
$thumb = $thumb_dir."/".$list[$i][file][0][file];
$thumb_editor = $thumb_dir."/".$list[$i][wr_id];
if (!file_exists($thumb)){ //업로드이미지 썸네일 생성
$thumb = create_thumb($src_image, $thumb_width, $thumb_height, $thumb);
} else if (!file_exists($thumb) && $src_editor ){ //업로드이미지가 없을시 에디터이미지 썸네일 생성
$thumb = create_thumb($real_img_url, $thumb_width, $thumb_height, $thumb_editor);
}
if ($list[$i][file][0][file]){
$print_thumb = "<div class=\"item\"><a href=".$list[$i][href]."><img src=".$thumb." class=\"thumb\" /></a></div>";
} else if ($src_editor){
$print_thumb = "<a href=".$list[$i][href]."><img src=".$thumb_editor." class=\"thumb\" /></a>";
} else {
$print_thumb = "<img src=\"{$board_skin_path}/img/noimage.jpg\" />";
}
?>
<li>
<?=$print_thumb?>
<p>
<? if ($is_checkbox) { ?><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"><? }?><a href="<?=$list[$i][href]?>" class="title"><?=$list[$i][subject]?></a><span class='comment'> <?=$list[$i][comment_cnt]?></span>
</p>
<p class="c_gray"><?=$list[$i][datetime]?></p>
</li>
<? }?>
</ul>
</form>
라고 되어있는데 "업로드이미지가 없을 경우 에디터이미지 썸네일 생성" 부분을 볼 때 이상이 없는 것 같은데
실제로 업로드이미지가 없는 경우는 무조건 엑박이 됩니다.
어떻게 수정하면 좋을까요ㅜㅜ??
댓글 2개
게시글 목록
| 번호 | 제목 |
|---|---|
| 284508 | |
| 284499 | |
| 284492 | |
| 284490 | |
| 284484 | |
| 284481 | |
| 284478 | |
| 284476 | |
| 284474 | |
| 284472 | |
| 284470 | |
| 284458 | |
| 284457 | |
| 284454 | |
| 284453 | |
| 284447 | |
| 284446 | |
| 284444 | |
| 284441 | |
| 284440 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기