갤러리 최신글 불러오기 latest 질문!!
본문
index페이지에 갤러리 게시판에서 최신글을 불러왔습니다.
불러온 해당 이미지를 클릭하면 갤러리게시판이 있는 페이지 내의 해당 글로 이동하게끔 하고 싶은데..
잘안되네요..ㅠ_ㅠ
갤러리게시판 목록으로만 이동됩니다.
아래쪽에
<li><a href='http://hansolcst.co.kr/sub3_1.html'><?=$list[$i]['subject']?></a></li>
이 부분의 경로설정이 문제 인것 같은데..
어떻게 하면 되는지 좀 알려주세요.
부탁드립니다!!!^^
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_width = 130;
$img_height = 110;
$img_quality = 100;
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
$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);
?>
<style type="text/css">
#t { width: 620px;}
.img_list { width: 620px; overflow:hidden; padding: 20px 0px 0 0px; margin: 0 auto; }
.img_list li { display:inline; list-style:none; float:left; padding: 0 20px 0 0; }
.img_list li a {color:#333; text-decoration:none; }
.img_list li a:hover { text-decoration:none; color:#FF4500; }
.img_list li img {display:block; border:none; border: 1px solid #cccccc; }
.img_list2 { width: 620px; overflow:hidden; padding: 8px 0px 0 2px; margin: 0 auto; }
.img_list2 li { display:inline; font:11px 돋움, Dotum; color: #333333; text-align:left; list-style:none; float:left; width:152px; }
.img_list2 li a { color:#333333; text-decoration:none; }
.img_list2 li a:hover { text-decoration:none; color:#111111;}
</style>
<div id="t">
<ul class="img_list">
<? 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'></a>";
else
//이미지가 없으면
$thumfile="<img src='$latest_skin_path/img/no_images.gif' width='{$img_width}' height='{$img_height}'></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='http://hansolcst.co.kr/sub3_1.html'><?=$thumfile?></a></li>
<?
}
?>
</ul>
<ul class="img_list2">
<? for ($i=0; $i<count($list); $i++) { ?>
<li><a href='http://hansolcst.co.kr/sub3_1.html'><?=$list[$i]['subject']?></a></li>
<?
}
?>
</ul>
</div>
답변을 작성하시기 전에 로그인 해주세요.