썸네일 관련 질문좀 드릴게요 ㅜㅜ 정보
썸네일 관련 질문좀 드릴게요 ㅜㅜ- mickey1377 자기소개 아이디로 검색 회원게시물
- 748
본문
메인화면에 이미지 가로롤링되게 하고 있는데....
제목에 넣고 싶은데..잘 안되서요 ...
latest.skin.php
<!--js-main_bn시작! -->
<div class="slide" id="focus2">
<div class="slide_ct">
<div class="slide_ct_container">
<ul class="slide_ct_container_list" id="xxx">
<? for ($i=0; $i<count($list); $i++) { ?>
<?
//썸네일 생성
$thumfile = "";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
// 썸네일 이미지가 존재하지 않는다면
if (!file_exists($thumb)) {
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
// 업로드된 파일이 이미지라면
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file)) {
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
} else { //게디터에서 삽입한 이미지 뽑자ㅠㅠ
$edit_img = $list[$i]['wr_content'];
if (eregi("data/cheditor4/{$ym}/[^<>]*\.(gif|jpg|png|bmp)", $edit_img, $tmp)) { // data/geditor------
$file = './' . $tmp[0]; // 파일명
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
}
if (file_exists($thumb))
$thumfile = "<img src='$thumb' width='{$img_width}' height='{$img_height}' border='0' style='border:0px #ccc solid'></a>";
else
//이미지가 없으면
$thumfile="<img src='$latest_skin_path/img/noimg.gif' width='{$img_width}' height='{$img_height}' style='border:0 #E7E7E7 solid'></a>";
//이미지가 아니네
if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))
{ $thumfile = "<script>doc_write(flash_movie('$file', 'flash$i', '$img_width', '$img_height', 'transparent'));</script>"; }
?>
<li><a href='{$list[$i][href]}'><?=$thumfile?></a></li>
<!--ex) li><a href="-- in url --" title="1">
<img width:765px; height="260" alt="1" src="img/images/01.jpg" /></a></li -->
<? } ?>
</ul>
</div>
</div>
<p class="slide_opacity"> </p>
<div class="slide_tt"> <span class="PN prevSlide"> </span> <span class="PN prev"> </span>
<div class="slide_tt_container container">
<ul class="slide_tt_container_list">
<? for ($i=0; $i<count($list); $i++) { $k = $i + 1; ?><li><span title=""><?=$k?></span></li><? } ?>
<!--ex) li><span title="">1</span></li -->
</ul>
</div>
<span class="PN next"> </span> <span class="PN nextSlide"> </span> </div>
<div class="PN next"><p><span class="font"><?php echo $list[$i]['subject']; ?></span></p></div>
</div>
<!--/js-End!-->
주절없이썼는데 .. 아시는분 좀 도와주세요 ㅜㅜ
제목에 넣고 싶은데..잘 안되서요 ...
latest.skin.php
<!--js-main_bn시작! -->
<div class="slide" id="focus2">
<div class="slide_ct">
<div class="slide_ct_container">
<ul class="slide_ct_container_list" id="xxx">
<? for ($i=0; $i<count($list); $i++) { ?>
<?
//썸네일 생성
$thumfile = "";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
// 썸네일 이미지가 존재하지 않는다면
if (!file_exists($thumb)) {
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
// 업로드된 파일이 이미지라면
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file)) {
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
} else { //게디터에서 삽입한 이미지 뽑자ㅠㅠ
$edit_img = $list[$i]['wr_content'];
if (eregi("data/cheditor4/{$ym}/[^<>]*\.(gif|jpg|png|bmp)", $edit_img, $tmp)) { // data/geditor------
$file = './' . $tmp[0]; // 파일명
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
}
if (file_exists($thumb))
$thumfile = "<img src='$thumb' width='{$img_width}' height='{$img_height}' border='0' style='border:0px #ccc solid'></a>";
else
//이미지가 없으면
$thumfile="<img src='$latest_skin_path/img/noimg.gif' width='{$img_width}' height='{$img_height}' style='border:0 #E7E7E7 solid'></a>";
//이미지가 아니네
if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))
{ $thumfile = "<script>doc_write(flash_movie('$file', 'flash$i', '$img_width', '$img_height', 'transparent'));</script>"; }
?>
<li><a href='{$list[$i][href]}'><?=$thumfile?></a></li>
<!--ex) li><a href="-- in url --" title="1">
<img width:765px; height="260" alt="1" src="img/images/01.jpg" /></a></li -->
<? } ?>
</ul>
</div>
</div>
<p class="slide_opacity"> </p>
<div class="slide_tt"> <span class="PN prevSlide"> </span> <span class="PN prev"> </span>
<div class="slide_tt_container container">
<ul class="slide_tt_container_list">
<? for ($i=0; $i<count($list); $i++) { $k = $i + 1; ?><li><span title=""><?=$k?></span></li><? } ?>
<!--ex) li><span title="">1</span></li -->
</ul>
</div>
<span class="PN next"> </span> <span class="PN nextSlide"> </span> </div>
<div class="PN next"><p><span class="font"><?php echo $list[$i]['subject']; ?></span></p></div>
</div>
<!--/js-End!-->
주절없이썼는데 .. 아시는분 좀 도와주세요 ㅜㅜ
댓글 전체