겔러리 내용에서 이미지 클릭시........... > 그누3질답

그누3질답

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

그누보드 겔러리 내용에서 이미지 클릭시...........

본문

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

댓글 전체

그누폴더/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>

참고로 이전에 다 몇차례씩 올라왔던 자료 입니다.
전체 9,564
그누3질답 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT