원본이미지 보기 경로설정이 안됩니다. 정보
원본이미지 보기 경로설정이 안됩니다.
본문
아래 보시면
<td style="padding:0 0 0 0px;border:1px solid #D4DBE1;" width="430" height="330" align="center" valign="top" bgcolor=white>
<div style='width:430px; position:relative; overflow:hidden;' align="center" id="loadarea" onClick="View_Open('#')"><a href="javascript:void(0);"><img src="<?=$view_one?>" border="0"></a></div>
</td>
<td width="10"></td>
이 부분이 있는데요. ㅜ.ㅜ 제가 onClick="View_Open('#')"><a href="javascript:void(0);" 이 부분을 추가해넣었더니 새창으로 원본이미지가 뜰듯말듯 하게 되었습니다.
지수아빠님의 맛집 스킨에 원본이미지 크게보기를 하기 위해 이짓저짓 며칠째 끄적이고 있습니다.
제 생각에는 onClick="View_Open('#')" 에서 #부분에 경로를 잘만 설정해주면 뜰 것 같은데 모든 경로를 총 동원해보아도 도무지 뜨지를 않습니다.
아래가 원래 소스입니다. 윗부분 잘라내고 중요한 것 같은 부분만 올렸는데 이것만으로도 해결해 주실 수 있는지 모르겠습니다. 부탁드려요... 플리즈... ; _ ;
<SCRIPT LANGUAGE="JavaScript">
<!--
image_directory = ""; //배경이미지 경로
clear = new Image(); clear.src = image_directory + "./img/blank.gif";
<?
//파일 뽑기
$sql2 = " select bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no limit 0, 10 ";
$result2 = sql_query($sql2);
for ($j=0; $row2 = sql_fetch_array($result2); $j++) {
if($j==0) $view_one = "{$thumb_path2}/{$row2['bf_file']}";
}
?>
// -->
</SCRIPT>
<table cellspacing="0" cellpadding="0" border="0" align="center">
<tr>
<td style="padding:0 0 0 0px;border:1px solid #D4DBE1;" width="430" height="330" align="center" valign="top" bgcolor=white>
<div style='width:430px; position:relative; overflow:hidden;' align="center" id="loadarea" onClick="View_Open('#')"><a href="javascript:void(0);"><img src="<?=$view_one?>" border="0"></a></div>
</td>
<td width="10"></td>
<td style="padding:0 0 0 0px;border:1px solid #D4DBE1;" width="160" height="100%" align="center" valign="top">
<!--작은사진목록-->
<table border="0" cellpadding="0" cellspacing="0" width="100%" valign='top'>
<tr>
<td style="border:solid 1px #D3D3D3; background-color:#E5E5E5;" height="330" valign='top'>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<?
//파일 뽑기
$sql = " select bf_file, bf_source from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no limit 0, 10 ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++) {
if($i != 0 && $i % 2 == 0) echo "</tr><tr>";
$view_w = 430; //썸네일 가로사이즈
$view_h = 330; //썸네일 세로사이즈
$sch_q = 100; //썸네일 퀼리티
if (!is_dir($thumb_path2)) {
@mkdir($thumb_path2, 0707);
@chmod($thumb_path2, 0707);
}
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$filename = $row[bf_file]; //파일명
$thumb2 = $thumb_path2.'/'.$filename; //썸네일
if (!file_exists($thumb2)) { //view 용 이미지 생성
$file = $data_path.'/'.$filename; //원본
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
continue;
$rate = $view_h / $size[1];
//$width = (int)($size[0] * $rate);
$width = 430; //가로 사이즈 고정
//echo "rate : $rate ,width : $width, $height : $board[bo_2] <br>";
if($width <= $view_w) { //width가 지정된 사이즈보다 작을경우 rate 비율로 썸네일 생성
$dst = imagecreatetruecolor($width, $view_h);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $view_h, $size[0], $size[1]);
imagejpeg($dst, $thumb_path2.'/'.$filename, $sch_q);
} else {
$rate = $view_w / $size[0];
$height = (int)($size[1] * $rate);
$dst = imagecreatetruecolor($view_w, $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
imagepng($dst, $thumb_path2.'/'.$filename, $sch_q);
}
chmod($thumb_path2.'/'.$filename, 0707);
}
}
$view_w = 80; //썸네일 가로사이즈
$view_h = 60; //썸네일 세로사이즈
$thumb = $thumb_path.'/'.$filename; //썸네일
if (!file_exists($thumb)) { //기본 썸네일
$file = $data_path.'/'.$filename; //원본
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
continue;
$rate = $view_h / $size[1];
//$width = (int)($size[0] * $rate);
$width = 80; //사이즈를고정한다.
//echo "rate : $rate ,width : $width, $height : $board[bo_2] <br>";
if($width <= $view_w) { //width가 지정된 사이즈보다 작을경우 rate 비율로 썸네일 생성
$dst = imagecreatetruecolor($width, $view_h);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $view_h, $size[0], $size[1]);
$dst = UnsharpMask($dst, 80, 0.5, 3);
imagejpeg($dst, $thumb_path.'/'.$filename, $sch_q);
} else {
$rate = $view_w / $size[0];
$height = (int)($size[1] * $rate);
$dst = imagecreatetruecolor($view_w, $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
$dst = UnsharpMask($dst, 80, 0.5, 3);
imagepng($dst, $thumb_path.'/'.$filename, $sch_q);
}
chmod($thumb_path.'/'.$filename, 0707);
}
}
if (file_exists($thumb) && $filename) {
?>
<td style="border:solid 1px #D0D0D0;height:60px;width:80px;">
<a rel="enlargeimage::mouseover" rev="loadarea" href="<?=$thumb_path2?>/<?=$filename?>"><img src="<?=$thumb?>" style="border-width:0px;" /></a>
</td>
<!-- 원본사이즈보기 <a onClick="View_Open('<?=$data_path?>/<?=$filename?>')" href="javascript:void(0);"><img src="<?=$thumb?>" style="border-width:0px;" /></a>-->
<?
//onMouseOut="bgChange('clear');"
}
}
?>
</table>
</td>
</tr>
</table>
<!--작은사진목록-->
</td>
</tr>
</table>
<!--사진테이블-->
<td style="padding:0 0 0 0px;border:1px solid #D4DBE1;" width="430" height="330" align="center" valign="top" bgcolor=white>
<div style='width:430px; position:relative; overflow:hidden;' align="center" id="loadarea" onClick="View_Open('#')"><a href="javascript:void(0);"><img src="<?=$view_one?>" border="0"></a></div>
</td>
<td width="10"></td>
이 부분이 있는데요. ㅜ.ㅜ 제가 onClick="View_Open('#')"><a href="javascript:void(0);" 이 부분을 추가해넣었더니 새창으로 원본이미지가 뜰듯말듯 하게 되었습니다.
지수아빠님의 맛집 스킨에 원본이미지 크게보기를 하기 위해 이짓저짓 며칠째 끄적이고 있습니다.
제 생각에는 onClick="View_Open('#')" 에서 #부분에 경로를 잘만 설정해주면 뜰 것 같은데 모든 경로를 총 동원해보아도 도무지 뜨지를 않습니다.
아래가 원래 소스입니다. 윗부분 잘라내고 중요한 것 같은 부분만 올렸는데 이것만으로도 해결해 주실 수 있는지 모르겠습니다. 부탁드려요... 플리즈... ; _ ;
<SCRIPT LANGUAGE="JavaScript">
<!--
image_directory = ""; //배경이미지 경로
clear = new Image(); clear.src = image_directory + "./img/blank.gif";
<?
//파일 뽑기
$sql2 = " select bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no limit 0, 10 ";
$result2 = sql_query($sql2);
for ($j=0; $row2 = sql_fetch_array($result2); $j++) {
if($j==0) $view_one = "{$thumb_path2}/{$row2['bf_file']}";
}
?>
// -->
</SCRIPT>
<table cellspacing="0" cellpadding="0" border="0" align="center">
<tr>
<td style="padding:0 0 0 0px;border:1px solid #D4DBE1;" width="430" height="330" align="center" valign="top" bgcolor=white>
<div style='width:430px; position:relative; overflow:hidden;' align="center" id="loadarea" onClick="View_Open('#')"><a href="javascript:void(0);"><img src="<?=$view_one?>" border="0"></a></div>
</td>
<td width="10"></td>
<td style="padding:0 0 0 0px;border:1px solid #D4DBE1;" width="160" height="100%" align="center" valign="top">
<!--작은사진목록-->
<table border="0" cellpadding="0" cellspacing="0" width="100%" valign='top'>
<tr>
<td style="border:solid 1px #D3D3D3; background-color:#E5E5E5;" height="330" valign='top'>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<?
//파일 뽑기
$sql = " select bf_file, bf_source from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no limit 0, 10 ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++) {
if($i != 0 && $i % 2 == 0) echo "</tr><tr>";
$view_w = 430; //썸네일 가로사이즈
$view_h = 330; //썸네일 세로사이즈
$sch_q = 100; //썸네일 퀼리티
if (!is_dir($thumb_path2)) {
@mkdir($thumb_path2, 0707);
@chmod($thumb_path2, 0707);
}
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$filename = $row[bf_file]; //파일명
$thumb2 = $thumb_path2.'/'.$filename; //썸네일
if (!file_exists($thumb2)) { //view 용 이미지 생성
$file = $data_path.'/'.$filename; //원본
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
continue;
$rate = $view_h / $size[1];
//$width = (int)($size[0] * $rate);
$width = 430; //가로 사이즈 고정
//echo "rate : $rate ,width : $width, $height : $board[bo_2] <br>";
if($width <= $view_w) { //width가 지정된 사이즈보다 작을경우 rate 비율로 썸네일 생성
$dst = imagecreatetruecolor($width, $view_h);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $view_h, $size[0], $size[1]);
imagejpeg($dst, $thumb_path2.'/'.$filename, $sch_q);
} else {
$rate = $view_w / $size[0];
$height = (int)($size[1] * $rate);
$dst = imagecreatetruecolor($view_w, $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
imagepng($dst, $thumb_path2.'/'.$filename, $sch_q);
}
chmod($thumb_path2.'/'.$filename, 0707);
}
}
$view_w = 80; //썸네일 가로사이즈
$view_h = 60; //썸네일 세로사이즈
$thumb = $thumb_path.'/'.$filename; //썸네일
if (!file_exists($thumb)) { //기본 썸네일
$file = $data_path.'/'.$filename; //원본
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
continue;
$rate = $view_h / $size[1];
//$width = (int)($size[0] * $rate);
$width = 80; //사이즈를고정한다.
//echo "rate : $rate ,width : $width, $height : $board[bo_2] <br>";
if($width <= $view_w) { //width가 지정된 사이즈보다 작을경우 rate 비율로 썸네일 생성
$dst = imagecreatetruecolor($width, $view_h);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $view_h, $size[0], $size[1]);
$dst = UnsharpMask($dst, 80, 0.5, 3);
imagejpeg($dst, $thumb_path.'/'.$filename, $sch_q);
} else {
$rate = $view_w / $size[0];
$height = (int)($size[1] * $rate);
$dst = imagecreatetruecolor($view_w, $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
$dst = UnsharpMask($dst, 80, 0.5, 3);
imagepng($dst, $thumb_path.'/'.$filename, $sch_q);
}
chmod($thumb_path.'/'.$filename, 0707);
}
}
if (file_exists($thumb) && $filename) {
?>
<td style="border:solid 1px #D0D0D0;height:60px;width:80px;">
<a rel="enlargeimage::mouseover" rev="loadarea" href="<?=$thumb_path2?>/<?=$filename?>"><img src="<?=$thumb?>" style="border-width:0px;" /></a>
</td>
<!-- 원본사이즈보기 <a onClick="View_Open('<?=$data_path?>/<?=$filename?>')" href="javascript:void(0);"><img src="<?=$thumb?>" style="border-width:0px;" /></a>-->
<?
//onMouseOut="bgChange('clear');"
}
}
?>
</table>
</td>
</tr>
</table>
<!--작은사진목록-->
</td>
</tr>
</table>
<!--사진테이블-->
댓글 전체
$data_path 값은 어디있나요?
//화일뽑기 <-- 다음줄에 아래코드를 넣어보세요
$data_path=$g4[path].'/data/file/'. $bo_table;
//화일뽑기 <-- 다음줄에 아래코드를 넣어보세요
$data_path=$g4[path].'/data/file/'. $bo_table;

해결하였습니다. on click~ 이 소스를 img src~ 이 소스 끝나는 바로 뒤에 추가해주니 원본이미지가 뜹니다. 하아... 힘들었네요.;;