메뉴 건너뛰기

조회 수 3729 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부

게시판 글쓰기 할 때 그누5에 기본적으로 연동이 되어 있는 다음 주소 API를 사용하는 방법입니다

(예제 스킨 파일 첨부) 

 

아래 예제는 wr_1 번 여분 필드를 쪼개서 사용하는 방법입니다.

방법만 참고하시고 입력 필드는 상황에 맞게 수정해서 사용하면 됩니다.

 

 

1. write.skin.php 파일 상단에 아래 내용을 추가합니다. (빨간색 부분이 추가되었습니다.)

 

<?php

if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

 

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨

add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);

add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js

// 주소입력

$wr1 = explode('|',$write['wr_1']);

$ex_zip  = $wr1[0];

$ex_addr1  = $wr1[1];

$ex_addr2  = $wr1[2];

$ex_addr3  = $wr1[3];

$ex_jibeon  = $wr1[4];

?>

 

 

적당한 위치에 아래 내용을 추가합니다.

 

<tr>

    <th scope="row"><label for="wr_1">주소</label></th>

    <td>

        <label for="ex_zip" class="sound_only">우편번호</label>

        <input type="text" name="ex_zip" value="<?php echo $ex_zip; ?>" id="ex_zip"  class="frm_input" size="6" maxlength="6">

        <button type="button" class="btn_frmline" onclick="win_zip('fwrite', 'ex_zip', 'ex_addr1', 'ex_addr2', 'ex_addr3', 'ex_jibeon');">주소 검색</button><br>

        <input type="text" name="ex_addr1" value="<?php echo $ex_addr1; ?>" id="ex_addr1" class="frm_input frm_address" size="50">

        <label for="ex_addr1">기본주소</label><br>

        <input type="text" name="ex_addr2" value="<?php echo $ex_addr2; ?>" id="ex_addr2" class="frm_input frm_address" size="50">

        <label for="ex_addr2">상세주소</label>

        <br>

        <input type="text" name="ex_addr3" value="<?php echo $ex_addr3; ?>" id="ex_addr3" class="frm_input frm_address" size="50" readonly="readonly">

        <label for="ex_addr3">참고항목</label>

        <input type="hidden" name="ex_jibeon" value="<?php echo $ex_jibeon; ?>">

    </td>

</tr>

 

 

2. write_update.skin.php 파일 만들기 (basic 스킨에는 없는 파일이니 새로 생성합니다.)

 

파일 안의 내용은 다음과 같습니다.

 

<?php

if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

 

// 주소

$wr_1 = "$ex_zip|$ex_addr1|$ex_addr2|$ex_addr3|$ex_jibeon";

$sql = " update {$write_table} set wr_1 = '{$wr_1}' where wr_id = '{$wr_id}' ";

sql_query($sql);

?>

 

 

3. view.skin.php 파일에 입력된 주소 출력하기

 

파일 상단 <?  ?> 안쪽에 아래 내용을 추가합니다.

 

// 주소

$wr1 = explode('|',$view['wr_1']);

$ex_zip  = '('.$wr1[0].')';

$ex_addr1  = $wr1[1];

$ex_addr2  = $wr1[2];

$ex_addr3  = $wr1[3];

$ex_jibeon  = $wr1[4];

 

 

원하는 위치에 아래 내용을 추가합니다.

 

<?php echo $ex_zip; ?> <?php echo $ex_addr1; ?> <?php echo $ex_addr2; ?> <?php echo $ex_addr3; ?>


  1. sql 바인딩 그누보드에서 해보기

    Date2024.04.09 Views0
    Read More
  2. 홈페이지를 특정 IP 일때 다른 페이지로 연결하기

    Date2024.04.09 Views0
    Read More
  3. 페이지 하단 커스텀 플레이어

    Date2024.04.09 Views0
    Read More
  4. 유튜브 반응형 만들기

    Date2024.04.09 Views0
    Read More
  5. 엑셀파일 읽어서 바로 DB에 업로드하기

    Date2024.04.09 Views2
    Read More
  6. 회원 가입 페이지에서 랜덤 닉네임 보여주기

    Date2024.04.09 Views0
    Read More
  7. 게시물 관리 기능을 업데이트

    Date2024.04.09 Views0
    Read More
  8. 날짜및 시간 선택 jquery 라이브러리

    Date2024.04.09 Views0
    Read More
  9. mysql concat 날짜와 시간을 문자열로 합치기 시간의 크기 비교

    Date2023.05.16 Views131
    Read More
  10. 회원가입 못하게

    Date2023.01.05 Views79
    Read More
  11. 그누보드 이력서 스킨

    Date2021.03.24 Views151
    Read More
  12. fullcalendar 달력 게시판 스킨

    Date2021.03.24 Views359
    Read More
  13. 그누보드 카카오톡 로그인 V2 플러그인

    Date2021.03.24 Views289
    Read More
  14. 회원 등급(권한)에 따라서 다른 메시지 보이기

    Date2021.03.24 Views146
    Read More
  15. '정상적으로 로그인하여 접근하시기 바랍니다.' 해결 방법

    Date2020.12.09 Views424
    Read More
  16. 링크 클릭시 특정영역에 페이지 불러오기 (아이프레임X)

    Date2019.12.13 Views1221
    Read More
  17. 회원 목록을 select 로 불러와서 선택시 input 에 집어넣기

    Date2019.12.13 Views586
    Read More
  18. 네이버 밴드 글 가져오기

    Date2019.12.13 Views485
    Read More
  19. 카운트다운 스크립트

    Date2019.12.13 Views317
    Read More
  20. 이름 마지막 한자리 별표 처리

    Date2019.12.13 Views326
    Read More
Board Pagination Prev 1 2 3 4 Next
/ 4

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved