크게 작게 인쇄

[후딱빌더]썸네일 이미지 3개만 생성 시키기

썸네일 이미지 3개만 생성 시키기

<?php
for ($i=0; $i<count($list); $i++) {
$li = $list[$i];

$wr_content = preg_replace("/<(.*?)\>/"," ",$list[$i][wr_content]); 
$wr_content = preg_replace("/&nbsp;/"," ",$wr_content); 
$wr_content = str_replace("//##", " ", $wr_content); 
$wr_content2 = cut_str(get_text($wr_content), 500, '…');
$wr_content = cut_str(get_text($wr_content), 100, '…');

$content_img_array = "";
$content_img_array = hd_get_content_img($list[$i][wr_content]);

$thumb = array();
$thumb_i = 1; // 리스트에서 이미지 1개이상 출력안되게

// 파일첨부 이미지 썸네일
if (is_array($list[$i]['file'])) {
foreach($list[$i]['file'] as $k => $v){

if($thumb_i >= 3) // 리스트에서 이미지 3개이상 출력안되게
continue;

$temp_thumb = $thumb_path."/". $v['file']; // 썸네일 경로와 파일명
$image_file = $data_path . '/' . $v['file']; // 원본 경로와 파일명
if(!file_exists($thumb_path."/". $v['file'])){
if(make_thumnail($image_file, $temp_thumb, $thumb_w, $thumb_h))  // 썸네일만 생성
$thumb[] = $thumb_path."/". $v['file']; // 썸네일이 생성되면 배열에 썸네일 경로를 넣음
}else if($list[$i][file][$k][view]){
$thumb[] = $thumb_path."/". $v['file']; // 썸네일이 생성되면 배열에 썸네일 경로를 넣음
}
 $thumb_i++; // 리스트에서 이미지 3개이상 출력안되게
}
}

// 에디터 이미지 썸네일
foreach($content_img_array as $k => $v){
if($thumb_i >= 2)
continue;

$Imgfilename = hd_get_imgname($v);
$temp_thumb = $thumb_path."/". $Imgfilename[1]; // 썸네일 경로와 파일명
$v = trim($v);
$image_file = (preg_match("`^(/|http)`i", $v)) ? str_replace(dirname(__FILE__), '', $_SERVER['DOCUMENT_ROOT'] . preg_replace("`https?://[^/]+`i", '', $v)) : $v;
if(!file_exists($thumb_path."/". $Imgfilename[1])){
if(make_thumnail($image_file, $temp_thumb, $thumb_w, $thumb_h))  // 썸네일만 생성
$thumb[] = $thumb_path."/". $Imgfilename[1]; // 썸네일이 생성되면 배열에 썸네일 경로를 넣음
}else{
$thumb[] = $thumb_path."/". $Imgfilename[1]; // 썸네일이 생성되면 배열에 썸네일 경로를 넣음
}
$thumb_i++;
}
if($thumb[0]){
$thumb = $thumb[0];
} else {
$thumb = "{$latest_skin_path}/image/no_image.gif";
}
?>



※ 로그인 하시면 원본파일을 볼 수 있습니다. ※

1
코멘트 0
자동등록방지 코드
그누보드팁 | 전체게시물 13
안내

포인트안내닫기

  • 글읽기0
  • 글쓰기100
  • 댓글쓰기50
  • 다운로드-500
그누보드팁리스트
번호 제목 글쓴이 날짜 조회 추천
13 텍스트 +1 슈퍼맨 웹스터디 01-10 5448 0
12 파일첨부 +2 링크 슈퍼맨 웹스터디 06-06 4786 0
11 텍스트 슈퍼맨 웹스터디 10-27 5009 1
10 텍스트 슈퍼맨 웹스터디 10-26 3410 0
9 파일첨부 +4 슈퍼맨 웹스터디 09-27 3744 2
8 파일첨부 슈퍼맨 웹스터디 09-26 3958 0
7 텍스트
[후딱빌더]썸네일 이미지 3개만 생성 시키기
슈퍼맨 웹스터디 09-26 3623 1
6 파일첨부 +2 슈퍼맨 웹스터디 09-26 3940 0
5 텍스트 링크 슈퍼맨 웹스터디 09-26 3843 1
4 파일첨부 링크 슈퍼맨 웹스터디 09-26 6212 0
3 텍스트 슈퍼맨 웹스터디 09-26 3265 0
2 텍스트 슈퍼맨 웹스터디 09-26 3705 0
1 텍스트 링크 슈퍼맨 웹스터디 09-26 3350 0