SNS 네이버로그인시 전화번호 가져오기 > 그누보드5 팁자료실

그누보드5 팁자료실

SNS 네이버로그인시 전화번호 가져오기 정보

SNS 네이버로그인시 전화번호 가져오기

본문

네이버로그인api 전화번호가져오기가 체크되있어도

그누에 mobile 값이 없어서 전화번호를 가져오지 하는데..

그 값만 추가하면 전화번호를 가져와서 공유합니다.

 

1] 첫번째

 

plugin/social/Hybrid/Providers/Naver.php

 

검색

$this->user->profile->username = (array_key_exists('name', $data)) ? $data['name'] : "";

 

하단 추가

$this->user->profile->mobile = (array_key_exists('mobile', $data)) ? $data['mobile'] : "";

 

예시)

$this->user->profile->username = (array_key_exists('name', $data)) ? $data['name'] : "";
$this->user->profile->mobile = (array_key_exists('mobile', $data)) ? $data['mobile'] : "";

 

 

2] 두번째

 

plugin/social/register_member.php

 

검색

$user_name = isset($user_profile->username) ? $user_profile->username : ''; 

 

하단 추가

$user_mobile = isset($user_profile->mobile) ? $user_profile->mobile : ''; 

 

예시)

$user_name = isset($user_profile->username) ? $user_profile->username : ''; 
$user_mobile = isset($user_profile->mobile) ? $user_profile->mobile : ''; 

 

 

3] 세번째 

 

skin/social/social_register_member.php

 

검색

 <tr>
            <th scope="row"><label for="reg_mb_email">E-mail<strong class="sound_only">필수</strong></label></th>
            <td>
                <input type="text" name="mb_email" value="<?php echo isset($user_email)?$user_email:''; ?>" id="reg_mb_email" required class="frm_input email required" size="70" maxlength="100" placeholder="이메일을 입력해주세요." >
                <p class="email_msg"><?php echo $email_msg; ?></p>
            </td>
        </tr>

 

 

하단추가

네이버 인증하고 확인시 나오는 화면입니다.

전화번호를 노출하고 싶으시면  하단내용을 추가하면

 

<tr>
            <th scope="row"><label for="mb_hp">mb_hp<strong class="sound_only">필수</strong></label></th>
            <td>
                <input type="text" name="mb_hp" value="<?php echo isset($user_mobile)?$user_mobile:''; ?>" id="mb_hp" required class="frm_input" size="70" maxlength="100" placeholder="전화번호를 입력해주세요." >

            </td>
        </tr>

 

3551548535_1624343960.9472.png

 

 

이런 화면에 전화번호칸이 노출이됩니다.  노출을 원하시지않으시면

 

검색 ]

<input type="text" name="mb_email" value="<?php echo isset($user_email)?$user_email:''; ?>" id="reg_mb_email" required class="frm_input email required" size="70" maxlength="100" placeholder="이메일을 입력해주세요." >

 

하단추가

<input type="hidden" name="mb_hp" value="<?php echo isset($user_mobile)?$user_mobile:''; ?>">

 

위에 코드를 넣어주시면 노출은 되지않습니다.

 

 

 

4] 네번째

 

plugin/social/register_member_update.php

 

검색

$mb_email       = get_email_address($mb_email);

 

하단 추가

$mb_hp          = isset($_POST['mb_hp']) ? trim($_POST['mb_hp']) : "";

 

 

검색

mb_email = '{$mb_email}',

 

하단 추가

mb_hp = '{$mb_hp}',

 

 

 

 

전화번호가 추가됩니다.

 

 

 

추천
10

댓글 11개

와우 현재까지 이 로직 잘 되네요~ 이걸로 해결했습니다 감사드려요!!!

참 세번째,

skin/social/social_register_member.php가  social_register_member.skin.php로 바뀐 듯합니다.

전     

    <div class="form-group mb-4">
        <label for="reg_mb_email">이메일</label>
        <input type="text" name="mb_email" value="<?php echo isset($user_email)?$user_email:''; ?>" id="reg_mb_email" required class="form-control email" maxlength="100" placeholder="이메일">
    </div>

 

이메일 아래에         

    <div class="form-group mb-4">
        <label for="mb_hp">휴대폰</label>
        <input type="text" name="mb_hp" value="<?php echo isset($user_mobile)?$user_mobile:''; ?>" id="mb_hp" required class="form-control" maxlength="100" placeholder="휴대폰번호">
    </div>

 

이런 식으로 추가하고 디비에 값이 들어갔습니다.

그누보드 Version 5.5.16에서도 잘되고 있네요 감사합니다!!!

전체 2,675 |RSS
그누보드5 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT