겔러리 내용에서 이미지 클릭시...........

겔러리 내용에서 이미지 클릭시 새창으로 띄우고 싶은데
어떻게 해야 하는지요..........
몇일째 고민 중인데 않되네요.......
고수님들 꼭 부탁드립니다...
|

댓글 1개

그누폴더/lib/gnuboard.lib.php 의 하단부의

[수정전]

$width = $size[0];
$height = $size[1];

if (preg_match($cfg[image_extension], $file))
return "<center><img src='./data/file/$board[bo_table]/$file' width='$width' height='$height' border=0></center><p>";
else if (preg_match($cfg[flash_extension], $file))
return "<embed src='./data/file/$board[bo_table]/$file' width='$width' height='$height'></embed><p>";
else if (preg_match($cfg[movie_extension], $file))
return "<embed src='./data/file/$board[bo_table]/$file'></embed><p>";
}


[수정후1]

$width = $size[0];
$height = $size[1];

if (preg_match($cfg[image_extension], $file))
return "<center><a href='javascript:void(0);' onclick=\"var win = window.open('', 'img', 'width=$source_width,height=$source_height'); win.document.write('<img src=./data/file/$board[bo_table]/$file onclick=window.close() style=position:absolute;top:0pt;left:0pt; border=0>');\"><img src='./data/file/$board[bo_table]/$file' width='$width' height='$height' border=0 alt='새창열기'></a></center><p>";
else if (preg_match($cfg[flash_extension], $file))
return "<embed src='./data/file/$board[bo_table]/$file' width='$width' height='$height'></embed><p>";
else if (preg_match($cfg[movie_extension], $file))
return "<embed src='./data/file/$board[bo_table]/$file'></embed><p>";
}


[수정후2]

$width = $size[0];
$height = $size[1];

if (preg_match($cfg[image_extension], $file))
return "<a href='./data/file/$board[bo_table]/$file' width='$width' height='$height' border='0' target='_blank'><img src='./data/file/$board[bo_table]/$file' width='$width' height='$height' border='0' alt='새창열기'><p></a>";
else if (preg_match($cfg[flash_extension], $file))
return "<embed src='./data/file/$board[bo_table]/$file' width='$width' height='$height'></embed><p>";
else if (preg_match($cfg[movie_extension], $file))
return "<embed src='./data/file/$board[bo_table]/$file'></embed><p>";
}


원본파일 손대기 싫으시면 해당 스킨의 gbview.skin.php 의

보여지는 부분을 아래것으로 대체 합니다.

수정전:
?>
<?
for ($i=1; $i<=$cfg[file_count]; $i++) {
if ($file[$i][view]) { echo $file[$i][view]; }
}
?>

수정후:
<script language="JavaScript">
var imgObj = new Image();
function showImgWin(imgName) {
imgObj.src = imgName;
setTimeout("createImgWin(imgObj)", 100);
}
function createImgWin(imgObj) {
if (! imgObj.complete) {
setTimeout("createImgWin(imgObj)", 100);
return;
}
imageWin = window.open("", "imageWin",
"width=" + imgObj.width + ",height=" + imgObj.height);
imageWin.document.write("<html><body style='margin:0'>");
imageWin.document.write("<img src='" + imgObj.src + "'>");
imageWin.document.write("</body><html>");
imageWin.document.title = imgObj.src;
}
</script>

<a href="javascript:showImgWin('<? for ($i=1; $i<=$cfg[file_count]; $i++) { if ($file[$i][href]) { echo $file[$i][href];}}?>')"><? for ($i=1; $i<=$cfg[file_count]; $i++) { if ($file[$i][view]) { echo $file[$i][view]; }}?></a>

참고로 이전에 다 몇차례씩 올라왔던 자료 입니다.
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누3질답

+
제목 글쓴이 날짜 조회
21년 전 조회 347
21년 전 조회 305
21년 전 조회 417
21년 전 조회 287
21년 전 조회 439
21년 전 조회 454
21년 전 조회 423
21년 전 조회 542
김진혁
21년 전 조회 1,882
21년 전 조회 459
21년 전 조회 335
김진혁
21년 전 조회 361
21년 전 조회 307
21년 전 조회 530
김진혁
21년 전 조회 533
김진혁
21년 전 조회 398
21년 전 조회 410
21년 전 조회 363
21년 전 조회 437
21년 전 조회 336
🐛 버그신고