<div>
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_width = 750; //큰 썸네일 가로
$img_height = 500; //큰 썸네일 세로
$img_quality = 100; //썸네일 퀄리티
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_big4';
$ym = date("ym", $g4[server_time]);
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
//코멘트와 리플글은 제외
$sql = " select * from $tmp_write_table
where wr_comment = '' and wr_reply = ''
order by wr_id DESC LIMIT 0, 1 ";
$result = sql_query($sql);
$last_con = sql_fetch_array($result);
?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script type="text/javascript" src="http://malsup.github.com/chili-1.7.pack.js"></script>
<script type="text/javascript" src="http://malsup.github.com/jquery.cycle.all.js"></script>
<script type="text/javascript" src="http://malsup.github.com/jquery.easing.1.3.js"></script>
<script type="text/javascript">
$(function() {
$('#slideshow').cycle({
fx: 'fade',
speed: '2500',
pause: 1 ,
timeout: 3000,
pager: '#nav',
pagerEvent: 'mouseover',
pagerAnchorBuilder: function(idx, slide) {
// return sel string for existing anchor
return '#nav li:eq(' + (idx) + ') a';
}
});
$('#direct').click(function() {
$('#nav li:eq(2) a').triggerHandler('click');
return false;
});
});
</script>
<style type="text/css">
* {margin:0}
img {border:none}
#slideshow {}
#nav_wrap {width:750px; text-align:center;}
#nav {
}
#nav li {float:left; border:1px solid #ccc; margin:5px; padding:5px; list-style:none;}
#nav a {padding:2px; display:block;}
#nav li.activeSlide a {background:#50a0fa; }
#nav a:focus {outline:none; }
#nav img {border:none; display:block;}
</style>
<div id="slideshow">
<!-- First Content -->
<?
for ($i=0; $i<count($list); $i++) {
$thumfile2 = $thumb_path.'/'.$list[$i][wr_id];
$j = $i + 1;
if ($j == "1") {
$hide='';
} else {
$hide='ui-tabs-hide'; }
?>
<a href='<?=$list[$i][href]?>'><img src="<?=$thumfile2?>" width=750px; height="500" alt="" /></a>
<? }?>
</div>
<div id="nav_wrap">
<ul id="nav" class="clearfix">
<?
for ($i=0; $i<count($list); $i++) {
$j = $i + 1;
if ($j == "1") {
$selected='ui-tabs-selected';
} else {
$selected='';}
//썸네일 생성
$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);
}
}
}