다음 주소 API 적용 및 기타 수정

This commit is contained in:
chicpro
2014-08-19 14:52:47 +09:00
parent 43fae4ed50
commit 59468d1312
18 changed files with 200 additions and 463 deletions

View File

@ -9,7 +9,7 @@ $token = get_token();
if ($w == '')
{
$required_mb_id = 'required';
$required_mb_id_class = 'required minlength=3 alnum_';
$required_mb_id_class = 'required alnum_';
$required_mb_password = 'required';
$sound_only = '<strong class="sound_only">필수</strong>';
@ -153,7 +153,7 @@ include_once('./admin.head.php');
<tr>
<th scope="row"><label for="mb_id">아이디<?php echo $sound_only ?></label></th>
<td>
<input type="text" name="mb_id" value="<?php echo $mb['mb_id'] ?>" id="mb_id" <?php echo $required_mb_id ?> class="frm_input <?php echo $required_mb_id_class ?>" size="15" maxlength="20" >
<input type="text" name="mb_id" value="<?php echo $mb['mb_id'] ?>" id="mb_id" <?php echo $required_mb_id ?> class="frm_input <?php echo $required_mb_id_class ?>" size="15" minlength="3" maxlength="20">
<?php if ($w=='u'){ ?><a href="./boardgroupmember_form.php?mb_id=<?php echo $mb['mb_id'] ?>">접근가능그룹보기</a><?php } ?>
</td>
<th scope="row"><label for="mb_password">비밀번호<?php echo $sound_only ?></label></th>
@ -161,9 +161,9 @@ include_once('./admin.head.php');
</tr>
<tr>
<th scope="row"><label for="mb_name">이름(실명)<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="mb_name" value="<?php echo $mb['mb_name'] ?>" id="mb_name" required class="required frm_input minlength=2" size="15" maxlength="20"></td>
<td><input type="text" name="mb_name" value="<?php echo $mb['mb_name'] ?>" id="mb_name" required class="required frm_input" size="15" minlength="2" maxlength="20"></td>
<th scope="row"><label for="mb_nick">닉네임<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="mb_nick" value="<?php echo $mb['mb_nick'] ?>" id="mb_nick" required class="required frm_input minlength=2" size="15" maxlength="20"></td>
<td><input type="text" name="mb_nick" value="<?php echo $mb['mb_nick'] ?>" id="mb_nick" required class="required frm_input" size="15" minlength="2" maxlength="20"></td>
</tr>
<tr>
<th scope="row"><label for="mb_level">회원 권한</label></th>
@ -219,11 +219,11 @@ include_once('./admin.head.php');
<input type="text" name="mb_addr1" value="<?php echo $mb['mb_addr1'] ?>" id="mb_addr1" class="frm_input readonly" size="60">
<label for="mb_addr1">기본주소</label><br>
<input type="text" name="mb_addr2" value="<?php echo $mb['mb_addr2'] ?>" id="mb_addr2" class="frm_input" size="60">
<label for="mb_addr2">상세주소</label><br>
<label for="mb_addr2">상세주소</label>
<br>
<input type="text" name="mb_addr3" value="<?php echo $mb['mb_addr3'] ?>" id="mb_addr3" class="frm_input" size="60">
<label for="mb_addr3">참고항목</label>
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $mb['mb_addr_jibeon']; ?>"><br>
<span id="mb_addr_jibeon">지번주소 : <?php echo $mb['mb_addr_jibeon']; ?></span>
</td>
</tr>
<tr>

View File

@ -186,7 +186,7 @@ $colspan = 16;
if ($intercept_title == '')
$intercept_title = '차단하기';
$address = $row['mb_zip1'] ? print_address($row['mb_addr1'], $row['mb_addr2'], $row['mb_addr3']) : '';
$address = $row['mb_zip1'] ? print_address($row['mb_addr1'], $row['mb_addr2'], $row['mb_addr3'], $row['mb_addr_jibeon']) : '';
$bg = 'bg'.($i%2);

View File

@ -28,16 +28,19 @@ if (!$mb['mb_id'])
else if (is_admin($mb['mb_id']))
alert('관리자 아이디는 접근 불가합니다.');
// 난수
srand(time());
// 임시비밀번호
$change_password = rand(100000, 999999);
$mb_lost_certify = sql_password($change_password);
$mb_datetime = sql_password($mb['mb_datetime']);
$sql = " update {$g5['member_table']} set mb_lost_certify = '$mb_lost_certify' where mb_id = '{$mb['mb_id']}' ";
// 어떠한 회원정보도 포함되지 않은 일회용 난수를 생성하여 인증에 사용
$mb_nonce = bin2hex(pack('V*', rand(), rand(), rand(), rand()));
// 임시비밀번호와 난수를 mb_lost_certify 필드에 저장
$sql = " update {$g5['member_table']} set mb_lost_certify = '$mb_nonce $mb_lost_certify' where mb_id = '{$mb['mb_id']}' ";
sql_query($sql);
$href = G5_BBS_URL.'/password_lost_certify.php?mb_no='.$mb['mb_no'].'&amp;mb_datetime='.$mb_datetime.'&amp;mb_lost_certify='.$mb_lost_certify;
// 인증 링크 생성
$href = G5_BBS_URL.'/password_lost_certify.php?mb_no='.$mb['mb_no'].'&amp;mb_nonce='.$mb_nonce;
$subject = "[".$config['cf_title']."] 요청하신 회원정보 찾기 안내 메일입니다.";

View File

@ -4,21 +4,21 @@ include_once('./_common.php');
// 오류시 공히 Error 라고 처리하는 것은 회원정보가 있는지? 비밀번호가 틀린지? 를 알아보려는 해킹에 대비한것
$mb_no = trim($_GET['mb_no']);
$mb_datetime = trim($_GET['mb_datetime']);
$mb_lost_certify = trim($_GET['mb_lost_certify']);
$mb_nonce = trim($_GET['mb_nonce']);
// 회원아이디가 아닌 회원고유번호로 회원정보를 구한다.
$sql = " select mb_id, mb_datetime, mb_lost_certify from {$g5['member_table']} where mb_no = '$mb_no' ";
$sql = " select mb_id, mb_lost_certify from {$g5['member_table']} where mb_no = '$mb_no' ";
$mb = sql_fetch($sql);
if (!trim($mb['mb_lost_certify']))
if (strlen($mb['mb_lost_certify']) < 33)
die("Error");
// 인증 링크는 한번만 처리가 되게 한다.
sql_query(" update {$g5['member_table']} set mb_lost_certify = '' where mb_no = '$mb_no' ");
// 변경될 비밀번호가 넘어와야하고 저장된 변경비밀번호를 md5 로 변환하여 같으면 정상
if ($mb_lost_certify && $mb_datetime === sql_password($mb['mb_datetime']) && $mb_lost_certify === $mb['mb_lost_certify']) {
sql_query(" update {$g5['member_table']} set mb_password = '{$mb['mb_lost_certify']}' where mb_no = '$mb_no' ");
// 인증을 위한 난수가 제대로 넘어온 경우 임시비밀번호를 실제 비밀번호로 바꿔준다.
if ($mb_nonce === substr($mb['mb_lost_certify'], 0, 32)) {
$new_password_hash = substr($mb['mb_lost_certify'], 33);
sql_query(" update {$g5['member_table']} set mb_password = '$new_password_hash' where mb_no = '$mb_no' ");
alert('비밀번호가 변경됐습니다.\\n\\n회원아이디와 변경된 비밀번호로 로그인 하시기 바랍니다.', G5_BBS_URL.'/login.php');
}
else {

View File

@ -110,6 +110,13 @@ if ($w == '' || $w == 'u') {
if ($msg = exist_mb_email($mb_email, $mb_id)) alert($msg, "", true, true);
}
$mb_zip1 = preg_replace('/[^0-9]/', '', $mb_zip1);
$mb_zip2 = preg_replace('/[^0-9]/', '', $mb_zip2);
$mb_addr1 = clean_xss_tags($mb_addr1);
$mb_addr2 = clean_xss_tags($mb_addr2);
$mb_addr3 = clean_xss_tags($mb_addr3);
$mb_addr_jibeon = preg_match("/^(N|R)$/", $mb_addr_jibeon) ? $mb_addr_jibeon : '';
// 사용자 코드 실행
@include_once($member_skin_path.'/register_form_update.head.skin.php');

View File

@ -1,72 +1,15 @@
<?php
include_once('./_common.php');
// 메모리를 많이 잡아먹어서 아래의 코드로 대체
//ini_set('memory_limit', '20M');
//$zipfile = file("./zip.db");
/*
$zipfile = array();
$fp = fopen('./zip.db', 'r');
while(!feof($fp)) {
$zipfile[] = fgets($fp, 4096);
}
fclose($fp);
$search_count = 0;
if ($addr1)
{
while ($zipcode = each($zipfile))
{
if(strstr(substr($zipcode[1],9,512), $addr1))
{
$list[$search_count][zip1] = substr($zipcode[1],0,3);
$list[$search_count][zip2] = substr($zipcode[1],4,3);
$addr = explode(" ", substr($zipcode[1],8));
if ($addr[sizeof($addr)-1])
{
$list[$search_count][addr] = str_replace($addr[sizeof($addr)-1], "", substr($zipcode[1],8));
$list[$search_count][bunji] = trim($addr[sizeof($addr)-1]);
}
else
$list[$search_count][addr] = substr($zipcode[1],8);
$list[$search_count][encode_addr] = urlencode($list[$search_count][addr]);
$search_count++;
}
}
if (!$search_count) alert('찾으시는 주소가 없습니다.');
}
*/
/* 기존의 DB에서 불러오는 방식
if ($addr1)
{
//$sql = " select * from $g5[zip_table] where zp_dong like '%$addr1%' order by zp_id ";
$sql = " select * from $g5[zip_table] where zp_dong like '%$addr1%' order by zp_sido, zp_gugun, zp_dong ";
$result = sql_query($sql);
$search_count = 0;
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$list[$i][zip1] = substr($row[zp_code], 0, 3);
$list[$i][zip2] = substr($row[zp_code], 3, 3);
$list[$i][addr] = "$row[zp_sido] $row[zp_gugun] $row[zp_dong]";
$list[$i][bunji] = $row[zp_bunji];
$list[$i][encode_addr] = urlencode($list[$i][addr]);
$search_count++;
}
if (!$search_count)
alert("찾으시는 주소가 없습니다.");
}
*/
$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');
include_once(G5_PATH.'/tail.sub.php');

View File

@ -364,6 +364,11 @@ if (isset($_REQUEST['gr_id'])) {
if ($_SESSION['ss_mb_id']) { // 로그인중이라면
$member = get_member($_SESSION['ss_mb_id']);
// 차단된 회원이면 ss_mb_id 초기화
if($member['mb_intercept_date'] && $member['mb_intercept_date'] <= date("Ymd", G5_SERVER_TIME)) {
set_session('ss_mb_id', '');
$member = array();
} else {
// 오늘 처음 로그인 이라면
if (substr($member['mb_today_login'], 0, 10) != G5_TIME_YMD) {
// 첫 로그인 포인트 지급
@ -374,7 +379,7 @@ if ($_SESSION['ss_mb_id']) { // 로그인중이라면
$sql = " update {$g5['member_table']} set mb_today_login = '".G5_TIME_YMDHIS."', mb_login_ip = '{$_SERVER['REMOTE_ADDR']}' where mb_id = '{$member['mb_id']}' ";
sql_query($sql);
}
}
} else {
// 자동로그인 ---------------------------------------
// 회원아이디가 쿠키에 저장되어 있다면 (3.27)

View File

@ -175,6 +175,9 @@ define('G5_LINK_COUNT', 2);
// 썸네일 jpg Quality 설정
define('G5_THUMB_JPG_QUALITY', 90);
// 썸네일 png Compress 설정
define('G5_THUMB_PNG_COMPRESS', 5);
// ip 숨김방법 설정
/* 123.456.789.012 ip의 숨김 방법을 변경하는 방법은
\\1 은 123, \\2는 456, \\3은 789, \\4는 012에 각각 대응되므로

View File

@ -377,7 +377,7 @@ var win_homepage = function(href) {
* 우편번호 창
**/
var win_zip = function(href) {
var new_win = window.open(href, 'win_zip', 'width=616, height=760, scrollbars=1');
var new_win = window.open(href, 'win_zip', 'width=483, height=600, scrollbars=1');
new_win.focus();
}

View File

@ -204,15 +204,15 @@ function wrestAlNum_(fld)
}
// 최소 길이 검사
function wrestMinLength(fld, css)
function wrestMinLength(fld)
{
if (!wrestTrim(fld)) return;
var str = css.split('='); // minlength=?? <-- str[1]
var minlength = fld.getAttribute("minlength");
if (wrestFld == null) {
if (fld.value.length < parseInt(str[1])) {
wrestMsg = wrestItemname(fld) + " : 최소 "+str[1]+"글자 이상 입력하세요.\n";
if (fld.value.length < parseInt(minlength)) {
wrestMsg = wrestItemname(fld) + " : 최소 "+minlength+"글자 이상 입력하세요.\n";
wrestFld = fld;
}
}
@ -282,6 +282,10 @@ function wrestSubmit()
wrestRequired(el);
}
if (el.getAttribute("minlength") != null) {
wrestMinLength(el);
}
var array_css = el.className.split(" "); // class 를 공백으로 나눔
el.style.backgroundColor = wrestFldDefaultColor;
@ -305,10 +309,7 @@ function wrestSubmit()
case "telnum" : wrestTelNum(el); break; // 김선용 2006.3 - 전화번호 형식 검사
case "imgext" : wrestImgExt(el); break;
default :
// css 가 minlength= 로 시작한다면 = 뒤의 숫자는 최소길이값
if (/^minlength\=/.test(css)) {
wrestMinLength(el, css); break;
} else if (/^extension\=/.test(css)) {
if (/^extension\=/.test(css)) {
wrestExtension(el, css); break;
}
} // switch (css)

View File

@ -2579,19 +2579,23 @@ function module_exec_check($exe, $type)
return $error;
}
// 도로명주소 출력
// 주소출력
function print_address($addr1, $addr2, $addr3)
function print_address($addr1, $addr2, $addr3, $addr4)
{
$address = trim($addr1);
$addr2 = trim($addr2);
$addr3 = trim($addr3);
if($addr4 == 'N') {
if($addr2)
$address .= ' '.$addr2;
} else {
if($addr2)
$address .= ', '.$addr2;
if($addr3)
$address .= ' '.$addr3;
}
return $address;
}

View File

@ -4,7 +4,7 @@ if (!defined('_GNUBOARD_')) exit;
@ini_set('memory_limit', '512M');
// 게시글리스트 썸네일 생성
function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create=false, $is_crop=true, $crop_mode='center', $is_sharpen=true, $um_value='80/0.5/3')
function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create=false, $is_crop=true, $crop_mode='center', $is_sharpen=false, $um_value='80/0.5/3')
{
global $g5, $config;
$filename = $alt = "";
@ -184,15 +184,13 @@ function get_view_thumbnail($contents, $thumb_width=0)
return $contents;
}
function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_height, $is_create, $is_crop=false, $crop_mode='center', $is_sharpen=true, $um_value='80/0.5/3')
function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_height, $is_create, $is_crop=false, $crop_mode='center', $is_sharpen=false, $um_value='80/0.5/3')
{
global $g5;
if(!$thumb_width && !$thumb_height)
return;
$thumb_filename = preg_replace("/\.[^\.]+$/i", "", $filename); // 확장자제거
$thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.jpg";
$source_file = "$source_path/$filename";
if(!is_file($source_file)) // 원본 파일이 없다면
@ -217,6 +215,11 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
return basename($source_file);
}
$ext = array(1 => 'gif', 2 => 'jpg', 3 => 'png');
$thumb_filename = preg_replace("/\.[^\.]+$/i", "", $filename); // 확장자제거
$thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.".$ext[$size[2]];
$thumb_time = @filemtime($thumb_file);
$source_time = @filemtime($source_file);
@ -266,6 +269,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
}
} else if ($size[2] == 3) {
$src = imagecreatefrompng($source_file);
imagealphablending($src, true);
} else {
return;
}
@ -324,6 +328,11 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
}
$dst = imagecreatetruecolor($dst_w, $dst_h);
if($size[2] == 3) {
imagealphablending($dst, false);
imagesavealpha($dst, true);
}
} else {
$dst = imagecreatetruecolor($dst_w, $dst_h);
@ -345,9 +354,16 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
}
}
if($size[2] == 3) {
$bgcolor = imagecolorallocatealpha($dst, 0, 0, 0, 127);
imagefill($dst, 0, 0, $bgcolor);
imagealphablending($dst, false);
imagesavealpha($dst, true);
} else {
$bgcolor = imagecolorallocate($dst, 255, 255, 255); // 배경색
imagefill($dst, 0, 0, $bgcolor);
}
}
imagecopyresampled($dst, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
@ -357,12 +373,24 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
UnsharpMask($dst, $val[0], $val[1], $val[2]);
}
if($size[2] == 1) {
imagegif($dst, $thumb_file);
} else if($size[2] == 3) {
if(!defined('G5_THUMB_PNG_COMPRESS'))
$png_compress = 5;
else
$png_compress = G5_THUMB_PNG_COMPRESS;
imagepng($dst, $thumb_file, $png_compress);
} else {
if(!defined('G5_THUMB_JPG_QUALITY'))
$jpg_quality = 90;
else
$jpg_quality = G5_THUMB_JPG_QUALITY;
imagejpeg($dst, $thumb_file, $jpg_quality);
}
chmod($thumb_file, G5_FILE_PERMISSION); // 추후 삭제를 위하여 파일모드 변경
imagedestroy($src);

View File

@ -31,17 +31,17 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<th scope="row"><label for="reg_mb_id">아이디<strong class="sound_only">필수</strong></label></th>
<td>
<span class="frm_info">영문자, 숫자, _ 만 입력 가능. 최소 3자이상 입력하세요.</span>
<input type="text" name="mb_id" value="<?php echo $member['mb_id'] ?>" id="reg_mb_id" class="frm_input minlength=3 <?php echo $required ?> <?php echo $readonly ?>" maxlength="20" <?php echo $required ?> <?php echo $readonly ?>>
<input type="text" name="mb_id" value="<?php echo $member['mb_id'] ?>" id="reg_mb_id" class="frm_input <?php echo $required ?> <?php echo $readonly ?>" minlength="3" maxlength="20" <?php echo $required ?> <?php echo $readonly ?>>
<span id="msg_mb_id"></span>
</td>
</tr>
<tr>
<th scope="row"><label for="reg_mb_password">비밀번호<strong class="sound_only">필수</strong></label></th>
<td><input type="password" name="mb_password" id="reg_mb_password" class="frm_input minlength=3 <?php echo $required ?>" maxlength="20" <?php echo $required ?>></td>
<td><input type="password" name="mb_password" id="reg_mb_password" class="frm_input <?php echo $required ?>" minlength="3" maxlength="20" <?php echo $required ?>></td>
</tr>
<tr>
<th scope="row"><label for="reg_mb_password_re">비밀번호 확인<strong class="sound_only">필수</strong></label></th>
<td><input type="password" name="mb_password_re" id="reg_mb_password_re" class="frm_input minlength=3 <?php echo $required ?>" maxlength="20" <?php echo $required ?>></td>
<td><input type="password" name="mb_password_re" id="reg_mb_password_re" class="frm_input <?php echo $required ?>" minlength="3" maxlength="20" <?php echo $required ?>></td>
</tr>
</table>
</div>
@ -150,11 +150,11 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<label for="reg_mb_addr1" class="sound_only">주소<?php echo $config['cf_req_addr']?'<strong class="sound_only"> 필수</strong>':''; ?></label>
<input type="text" name="mb_addr1" value="<?php echo $member['mb_addr1'] ?>" id="reg_mb_addr1" <?php echo $config['cf_req_addr']?"required":""; ?> class="frm_input frm_address <?php echo $config['cf_req_addr']?"required":""; ?>" size="50"><br>
<label for="reg_mb_addr2" class="sound_only">상세주소</label>
<input type="text" name="mb_addr2" value="<?php echo $member['mb_addr2'] ?>" id="reg_mb_addr2" class="frm_input frm_address" size="50"><br>
<input type="text" name="mb_addr2" value="<?php echo $member['mb_addr2'] ?>" id="reg_mb_addr2" class="frm_input frm_address" size="50">
<br>
<label for="reg_mb_addr3" class="sound_only">참고항목</label>
<input type="text" name="mb_addr3" value="<?php echo $member['mb_addr3'] ?>" id="reg_mb_addr3" readonly="readonly" class="frm_input frm_address" size="50">
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $member['mb_addr_jibeon']; ?>"><br>
<span id="mb_addr_jibeon"><?php echo ($member['mb_addr_jibeon'] ? '지번주소 : '.$member['mb_addr_jibeon'] : ''); ?></span>
<input type="text" name="mb_addr3" value="<?php echo $member['mb_addr3'] ?>" id="reg_mb_addr3" class="frm_input frm_address" size="50" readonly="readonly">
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $member['mb_addr_jibeon']; ?>">
</td>
</tr>
<?php } ?>
@ -262,7 +262,6 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<script>
$(function() {
$("#reg_zip_find").css("display", "inline-block");
$("#reg_mb_zip1, #reg_mb_zip2, #reg_mb_addr1").attr("readonly", true);
<?php if($config['cf_cert_use'] && $config['cf_cert_ipin']) { ?>
// 아이핀인증

View File

@ -190,22 +190,5 @@
#profile .sv_wrap a {margin:0 0 5px;padding:0;font-weight:bold;line-height:10px}
/* 우편번호 검색 */
#post_code #code_sel {margin:0 20px 20px}
#post_code #code_sel label {display:inline-block;margin:0 15px 0 0}
#post_code p {margin:0 0 10px}
#post_code #zip_search_frm {margin:0 20px}
#post_code #code_sch #sch_q {position:relative;margin:5px 0 0}
#post_code #code_sch .frm_input {height:22px}
#post_code #code_sch .btn_submit {padding:0 8px;height:24px}
#post_code #result_b4 {display:block;padding:30px 0;border-bottom:1px solid #dde4e9;text-align:center}
#post_code #result .result_msg {padding:15px 0}
#post_code #result .result_fail {border:1px solid #dde4e9;background:#f0f5fc;color:#ff3061;text-align:center}
#post_code #result ul {margin:0;padding:0;border-bottom:1px solid #dde4e9;background:#f0f5fc;list-style:none}
#post_code #result li {padding:10px;border:1px solid #dde4e9;border-bottom:0}
#post_code #result li div {margin:4px 0 0;color:#738D94}
#post_code #result li div {color:#738D94}
#post_code #result li div:before {content:"▶ "}
#post_code #zip_direct_frm {display:none;margin:0 20px}
#post_code #zip_direct_frm .frm_input {margin:0 0 5px}
#post_code #zip_direct_frm .frm_addr {width:99%}
#post_code #zip_direct_frm #sch_dq {padding:10px 0 20px;text-align:center}
#daum_juso_wrap{width:100%;height:100%}
html.daum_juso_body ,body.daum_juso_body {height:100%;overflow:hidden}

View File

@ -5,145 +5,17 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);
?>
<!-- 우편번호 찾기 시작 { -->
<script src="<?php echo G5_JS_URL; ?>/zip.js"></script>
<div id="post_code" class="new_win mbskin">
<h1 id="win_title"><?php echo $g5['title'] ?></h1>
<div id="code_sel">
<input type="radio" name="sch_sel" id="sch_sel_1" value="search" checked="checked">
<label for="sch_sel_1">주소검색</label>
<input type="radio" name="sch_sel" id="sch_sel_0" value="direct">
<label for="sch_sel_0">직접입력</label>
</div>
<div id="zip_search_frm" class="zip_frm">
<p>
시도 및 시군구 선택없이 도로명, 읍/면/동, 건물명 등으로 검색하실 수 있습니다.<br>
만약 검색결과에 찾으시는 주소가 없을 때는 시도와 시군구를 선택하신 후 다시 검색해 주십시오.<br>
(검색결과는 최대 1,000건만 표시됩니다.)
</p>
<form name="fzip" method="get" onsubmit="search_call(); return false;" autocomplete="off">
<!-- 검색어 입력 시작 { -->
<div id="code_sch">
<label for="sido" class="sound_only">시도선택</label>
<select name="sido" id="sido">
<option value="">- 시도 선택 -</option>
</select>
<label for="gugun" class="sound_only">시군구</label>
<select name="gugun" id="gugun">
<option value="">- 시군구 선택 -</option>
</select>
<div id="sch_q">
<label for="q" class="sound_only">검색어</label>
<input type="text" name="q" value="" id="q" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit">
</div>
</div>
<!-- } 검색어 입력 끝 -->
</form>
<div id="result"><span id="result_b4">검색어를 입력해주세요.</span></div>
</div>
<div id="zip_direct_frm" class="zip_frm">
<p>직접 주소를 입력하실 경우 우편번호와 기본주소는 반드시 입력하셔야 합니다.</p>
<form name="fzip2">
우편번호
<label for="frm_zip1" class="sound_only">우편번호앞자리</label>
<input type="text" name="frm_zip1" id="frm_zip1" class="required frm_input" size="3" maxlength="3"> -
<label for="frm_zip2" class="sound_only">우편번호뒷자리</label>
<input type="text" name="frm_zip2" id="frm_zip2" class="required frm_input" size="3" maxlength="3"><br>
<label for="frm_addr1" class="sound_only">기본주소</label>
<input type="text" name="frm_addr1" placeholder="기본주소" id="frm_addr1" class="required frm_input frm_addr"><br>
<label for="frm_addr2" class="sound_only">상세주소</label>
<input type="text" name="frm_addr2" placeholder="상세주소" id="frm_addr2" class="frm_input frm_addr"><br>
<label for="frm_addr3" class="sound_only">참고항목</label>
<input type="text" name="frm_addr3" placeholder="참고항목" id="frm_addr3" class="frm_input frm_addr"><br>
<label for="frm_jibeon" class="sound_only">지번주소</label>
<input type="text" name="frm_jibeon" placeholder="지번주소" id="frm_jibeon" class="frm_input frm_addr">
<div id="sch_dq">
<button type="button" id="put_addr" class="btn_submit">주소입력</button>
</div>
</form>
</div>
<div class="win_btn">
<button type="button" onclick="window.close();">창닫기</button>
</div>
</div>
<div id="daum_juso_wrap" class="daum_juso_wrap"></div>
<script>
$(function() {
$("input[name='sch_sel']").click(function() {
var val = $(this).val();
$(".zip_frm").hide();
$("#zip_"+val+"_frm").show();
});
var msg_alert = true;
$("input#q").bind("focusin", function() {
if(!msg_alert) {
return false;
} else {
alert("정확하고 빠른 검색을 위해 아래의 예시처럼 입력해 주세요.\n\n입력예1) 강남대로37길 24-6\n입력예2) 서초동 1362-19\n입력예3) 서초2동 1362-19");
msg_alert = false;
}
});
$("#put_addr").click(function() {
var zip1 = $.trim($("#frm_zip1").val());
var zip2 = $.trim($("#frm_zip2").val());
var addr1 = $.trim($("#frm_addr1").val());
var addr2 = $.trim($("#frm_addr2").val());
var addr3 = $.trim($("#frm_addr3").val());
var jibeon = $.trim($("#frm_jibeon").val());
if(zip1.length < 1) {
alert("우편번호 앞자리를 입력해 주십시오.");
return false;
jQuery(function($){
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
if(!is_chrome) { //모바일 크롬에서 먹통되는 현상이 있음
$("html, body").addClass("daum_juso_body");
}
if(zip2.length < 1) {
alert("우편번호 뒷자리를 입력해 주십시오.");
return false;
}
if(addr1.length < 1) {
alert("기본주소를 입력해 주십시오.");
return false;
}
put_data2(zip1, zip2, addr1, addr2, addr3, jibeon);
});
});
function put_data(zip1, zip2, addr1, 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 = "";
of.<?php echo $frm_addr3; ?>.value = addr3;
window.opener.$("#<?php echo $frm_jibeon; ?>").text("지번주소 : "+jibeon);
if(of.<?php echo $frm_jibeon; ?> !== undefined)
of.<?php echo $frm_jibeon; ?>.value = jibeon;
of.<?php echo $frm_addr2; ?>.focus();
window.close();
}
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
{
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;
@ -152,11 +24,28 @@ function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
of.<?php echo $frm_addr2; ?>.value = addr2;
of.<?php echo $frm_addr3; ?>.value = addr3;
window.opener.$("#<?php echo $frm_jibeon; ?>").text("지번주소 : "+jibeon);
if(of.<?php echo $frm_jibeon; ?> !== undefined)
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();
}
}
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);
});
</script>
<!-- } 우편번호 찾기 끝 -->

View File

@ -34,17 +34,17 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<th scope="row"><label for="reg_mb_id">아이디<strong class="sound_only">필수</strong></label></th>
<td>
<span class="frm_info">영문자, 숫자, _ 만 입력 가능. 최소 3자이상 입력하세요.</span>
<input type="text" name="mb_id" value="<?php echo $member['mb_id'] ?>" id="reg_mb_id" <?php echo $required ?> <?php echo $readonly ?> class="frm_input minlength=3 <?php echo $required ?> <?php echo $readonly ?>" maxlength="20">
<input type="text" name="mb_id" value="<?php echo $member['mb_id'] ?>" id="reg_mb_id" <?php echo $required ?> <?php echo $readonly ?> class="frm_input <?php echo $required ?> <?php echo $readonly ?>" minlength="3" maxlength="20">
<span id="msg_mb_id"></span>
</td>
</tr>
<tr>
<th scope="row"><label for="reg_mb_password">비밀번호<strong class="sound_only">필수</strong></label></th>
<td><input type="password" name="mb_password" id="reg_mb_password" <?php echo $required ?> class="frm_input minlength=3 <?php echo $required ?>" maxlength="20"></td>
<td><input type="password" name="mb_password" id="reg_mb_password" <?php echo $required ?> class="frm_input <?php echo $required ?>" minlength="3" maxlength="20"></td>
</tr>
<tr>
<th scope="row"><label for="reg_mb_password_re">비밀번호 확인<strong class="sound_only">필수</strong></label></th>
<td><input type="password" name="mb_password_re" id="reg_mb_password_re" <?php echo $required ?> class="frm_input minlength=3 <?php echo $required ?>" maxlength="20"></td>
<td><input type="password" name="mb_password_re" id="reg_mb_password_re" <?php echo $required ?> class="frm_input <?php echo $required ?>" minlength="3" maxlength="20"></td>
</tr>
</tbody>
</table>
@ -155,11 +155,11 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<input type="text" name="mb_addr1" value="<?php echo $member['mb_addr1'] ?>" id="reg_mb_addr1" <?php echo $config['cf_req_addr']?"required":""; ?> class="frm_input frm_address <?php echo $config['cf_req_addr']?"required":""; ?>" size="50">
<label for="reg_mb_addr1">기본주소<?php echo $config['cf_req_addr']?'<strong class="sound_only"> 필수</strong>':''; ?></label><br>
<input type="text" name="mb_addr2" value="<?php echo $member['mb_addr2'] ?>" id="reg_mb_addr2" class="frm_input frm_address" size="50">
<label for="reg_mb_addr2">상세주소</label><br>
<input type="text" name="mb_addr3" value="<?php echo $member['mb_addr3'] ?>" id="reg_mb_addr3" readonly="readonly" class="frm_input frm_address" size="50">
<label for="reg_mb_addr3">참고항목</label><br>
<label for="reg_mb_addr2">상세주소</label>
<br>
<input type="text" name="mb_addr3" value="<?php echo $member['mb_addr3'] ?>" id="reg_mb_addr3" class="frm_input frm_address" size="50" readonly="readonly">
<label for="reg_mb_addr3">참고항목</label>
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $member['mb_addr_jibeon']; ?>">
<span id="mb_addr_jibeon"><?php echo ($member['mb_addr_jibeon'] ? '지번주소 : '.$member['mb_addr_jibeon'] : ''); ?></span>
</td>
</tr>
<?php } ?>
@ -270,7 +270,6 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<script>
$(function() {
$("#reg_zip_find").css("display", "inline-block");
$("#reg_mb_zip1, #reg_mb_zip2, #reg_mb_addr1").attr("readonly", true);
<?php if($config['cf_cert_use'] && $config['cf_cert_ipin']) { ?>
// 아이핀인증

View File

@ -173,20 +173,5 @@
#profile h2 {margin:0}
/* 우편번호 검색 */
#post_code #code_sel {margin:0 20px 20px}
#post_code #code_sel label {display:inline-block;margin:0 15px 0 0}
#post_code p {margin:0 0 10px}
#post_code .btn_submit {padding:0 8px;height:24px}
#post_code #zip_search_frm {margin:0 20px}
#post_code #code_sch #sch_q {position:relative;margin:5px 0 0}
#post_code #code_sch #q_info {display:none;z-index:2;position:absolute;top:33px;left:0;padding:5px;background:#e4eaec}
#post_code #code_sch #q_info span {position:absolute;top:-6px;left:5px;width:11px;height:6px;background:url('img/zip_ico_up.gif')}
#post_code #result_b4 {display:block;padding:30px 0;border-bottom:1px solid #dde4e9;text-align:center}
#post_code #result .result_msg {padding:15px 0}
#post_code #result .result_fail {border:1px solid #dde4e9;background:#f0f5fc;color:#ff3061;text-align:center}
#post_code #result ul {margin:0;padding:0;border-bottom:1px solid #dde4e9;background:#f0f5fc;list-style:none}
#post_code #result li {padding:10px;border:1px solid #dde4e9;border-bottom:0}
#post_code #result li div {margin:4px 0 0;color:#738D94}
#post_code #result li div:before {content:"▶ "}
#post_code #zip_direct_frm {display:none;margin:0 20px}
#post_code #zip_direct_frm .frm_input, #post_code #zip_direct_frm .btn_submit {margin:0 0 5px}
#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}

View File

@ -5,142 +5,14 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);
?>
<!-- 우편번호 찾기 시작 { -->
<script src="<?php echo G5_JS_URL; ?>/zip.js"></script>
<div id="post_code" class="new_win mbskin">
<h1 id="win_title"><?php echo $g5['title'] ?></h1>
<div id="code_sel">
<input type="radio" name="sch_sel" id="sch_sel_1" value="search" checked="checked">
<label for="sch_sel_1">주소검색</label>
<input type="radio" name="sch_sel" id="sch_sel_0" value="direct">
<label for="sch_sel_0">직접입력</label>
</div>
<div id="zip_search_frm" class="zip_frm">
<p>
시도 및 시군구 선택없이 도로명, 읍/면/동, 건물명 등으로 검색하실 수 있습니다.<br>
만약 검색결과에 찾으시는 주소가 없을 때는 시도와 시군구를 선택하신 후 다시 검색해 주십시오.<br>
(검색결과는 최대 1,000건만 표시됩니다.)
</p>
<form name="fzip" method="get" onsubmit="search_call(); return false;" autocomplete="off">
<!-- 검색어 입력 시작 { -->
<div id="code_sch">
<label for="sido" class="sound_only">시도선택</label>
<select name="sido" id="sido">
<option value="">- 시도 선택 -</option>
</select>
<label for="gugun" class="sound_only">시군구</label>
<select name="gugun" id="gugun">
<option value="">- 시군구 선택 -</option>
</select>
<div id="sch_q">
<div id="q_info"><span></span>정확하고 빠른 검색을 위해 아래의 예시처럼 입력해 주세요.<br><br>입력예1) 강남대로37길 24-6<br>입력예2) 서초동 1362-19<br>입력예3) 서초2동 1362-19</div>
<label for="q" class="sound_only">검색어</label>
<input type="text" name="q" value="" id="q" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit">
</div>
</div>
<!-- } 검색어 입력 끝 -->
</form>
<div id="result"><span id="result_b4">검색어를 입력해주세요.</span></div>
</div>
<div id="zip_direct_frm" class="zip_frm">
<p>직접 주소를 입력하실 경우 우편번호와 기본주소는 반드시 입력하셔야 합니다.</p>
<form name="fzip2">
우편번호
<label for="frm_zip1" class="sound_only">우편번호앞자리</label>
<input type="text" name="frm_zip1" id="frm_zip1" class="required frm_input" size="3" maxlength="3"> -
<label for="frm_zip2" class="sound_only">우편번호뒷자리</label>
<input type="text" name="frm_zip2" id="frm_zip2" class="required frm_input" size="3" maxlength="3"><br>
<label for="frm_addr1">기본주소</label>
<input type="text" name="frm_addr1" id="frm_addr1" class="required frm_input" size="70"><br>
<label for="frm_addr2">상세주소</label>
<input type="text" name="frm_addr2" id="frm_addr2" class="frm_input" size="70"><br>
<label for="frm_addr3">참고항목</label>
<input type="text" name="frm_addr3" id="frm_addr3" class="frm_input" size="70"><br>
<label for="frm_jibeon">지번주소</label>
<input type="text" name="frm_jibeon" id="frm_jibeon" class="frm_input" size="70">
<button type="button" id="put_addr" class="btn_submit">주소입력</button>
</form>
</div>
<div class="win_btn">
<button type="button" onclick="window.close();">창닫기</button>
</div>
</div>
<div id="daum_juso_wrap" class="daum_juso_wrap"></div>
<script>
$(function() {
$("input[name='sch_sel']").click(function() {
var val = $(this).val();
jQuery(function($){
$("html, body").addClass("daum_juso_body");
$(".zip_frm").hide();
$("#zip_"+val+"_frm").show();
});
$("input#q").bind("focusin", function() {
$("#q_info").fadeIn(200);
});
$("input#q").bind("focusout", function() {
$("#q_info").fadeOut(200);
});
$("#put_addr").click(function() {
var zip1 = $.trim($("#frm_zip1").val());
var zip2 = $.trim($("#frm_zip2").val());
var addr1 = $.trim($("#frm_addr1").val());
var addr2 = $.trim($("#frm_addr2").val());
var addr3 = $.trim($("#frm_addr3").val());
var jibeon = $.trim($("#frm_jibeon").val());
if(zip1.length < 1) {
alert("우편번호 앞자리를 입력해 주십시오.");
return false;
}
if(zip2.length < 1) {
alert("우편번호 뒷자리를 입력해 주십시오.");
return false;
}
if(addr1.length < 1) {
alert("기본주소를 입력해 주십시오.");
return false;
}
put_data2(zip1, zip2, addr1, addr2, addr3, jibeon);
});
});
function put_data(zip1, zip2, addr1, 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 = "";
of.<?php echo $frm_addr3; ?>.value = addr3;
window.opener.$("#<?php echo $frm_jibeon; ?>").text("지번주소 : "+jibeon);
if(of.<?php echo $frm_jibeon; ?> !== undefined)
of.<?php echo $frm_jibeon; ?>.value = jibeon;
of.<?php echo $frm_addr2; ?>.focus();
window.close();
}
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
{
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;
@ -149,11 +21,27 @@ function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
of.<?php echo $frm_addr2; ?>.value = addr2;
of.<?php echo $frm_addr3; ?>.value = addr3;
window.opener.$("#<?php echo $frm_jibeon; ?>").text("지번주소 : "+jibeon);
if(of.<?php echo $frm_jibeon; ?> !== undefined)
if( jibeon ){
if(of.<?php echo $frm_jibeon; ?> !== undefined){
of.<?php echo $frm_jibeon; ?>.value = jibeon;
}
}
of.<?php echo $frm_addr2; ?>.focus();
window.close();
}
}
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);
});
</script>
<!-- } 우편번호 찾기 끝 -->