다음주소 API 기본코드로 변경 및 불필요한 파일 삭제
This commit is contained in:
@ -129,6 +129,9 @@ if ($mb['mb_intercept_date']) $g5['title'] = "차단된 ";
|
|||||||
else $g5['title'] .= "";
|
else $g5['title'] .= "";
|
||||||
$g5['title'] .= '회원 '.$html_title;
|
$g5['title'] .= '회원 '.$html_title;
|
||||||
include_once('./admin.head.php');
|
include_once('./admin.head.php');
|
||||||
|
|
||||||
|
// add_javascript('js 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
||||||
|
add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form name="fmember" id="fmember" action="./member_form_update.php" onsubmit="return fmember_submit(this);" method="post" enctype="multipart/form-data">
|
<form name="fmember" id="fmember" action="./member_form_update.php" onsubmit="return fmember_submit(this);" method="post" enctype="multipart/form-data">
|
||||||
|
|||||||
@ -9,4 +9,5 @@ if ($msg = empty_mb_nick($mb_nick)) die($msg);
|
|||||||
if ($msg = valid_mb_nick($mb_nick)) die($msg);
|
if ($msg = valid_mb_nick($mb_nick)) die($msg);
|
||||||
if ($msg = count_mb_nick($mb_nick)) die($msg);
|
if ($msg = count_mb_nick($mb_nick)) die($msg);
|
||||||
if ($msg = exist_mb_nick($mb_nick, $mb_id)) die($msg);
|
if ($msg = exist_mb_nick($mb_nick, $mb_id)) die($msg);
|
||||||
|
if ($msg = reserve_mb_nick($mb_nick)) die($msg);
|
||||||
?>
|
?>
|
||||||
@ -6,7 +6,6 @@ include_once(G5_LIB_PATH.'/register.lib.php');
|
|||||||
// 불법접근을 막도록 토큰생성
|
// 불법접근을 막도록 토큰생성
|
||||||
$token = md5(uniqid(rand(), true));
|
$token = md5(uniqid(rand(), true));
|
||||||
set_session("ss_token", $token);
|
set_session("ss_token", $token);
|
||||||
|
|
||||||
set_session("ss_cert_no", "");
|
set_session("ss_cert_no", "");
|
||||||
set_session("ss_cert_hash", "");
|
set_session("ss_cert_hash", "");
|
||||||
set_session("ss_cert_type", "");
|
set_session("ss_cert_type", "");
|
||||||
@ -116,6 +115,10 @@ $req_nick = !isset($member['mb_nick_date']) || (isset($member['mb_nick_date']) &
|
|||||||
$required = ($w=='') ? 'required' : '';
|
$required = ($w=='') ? 'required' : '';
|
||||||
$readonly = ($w=='u') ? 'readonly' : '';
|
$readonly = ($w=='u') ? 'readonly' : '';
|
||||||
|
|
||||||
|
// add_javascript('js 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
||||||
|
if ($config['cf_use_addr'])
|
||||||
|
add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
|
||||||
|
|
||||||
include_once($member_skin_path.'/register_form.skin.php');
|
include_once($member_skin_path.'/register_form.skin.php');
|
||||||
include_once('./_tail.php');
|
include_once('./_tail.php');
|
||||||
?>
|
?>
|
||||||
18
bbs/zip.php
18
bbs/zip.php
@ -1,18 +0,0 @@
|
|||||||
<?php
|
|
||||||
include_once('./_common.php');
|
|
||||||
|
|
||||||
$g5['title'] = '우편번호 검색';
|
|
||||||
include_once(G5_PATH.'/head.sub.php');
|
|
||||||
|
|
||||||
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') { //https 통신
|
|
||||||
echo '<script src="https://spi.maps.daum.net/imap/map_js_init/postcode.js"></script>';
|
|
||||||
} else { //http 통신
|
|
||||||
echo '<script src="http://dmaps.daum.net/map_js_init/postcode.js"></script>';
|
|
||||||
}
|
|
||||||
|
|
||||||
include_once($member_skin_path.'/zip.skin.php');
|
|
||||||
|
|
||||||
echo '<script src="'.G5_JS_URL.'/zip.js"></script>';
|
|
||||||
|
|
||||||
include_once(G5_PATH.'/tail.sub.php');
|
|
||||||
?>
|
|
||||||
@ -185,4 +185,10 @@ define('G5_THUMB_PNG_COMPRESS', 5);
|
|||||||
다른 문자를 적어주시면 됩니다.
|
다른 문자를 적어주시면 됩니다.
|
||||||
*/
|
*/
|
||||||
define('G5_IP_DISPLAY', '\\1.♡.\\3.\\4');
|
define('G5_IP_DISPLAY', '\\1.♡.\\3.\\4');
|
||||||
|
|
||||||
|
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') { //https 통신일때 daum 주소 js
|
||||||
|
define('G5_POSTCODE_JS', '<script src="https://spi.maps.daum.net/imap/map_js_init/postcode.js"></script>');
|
||||||
|
} else { //http 통신일때 daum 주소 js
|
||||||
|
define('G5_POSTCODE_JS', '<script src="http://dmaps.daum.net/map_js_init/postcode.js"></script>');
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
50
js/common.js
50
js/common.js
@ -377,8 +377,51 @@ var win_homepage = function(href) {
|
|||||||
* 우편번호 창
|
* 우편번호 창
|
||||||
**/
|
**/
|
||||||
var win_zip = function(href) {
|
var win_zip = function(href) {
|
||||||
var new_win = window.open(href, 'win_zip', 'width=483, height=600, scrollbars=1');
|
if(typeof daum === 'undefined'){
|
||||||
new_win.focus();
|
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;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".win_zip_find").click(function() {
|
$(".win_zip_find").click(function(e) {
|
||||||
|
e.preventDefault();
|
||||||
win_zip(this.href);
|
win_zip(this.href);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|||||||
19
js/zip.js
19
js/zip.js
@ -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);
|
|
||||||
});
|
|
||||||
@ -2216,8 +2216,17 @@ function add_stylesheet($stylesheet, $order=0)
|
|||||||
$html_process->merge_stylesheet($stylesheet, $order);
|
$html_process->merge_stylesheet($stylesheet, $order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function add_javascript($javascript, $order=0)
|
||||||
|
{
|
||||||
|
global $html_process;
|
||||||
|
|
||||||
|
if(trim($javascript))
|
||||||
|
$html_process->merge_javascript($javascript, $order);
|
||||||
|
}
|
||||||
|
|
||||||
class html_process {
|
class html_process {
|
||||||
protected $css = array();
|
protected $css = array();
|
||||||
|
protected $js = array();
|
||||||
|
|
||||||
function merge_stylesheet($stylesheet, $order)
|
function merge_stylesheet($stylesheet, $order)
|
||||||
{
|
{
|
||||||
@ -2235,6 +2244,22 @@ class html_process {
|
|||||||
$this->css[] = array($order, $stylesheet);
|
$this->css[] = array($order, $stylesheet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function merge_javascript($javascript, $order)
|
||||||
|
{
|
||||||
|
$scripts = $this->js;
|
||||||
|
$is_merge = true;
|
||||||
|
|
||||||
|
foreach($scripts as $script) {
|
||||||
|
if($script[1] == $javascript) {
|
||||||
|
$is_merge = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($is_merge)
|
||||||
|
$this->js[] = array($order, $javascript);
|
||||||
|
}
|
||||||
|
|
||||||
function run()
|
function run()
|
||||||
{
|
{
|
||||||
global $config, $g5, $member;
|
global $config, $g5, $member;
|
||||||
@ -2281,12 +2306,46 @@ class html_process {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$javascript = '';
|
||||||
|
$scripts = $this->js;
|
||||||
|
$php_eol = '';
|
||||||
|
|
||||||
|
unset($order);
|
||||||
|
unset($index);
|
||||||
|
|
||||||
|
if(!empty($scripts)) {
|
||||||
|
foreach ($scripts as $key => $row) {
|
||||||
|
$order[$key] = $row[0];
|
||||||
|
$index[$key] = $key;
|
||||||
|
$script[$key] = $row[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
array_multisort($order, SORT_ASC, $index, SORT_ASC, $scripts);
|
||||||
|
|
||||||
|
foreach($scripts as $js) {
|
||||||
|
if(!trim($js[1]))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
$javascript .= $php_eol.$js[1];
|
||||||
|
$php_eol = PHP_EOL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
</title>
|
</title>
|
||||||
<link rel="stylesheet" href="default.css">
|
<link rel="stylesheet" href="default.css">
|
||||||
밑으로 스킨의 스타일시트가 위치하도록 하게 한다.
|
밑으로 스킨의 스타일시트가 위치하도록 하게 한다.
|
||||||
*/
|
*/
|
||||||
return preg_replace('#(</title>[^<]*<link[^>]+>)#', "$1$stylesheet", $buffer);
|
$buffer = preg_replace('#(</title>[^<]*<link[^>]+>)#', "$1$stylesheet", $buffer);
|
||||||
|
|
||||||
|
/*
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
전에 스킨의 자바스크립트가 위치하도록 하게 한다.
|
||||||
|
*/
|
||||||
|
$buffer = preg_replace('#(</head>[^<]*<body[^>]*>)#', "$javascript\n$1", $buffer);
|
||||||
|
|
||||||
|
return $buffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -188,7 +188,3 @@
|
|||||||
#profile section {padding:10px 20px}
|
#profile section {padding:10px 20px}
|
||||||
#profile h2 {margin:0}
|
#profile h2 {margin:0}
|
||||||
#profile .sv_wrap a {margin:0 0 5px;padding:0;font-weight:bold;line-height:10px}
|
#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}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
|
||||||
|
|
||||||
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
|
||||||
add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);
|
|
||||||
?>
|
|
||||||
|
|
||||||
<div id="daum_juso_wrap" class="daum_juso_wrap"></div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
|
|
||||||
{
|
|
||||||
var of = window.opener.document.<?php echo $frm_name; ?>;
|
|
||||||
|
|
||||||
of.<?php echo $frm_zip1; ?>.value = zip1;
|
|
||||||
of.<?php echo $frm_zip2; ?>.value = zip2;
|
|
||||||
of.<?php echo $frm_addr1; ?>.value = addr1;
|
|
||||||
of.<?php echo $frm_addr2; ?>.value = addr2;
|
|
||||||
of.<?php echo $frm_addr3; ?>.value = addr3;
|
|
||||||
|
|
||||||
if( jibeon ){
|
|
||||||
if(of.<?php echo $frm_jibeon; ?> !== undefined){
|
|
||||||
of.<?php echo $frm_jibeon; ?>.value = jibeon;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
of.<?php echo $frm_addr3; ?>.focus(); //안드로이드 4.3 기본브라우져에서 가끔 안나오는 현상이 있어서 일부러 적용
|
|
||||||
of.<?php echo $frm_addr2; ?>.focus();
|
|
||||||
window.close();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@ -171,7 +171,3 @@
|
|||||||
#profile table {margin-bottom:0}
|
#profile table {margin-bottom:0}
|
||||||
#profile section {margin:0 auto 20px;padding:20px;width:86%}
|
#profile section {margin:0 auto 20px;padding:20px;width:86%}
|
||||||
#profile h2 {margin:0}
|
#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}
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
<?php
|
|
||||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
|
||||||
|
|
||||||
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
|
||||||
add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);
|
|
||||||
?>
|
|
||||||
|
|
||||||
<div id="daum_juso_wrap" class="daum_juso_wrap"></div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
|
|
||||||
{
|
|
||||||
var of = window.opener.document.<?php echo $frm_name; ?>;
|
|
||||||
|
|
||||||
of.<?php echo $frm_zip1; ?>.value = zip1;
|
|
||||||
of.<?php echo $frm_zip2; ?>.value = zip2;
|
|
||||||
of.<?php echo $frm_addr1; ?>.value = addr1;
|
|
||||||
of.<?php echo $frm_addr2; ?>.value = addr2;
|
|
||||||
of.<?php echo $frm_addr3; ?>.value = addr3;
|
|
||||||
|
|
||||||
if( jibeon ){
|
|
||||||
if(of.<?php echo $frm_jibeon; ?> !== undefined){
|
|
||||||
of.<?php echo $frm_jibeon; ?>.value = jibeon;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
of.<?php echo $frm_addr2; ?>.focus();
|
|
||||||
window.close();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
Reference in New Issue
Block a user