From 913696689fa7719aa95e11450ee873ed759447e1 Mon Sep 17 00:00:00 2001 From: chicpro Date: Wed, 20 Feb 2013 16:10:30 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=8C=EC=8B=9C=EA=B8=80=20=EB=B3=B4?= =?UTF-8?q?=EA=B8=B0=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=ED=81=AC=EA=B2=8C=20?= =?UTF-8?q?=EB=B3=B4=EA=B8=B0=20=EA=B8=B0=EB=8A=A5=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/view_image.php | 89 ++++++++++++++++++++++++++++++++++ lib/common.lib.php | 11 +++-- skin/board/basic/view.skin.php | 15 ++++-- 3 files changed, 107 insertions(+), 8 deletions(-) create mode 100644 bbs/view_image.php diff --git a/bbs/view_image.php b/bbs/view_image.php new file mode 100644 index 000000000..bcc110031 --- /dev/null +++ b/bbs/view_image.php @@ -0,0 +1,89 @@ +'; +} else { + alert_close('파일이 존재하지 않습니다.'); +} +?> + + + +
+ + + + \ No newline at end of file diff --git a/lib/common.lib.php b/lib/common.lib.php index f07710a6c..3b70f9303 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1047,10 +1047,13 @@ function view_file_link($file, $width, $height, $content='') else $attr = ''; - if (preg_match("/\.({$config['cf_image_extension']})$/i", $file)) - // 이미지에 속성을 주지 않는 이유는 이미지 클릭시 원본 이미지를 보여주기 위한것임 - // 게시판설정 이미지보다 크다면 스킨의 자바스크립트에서 이미지를 줄여준다 - return "{$content}"; + if (preg_match("/\.({$config['cf_image_extension']})$/i", $file)) { + $img = ''; + $img .= ''.$content.''; + $img .= ''; + + return $img; + } } diff --git a/skin/board/basic/view.skin.php b/skin/board/basic/view.skin.php index 7daa2bf92..fd52ba4aa 100644 --- a/skin/board/basic/view.skin.php +++ b/skin/board/basic/view.skin.php @@ -186,18 +186,25 @@ $(window).load(function() { view_image_resize(); }); +$(function() { + $("a.view_image").click(function() { + window.open(this.href, "large_image", "top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no"); + return false; + }); +}); + function view_image_resize() { - var $img = $('#bo_v_atc img'); - var img_wrap = $('#bo_v_atc').width(); + var $img = $("#bo_v_atc img"); + var img_wrap = $("#bo_v_atc").width(); $img.each(function() { var img_width = $(this).width(); $(this).data("width", img_width); // 원래 이미지 사이즈 if (img_width > img_wrap) { - $(this).addClass('img_fix'); + $(this).addClass("img_fix"); } else if (img_width <= img_wrap && img_width >= $(this).data("width")) { - $(this).removeClass('img_fix'); + $(this).removeClass("img_fix"); } }); }