™

최글겔러리 이미지 새창띄우기

· 2005-06-08 (수) 11:54:43 · 3369 · 3
겔러리 최근공지에서 보여지는 섬네일 이미지를 클릭했을시
게시판에서 이미지를 클릭한 것과 같은 효과로 원본사이즈의 새창이 뜨게 하고 싶습니다.

워낙 초보자라서 찾기가 힘드네요 도와주세요

---------------------------------------------
<?
echo $list[$i][icon_reply] . " ";
echo "<a href='{$list[$i][href]}'>";
$image = urlencode($list[$i][file][0][file]); // 첫번째 파일이 이미지라면
if (preg_match("/\.(gif|jpg|png)$/i", $image)) {
echo "<img src='$g4[path]/data/file/$bo_table/$image' width='45' height='45' border='0'>"; // 이미지크기
} else
echo "<img src='$board_skin_path/img/no_image.jpg' alt='이미지 없음' width='45' height='45' border='0'>"; ?>
-------------------------------------------------------------
윗부분중 어디를 수정해야 할것 같은데.. 잘 ... ^^
고수님 도와주세요

댓글 3개

흑흑.. ㅠㅠㅠㅠㅠㅠㅠ
영식님 정말 감사 드려요 ㅠㅠㅠ 해내써요..
전 찾다 찾다 못찾아서 질문 썼는데 ㅠㅠㅠ (감격의눈물)

한가지 더 질문드립니다.
새창띄운창의 페이지 이름 <title>그림을 클릭함 창이 닫혀요..</title> 이곳을
띄워진 글의 제목을 넣고 싶을땐 어떻게 해야할까요?
<title> <?=$list[$i][subject]?> </title> 이렇게 하니 그냥 홈페이지 도메인 주소가 나오네요
<title> {$list[$i][subject]} </title> 이렇하면 쓴대로 그냥 나오구요

다시한번 너무너무 감사감사 드립니다..
감사합니다
영식님 답글 정말 감사드려요..
아직 테스트 안해봤는데 테스트 하고 성공여부와 다시한번 감사 말씀 드리겠습니다.
스킨3.xx 에 있던가 기억이 안나지네요.

갤러리 형 리스트 에서 새창으로 원본 이미지 보기 하실때에는

// 리스트 이미지 입니다.
//onclick=\"view('$g4[path]/data/file/$bo_table/$image')\" 이부분을 추가 하여 새창으로 이미지를 나오게 했습니다.
<?
echo $list[$i][icon_reply] . " ";
echo "<a href='#' >";
$image = urlencode($list[$i][file][0][file]); // 첫번째 파일이 이미지라면
if (preg_match("/\.(gif|jpg|png)$/i", $image)) {
echo "<img src='$g4[path]/data/file/$bo_table/$image' width='130' height='190' border='0' onclick=\"view('$g4[path]/data/file/$bo_table/$image')\" alt= 클릭하시면 큰사진이.. >"; // 이미지크기
} else
echo "-"//"<img src='$board_skin_path/img/no_image.jpg' alt='이미지 없음' width='30' height='30' border='0'>";

?>
//******************************************************여기까지 리스트 이미지 *********************

//리스트 상단에서 자바스크립트 원클릭을 했던 스크립트를 호출하는 함수를 써야 하겠지요

<script language="javascript">
<!--
function view(what) {
var imgwin = window.open("",'WIN','scrollbars=no,status=no,toolbar=no,resizable=no,location=no,menu=no,width=10,height=10');
imgwin.focus();
imgwin.document.open();
imgwin.document.write("<html>\n");
imgwin.document.write("<head>\n");
imgwin.document.write("<title>그림을 클릭함 창이 닫혀요..</title>\n"); //오픈창 타이틀 이름 지정하는 부분

imgwin.document.write("<sc"+"ript>\n");
imgwin.document.write("function resize() {\n");
imgwin.document.write("pic = document.il;\n");
//imgwin.document.write("alert(eval(pic).height);\n");
imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n");
imgwin.document.write(" if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height +20; myWidth = eval(pic).width + 0;\n");
imgwin.document.write(" } else { myHeight = eval(pic).height + 9; myWidth = eval(pic).width; }\n");
imgwin.document.write(" clearTimeout();\n");
imgwin.document.write(" var height = screen.height;\n");
imgwin.document.write(" var width = screen.width;\n");
imgwin.document.write(" var leftpos = width / 2 - myWidth / 2;\n");
imgwin.document.write(" var toppos = height / 2 - myHeight / 2; \n");
imgwin.document.write(" self.moveTo(leftpos, toppos);\n");
imgwin.document.write(" self.resizeTo(myWidth, myHeight);\n");
imgwin.document.write("}else setTimeOut(resize(), 100);}\n");
imgwin.document.write("</sc"+"ript>\n");

imgwin.document.write("</head>\n");
imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="black">\n');

imgwin.document.write("<img border=0 src="+what+" xwidth=100 xheight=9 name=il onload='resize();' onclick='window.close();'>\n");
imgwin.document.write("</body>\n");
imgwin.document.close();
}
-->

</script>

// 여기까지 스크립트 쓰시고 테스트 해보세요..

제가 한것은 아니고 검색해서 찾아 본것입니다.. 그럼. 즐플 하시기를.
ps 앗 그리고 이 글을 보고 답변을 곧바로 달아줄려구 하다가. 제 컴이 다운 되는 바람에.ㅜㅜ
늦게 나마 적어 봅니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
05-06-09 조회 3,345
05-06-09 조회 3,054
05-06-09 조회 3,464
05-06-09 조회 3,213
05-06-09 조회 3,403
05-06-08 조회 2,868
05-06-08 조회 2,902
05-06-08 조회 2,577
05-06-08 조회 2,873
05-06-08 조회 3,769
05-06-08 조회 2,650
05-06-08 조회 3,077
05-06-08 조회 3,370
05-06-08 조회 3,439
05-06-08 조회 3,241
05-06-07 조회 3,208
05-06-07 조회 2,925
05-06-07 조회 3,821
05-06-07 조회 3,101
05-06-07 조회 2,539