썸네일 이미지 3개만 생성 시키기
		
※ 로그인 하시면 원본파일을 볼 수 있습니다. ※
		
		
				
				
			<?php
	for ($i=0; $i<count($list); $i++) {
		$li = $list[$i];
		$wr_content = preg_replace("/<(.*?)\>/"," ",$list[$i][wr_content]); 
		$wr_content = preg_replace("/ /"," ",$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";
		}
?>
※ 로그인 하시면 원본파일을 볼 수 있습니다. ※
		코멘트 0
					
	
	
	
 
 

 
 