view.skin.php에서 파일 새창띄우기 질문 드립니다... 정보
view.skin.php에서 파일 새창띄우기 질문 드립니다...본문
토마토님의 자동차 스킨을 사용하는데......
스샷...① 부분을 클릭하면 이미지 팝업창 띄우는 방법 아시는분은 알려주세요..
미련하게 다른 보드의 방법을 사용했다는...ㅡㅡ;;;
파일불러오는 소스..
<table cellpadding="3" cellspacing="1" bgcolor="cccccc">
<tr>
<td bgcolor="ffffff"><? if ($view[file][0][view]) {?>
<img src="<?=$image[0]?>" name=gallery_img width="210" height="180" border=0 value=0> ← (해당부분)
<? } else {?>
<img src="<?=$board_skin_path?>/img/noimg.gif" border=0 value=0>
<? } ?></td>
</tr>
</table>
<table align="center">
<tr>
<td><?=$view[file][0][content]?></td>
</tr>
</table>
<table width="100%" cellpadding="5" >
<tr>
<td align="center"><? if ($view[file][0][file]) {?>
<a href=# <? echo "onClick=\"chgImg( '".$image[0]."','".$image[0]."','".ereg_replace("(\r\n|\n|\r)", "<br>", strip_tags($content) )."' );\"" ?>> <img src="<?=$board_skin_path?>/img/car_p_1.gif" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][1][file]) {?>
<a href=# <? echo "onClick=\"chgImg( '".$image[1]."','".$image[1]."','".ereg_replace("(\r\n|\n|\r)", "<br>", strip_tags($content) )."' );\"" ?>> <img src="<?=$board_skin_path?>/img/car_p_2.gif" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][2][file]) {?>
<a href=# <? echo "onClick=\"chgImg( '".$image[2]."','".$image[2]."','".ereg_replace("(\r\n|\n|\r)", "<br>", strip_tags($content) )."' );\"" ?>> <img src="<?=$board_skin_path?>/img/car_p_3.gif" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][3][file]) {?>
<a href=# <? echo "onClick=\"chgImg( '".$image[3]."','".$image[3]."','".ereg_replace("(\r\n|\n|\r)", "<br>", strip_tags($content) )."' );\"" ?>> <img src="<?=$board_skin_path?>/img/car_p_4.gif" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][4][file]) {?>
<a href=# <? echo "onClick=\"chgImg( '".$image[4]."','".$image[4]."','".ereg_replace("(\r\n|\n|\r)", "<br>", strip_tags($content) )."' );\"" ?>> <img src="<?=$board_skin_path?>/img/car_p_5.gif" align="absmiddle" border="0"></a>
<? }?>
</td>
</tr>
</table>
<tr>
<td bgcolor="ffffff"><? if ($view[file][0][view]) {?>
<img src="<?=$image[0]?>" name=gallery_img width="210" height="180" border=0 value=0> ← (해당부분)
<? } else {?>
<img src="<?=$board_skin_path?>/img/noimg.gif" border=0 value=0>
<? } ?></td>
</tr>
</table>
<table align="center">
<tr>
<td><?=$view[file][0][content]?></td>
</tr>
</table>
<table width="100%" cellpadding="5" >
<tr>
<td align="center"><? if ($view[file][0][file]) {?>
<a href=# <? echo "onClick=\"chgImg( '".$image[0]."','".$image[0]."','".ereg_replace("(\r\n|\n|\r)", "<br>", strip_tags($content) )."' );\"" ?>> <img src="<?=$board_skin_path?>/img/car_p_1.gif" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][1][file]) {?>
<a href=# <? echo "onClick=\"chgImg( '".$image[1]."','".$image[1]."','".ereg_replace("(\r\n|\n|\r)", "<br>", strip_tags($content) )."' );\"" ?>> <img src="<?=$board_skin_path?>/img/car_p_2.gif" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][2][file]) {?>
<a href=# <? echo "onClick=\"chgImg( '".$image[2]."','".$image[2]."','".ereg_replace("(\r\n|\n|\r)", "<br>", strip_tags($content) )."' );\"" ?>> <img src="<?=$board_skin_path?>/img/car_p_3.gif" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][3][file]) {?>
<a href=# <? echo "onClick=\"chgImg( '".$image[3]."','".$image[3]."','".ereg_replace("(\r\n|\n|\r)", "<br>", strip_tags($content) )."' );\"" ?>> <img src="<?=$board_skin_path?>/img/car_p_4.gif" align="absmiddle" border="0"></a>
<? }?>
<? if ($view[file][4][file]) {?>
<a href=# <? echo "onClick=\"chgImg( '".$image[4]."','".$image[4]."','".ereg_replace("(\r\n|\n|\r)", "<br>", strip_tags($content) )."' );\"" ?>> <img src="<?=$board_skin_path?>/img/car_p_5.gif" align="absmiddle" border="0"></a>
<? }?>
</td>
</tr>
</table>
댓글 전체
아래 스크립트를 사용하시면 .... 쬐끔이나마...
function resize_image()
{
var target = document.getElementsByName('target_resize_image[]');
var image_width = parseInt('<?=$board[bo_image_width]?>');
var image_height = 0;
for(i=0; i<target.length; i++) {
// 원래 사이즈를 저장해 놓는다
target[i].tmp_width = target[i].width;
target[i].tmp_height = target[i].height;
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(target[i].width > image_width) {
image_height = parseFloat(target[i].width / target[i].height)
target[i].width = image_width;
target[i].height = parseInt(image_width / image_height);
}
}
}
window.onload = resize_image;
function resize_image()
{
var target = document.getElementsByName('target_resize_image[]');
var image_width = parseInt('<?=$board[bo_image_width]?>');
var image_height = 0;
for(i=0; i<target.length; i++) {
// 원래 사이즈를 저장해 놓는다
target[i].tmp_width = target[i].width;
target[i].tmp_height = target[i].height;
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(target[i].width > image_width) {
image_height = parseFloat(target[i].width / target[i].height)
target[i].width = image_width;
target[i].height = parseInt(image_width / image_height);
}
}
}
window.onload = resize_image;