From 729e7ef6d5951507cc2e8ddcc6bd624ac0320292 Mon Sep 17 00:00:00 2001 From: thisgun Date: Fri, 22 Aug 2014 14:04:44 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8B=A4=EC=9D=8C=20=EC=A3=BC=EC=86=8C=20api?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=EB=90=9C=20=EA=B2=83=20=EC=A0=81=EC=9A=A9?= =?UTF-8?q?=20=EB=B0=8F=20zip.php=20=EA=B4=80=EB=A0=A8=EB=90=9C=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/member_form.php | 3 ++ bbs/register_form.php | 5 ++- bbs/zip.php | 18 ---------- config.php | 6 ++++ js/common.js | 50 +++++++++++++++++++++++++-- js/zip.js | 19 ---------- mobile/skin/member/basic/style.css | 6 +--- mobile/skin/member/basic/zip.skin.php | 30 ---------------- skin/member/basic/style.css | 6 +--- skin/member/basic/zip.skin.php | 29 ---------------- 10 files changed, 62 insertions(+), 110 deletions(-) delete mode 100644 bbs/zip.php delete mode 100644 js/zip.js delete mode 100644 mobile/skin/member/basic/zip.skin.php delete mode 100644 skin/member/basic/zip.skin.php diff --git a/adm/member_form.php b/adm/member_form.php index b132c596f..71b62ec11 100644 --- a/adm/member_form.php +++ b/adm/member_form.php @@ -129,6 +129,9 @@ if ($mb['mb_intercept_date']) $g5['title'] = "차단된 "; else $g5['title'] .= ""; $g5['title'] .= '회원 '.$html_title; include_once('./admin.head.php'); + +// add_javascript('js 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨 +add_javascript(G5_IS_POSTCODE_JS, 0); //다음 주소 js ?>
diff --git a/bbs/register_form.php b/bbs/register_form.php index 4b815617d..7a17e338e 100644 --- a/bbs/register_form.php +++ b/bbs/register_form.php @@ -6,7 +6,6 @@ include_once(G5_LIB_PATH.'/register.lib.php'); // 불법접근을 막도록 토큰생성 $token = md5(uniqid(rand(), true)); set_session("ss_token", $token); - set_session("ss_cert_no", ""); set_session("ss_cert_hash", ""); set_session("ss_cert_type", ""); @@ -116,6 +115,10 @@ $req_nick = !isset($member['mb_nick_date']) || (isset($member['mb_nick_date']) & $required = ($w=='') ? 'required' : ''; $readonly = ($w=='u') ? 'readonly' : ''; +// add_javascript('js 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨 +if ($config['cf_use_addr']) + add_javascript(G5_IS_POSTCODE_JS, 0); //다음 주소 js + include_once($member_skin_path.'/register_form.skin.php'); include_once('./_tail.php'); ?> \ No newline at end of file diff --git a/bbs/zip.php b/bbs/zip.php deleted file mode 100644 index 0e8fb9079..000000000 --- a/bbs/zip.php +++ /dev/null @@ -1,18 +0,0 @@ -'; -} else { //http 통신 - echo ''; -} - -include_once($member_skin_path.'/zip.skin.php'); - -echo ''; - -include_once(G5_PATH.'/tail.sub.php'); -?> diff --git a/config.php b/config.php index 177d022d0..9b9a72444 100644 --- a/config.php +++ b/config.php @@ -185,4 +185,10 @@ define('G5_THUMB_PNG_COMPRESS', 5); 다른 문자를 적어주시면 됩니다. */ define('G5_IP_DISPLAY', '\\1.♡.\\3.\\4'); + +if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') { //https 통신일때 daum 주소 js + define('G5_IS_POSTCODE_JS', ''); +} else { //http 통신일때 daum 주소 js + define('G5_IS_POSTCODE_JS', ''); +} ?> \ No newline at end of file diff --git a/js/common.js b/js/common.js index 8fcb2c09c..4bb289d20 100644 --- a/js/common.js +++ b/js/common.js @@ -377,8 +377,51 @@ var win_homepage = function(href) { * 우편번호 창 **/ var win_zip = function(href) { - var new_win = window.open(href, 'win_zip', 'width=483, height=600, scrollbars=1'); - new_win.focus(); + if(typeof daum === 'undefined'){ + alert("다음 juso.js 파일이 로드되지 않았습니다."); + return false; + } + + var url_to_array = function(url) { + var request = []; + var pairs = url.substring(url.indexOf('?') + 1).split('&'); + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i].split('='); + request[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); + } + return request; + } + + var param = url_to_array(href), + frm_name = param['frm_name'], + frm_addr1 = param['frm_addr1'], + frm_addr2 = param['frm_addr2'], + frm_addr3 = param['frm_addr3'], + frm_zip1 = param['frm_zip1'], + frm_zip2 = param['frm_zip2'], + frm_jibeon = param['frm_jibeon'], + of = document[frm_name]; + + new daum.Postcode({ + oncomplete: function(data) { + // 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분. + // 우편번호와 주소 정보를 해당 필드에 넣고, 커서를 상세주소 필드로 이동한다. + of[frm_zip1].value = data.postcode1; + of[frm_zip2].value = data.postcode2; + of[frm_addr1].value = data.address1; + of[frm_addr2].value = ""; + of[frm_addr3].value = ""; + + if( data.addressType == "R" ){ //도로명이면 + of[frm_addr3].value = data.address2; + } + if(of[frm_jibeon] !== undefined){ + of[frm_jibeon].value = data.addressType; + } + + of[frm_addr2].focus(); + } + }).open(); } /** @@ -463,7 +506,8 @@ $(function(){ return false; }); - $(".win_zip_find").click(function() { + $(".win_zip_find").click(function(e) { + e.preventDefault(); win_zip(this.href); return false; }); diff --git a/js/zip.js b/js/zip.js deleted file mode 100644 index 2e6b50946..000000000 --- a/js/zip.js +++ /dev/null @@ -1,19 +0,0 @@ -$(function() { - var is_chrome = navigator.userAgent.toLowerCase().indexOf("chrome") > -1; - if(!(g5_is_mobile && is_chrome)) { //모바일 크롬에서 먹통되는 현상이 있음 - $("html, body").addClass("daum_juso_body"); - } - var el_id = document.getElementById("daum_juso_wrap"); - new daum.Postcode({ - oncomplete: function(data) { - var address1 = data.address1, - address2 = ""; - if(data.addressType == "R"){ //도로명이면 - address2 = data.address2; - } - put_data2(data.postcode1, data.postcode2, address1, "", address2, data.addressType); - }, - width : "100%", - height : "100%" - }).embed(el_id); -}); \ No newline at end of file diff --git a/mobile/skin/member/basic/style.css b/mobile/skin/member/basic/style.css index b407e0193..ae88a4653 100644 --- a/mobile/skin/member/basic/style.css +++ b/mobile/skin/member/basic/style.css @@ -187,8 +187,4 @@ #profile table {margin-bottom:0} #profile section {padding:10px 20px} #profile h2 {margin:0} -#profile .sv_wrap a {margin:0 0 5px;padding:0;font-weight:bold;line-height:10px} - -/* 우편번호 검색 */ -#daum_juso_wrap{width:100%;height:100%} -html.daum_juso_body ,body.daum_juso_body {height:100%;overflow:hidden} \ No newline at end of file +#profile .sv_wrap a {margin:0 0 5px;padding:0;font-weight:bold;line-height:10px} \ No newline at end of file diff --git a/mobile/skin/member/basic/zip.skin.php b/mobile/skin/member/basic/zip.skin.php deleted file mode 100644 index c187b5f92..000000000 --- a/mobile/skin/member/basic/zip.skin.php +++ /dev/null @@ -1,30 +0,0 @@ -', 0); -?> - -
- - \ No newline at end of file diff --git a/skin/member/basic/style.css b/skin/member/basic/style.css index 4c8b75fbe..87861cf15 100644 --- a/skin/member/basic/style.css +++ b/skin/member/basic/style.css @@ -170,8 +170,4 @@ /* 자기소개 */ #profile table {margin-bottom:0} #profile section {margin:0 auto 20px;padding:20px;width:86%} -#profile h2 {margin:0} - -/* 우편번호 검색 */ -#daum_juso_wrap{position:absolute;left:0;top:0;width:100%;height:100%} -html.daum_juso_body ,body.daum_juso_body {height:100%;overflow:hidden} \ No newline at end of file +#profile h2 {margin:0} \ No newline at end of file diff --git a/skin/member/basic/zip.skin.php b/skin/member/basic/zip.skin.php deleted file mode 100644 index efd80d21e..000000000 --- a/skin/member/basic/zip.skin.php +++ /dev/null @@ -1,29 +0,0 @@ -', 0); -?> - -
- - \ No newline at end of file