[G4/G5] 회원 로그인후 글 작성시 이름과 이메일 입력해서 글저장 > 기술자료 | 해피정닷컴

[G4/G5] 회원 로그인후 글 작성시 이름과 이메일 입력해서 글저장 > 기술자료

본문 바로가기

사이트 내 전체검색

[G4/G5] 회원 로그인후 글 작성시 이름과 이메일 입력해서 글저장 > 기술자료

그누보드 [G4/G5] 회원 로그인후 글 작성시 이름과 이메일 입력해서 글저장

페이지 정보


본문

회원 로그인후 글작성(글쓰기)할때 이름과 이메일을 변경해서 글 게시하도록 하는 방법입니다
회원로그인하면 이름(글쓴이/작성자), 이메일은 회원정보의 것이 자동으로 삽입되는데, 그것을 회원 스스로 입력하도록 할 수 있습니다

1-1. 그누보드5.4 / skin / board / 스킨 / write.skin.php
[수정전]
        <?php if ($is_name) { ?>
            <label for="wr_name" class="sound_only">이름<strong>필수</strong></label>
            <input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input half_input required" placeholder="이름">
        <?php } ?>
    
        <?php if ($is_password) { ?>
            <label for="wr_password" class="sound_only">비밀번호<strong>필수</strong></label>
            <input type="password" name="wr_password" id="wr_password" <?php echo $password_required ?> class="frm_input half_input <?php echo $password_required ?>" placeholder="비밀번호">
        <?php } ?>
    
        <?php if ($is_email) { ?>
            <label for="wr_email" class="sound_only">이메일</label>
            <input type="text" name="wr_email" value="<?php echo $email ?>" id="wr_email" class="frm_input half_input email " placeholder="이메일">
        <?php } ?>
        
        <?php if ($is_homepage) { ?>
            <label for="wr_homepage" class="sound_only">홈페이지</label>
            <input type="text" name="wr_homepage" value="<?php echo $homepage ?>" id="wr_homepage" class="frm_input half_input" size="50" placeholder="홈페이지">
        <?php } ?>


[수정후]
        <?php //if ($is_name) { ?>
            <label for="wr_name" class="sound_only">이름<strong>필수</strong></label>
            <input type="text" name="wr_name" value="<?php echo $name; ?>" id="wr_name" required class="frm_input half_input required" placeholder="이름">
        <?php //} ?>
    
        <?php //if ($is_password) { ?>
            <label for="wr_password" class="sound_only">비밀번호<strong>필수</strong></label>
            <input type="password" name="wr_password" id="wr_password;" <?php echo $password_required; ?> class="frm_input half_input <?php echo $password_required; ?>" placeholder="비밀번호">
        <?php //} ?>
    
        <?php //if ($is_email) { ?>
            <label for="wr_email" class="sound_only">이메일</label>
            <input type="text" name="wr_email" value="<?php echo $email; ?>" id="wr_email" class="frm_input half_input email " placeholder="이메일">
        <?php //} ?>
    
        <?php //if ($is_homepage) { ?>
            <label for="wr_homepage" class="sound_only">홈페이지</label>
            <input type="text" name="wr_homepage" value="<?php echo $homepage; ?>" id="wr_homepage" class="frm_input half_input" size="50" placeholder="홈페이지">
        <?php //} ?>
    
        <?php if ($is_admin) { ?>
            <label for="wr_ip" class="sound_only">IP</label>
            <input type="text" name="wr_ip" value="<?php echo $write['wr_ip']; ?>" id="wr_ip" class="frm_input half_input" size="50" placeholder="IP">
        <?php } ?>


1-2. 그누보드4 / skin / board / 스킨 / write.skin.php
[수정전]
<? if ($is_name) { ?>
<tr>
    <td class=write_head>이 름</td>
    <td><input class='ed' maxlength=20 size=15 name=wr_name itemname="이름" required value="<?=$name?>"></td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>

<? if ($is_email) { ?>
<tr>
    <td class=write_head>이메일</td>
    <td><input class='ed' maxlength=100 size=50 name=wr_email email itemname="이메일" value="<?=$email?>"></td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>

<? if ($is_homepage) { ?>
<tr>
    <td class=write_head>홈페이지</td>
    <td><input class='ed' size=50 name=wr_homepage itemname="홈페이지" value="<?=$homepage?>"></td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>


[수정후]
<?php //if ($is_name) { ?>
<tr>
    <td class="write_head">이 름</td>
    <td><input class='ed' maxlength="20" size="15" name="wr_name" title="이름" required value="<?php echo $name; ?>"></td>
</tr>
<tr><td colspan="2" height="1" bgcolor="#e7e7e7">
</td></tr>
<?php //} ?>

<?php //if ($is_email) { ?>
<tr>
    <td class="write_head">이메일</td>
    <td><input class='ed' maxlength="100" size="50" name="wr_email" email itemname="이메일" value="<?php echo $email; ?>"></td></tr>
<tr><td colspan="2" height="1" bgcolor="#e7e7e7"></td></tr>
<?php //} ?>

<?php //if ($is_homepage) { ?>
<tr>
    <td class=write_head>홈페이지</td>
    <td><input class='ed' size="50" name="wr_homepage" itemname="홈페이지" value="<?php echo $homepage; ?>"></td></tr>
<tr><td colspan="2" height="1" bgcolor="#e7e7e7"></td></tr>
<?php //} ?>

<?php if($is_admin) { ?>
<tr>
    <td class="write_head" 아 이 피</td>
    <td><input class=ed size="20" name="wr_ip" itemname="아이피" required value="<?php echo $write['wr_ip']; ?>"></td></tr>
<tr><td colspan="2" height="1" bgcolor="#e7e7e7"></td></tr>
<?php } ?>


2. 그누보드 / skin / board / 스킨 / write_update.skin.php  수정 (파일이 없으면 생성하세요)
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 자신만의 코드를 넣어주세요.

// 작성자정보를 변경하기
if ($_POST['wr_name'] || $_POST['wr_password'] || $_POST['wr_homepage'] || $_POST['wr_email'] || $_POST['wr_ip']) {
    $sql_update_writer = " update `{$write_table}` set ";
    //if ($_POST['wr_password']) $sql_update_writer .= "wr_password = '{$_POST['wr_password']}' , ";
    if ($_POST['wr_homepage']) $sql_update_writer .= "wr_homepage = '{$_POST['wr_homepage']}' , ";
    if ($_POST['wr_email']) $sql_update_writer .= "wr_email = '{$_POST['wr_email']}' , ";
    if ($_POST['wr_ip']) $sql_update_writer .= "wr_ip = '{$_POST['wr_ip']}' ";
    $sql_update_writer .= "wr_name = '{$_POST['wr_name']}'  ";
    $sql_update_writer .= "where  wr_id = '{$wr_id}' ";
    sql_query($sql_update_writer);
}


참고자료
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=32457

댓글목록

등록된 댓글이 없습니다.


Total 2,643건 1 페이지
  • RSS
기술자료 목록
2643
PHP   259  2025-02-07 09:27 ~ 2025-02-07 16:59  
2642
그누보드   207  2025-02-07 08:55 ~ 2025-02-07 17:04  
2641
그누보드   490  2024-11-26 21:14 ~ 2024-11-26 21:22  
2640
그누보드   565  2024-11-22 10:52 ~ 2024-11-22 11:03  
2639
호스팅   552  2024-11-19 14:41 ~ 2024-11-19 21:17  
2638
Linux   405  2024-11-18 15:45 ~ 2024-11-18 15:48  
2637
일반   397  2024-11-15 16:45 ~ 2024-11-15 16:46  
2636
Secure   433  2024-11-06 18:48 ~ 2024-11-06 18:50  
2635
영카트   623  2024-10-21 13:44 ~ 2024-10-21 19:42  
2634
전자결제   1294  2024-09-05 09:30  
2633
MySQL   1282  2024-03-29 14:14 ~ 2024-03-29 14:14  
2632
그누보드   1478  2024-02-23 18:40 ~ 2024-02-24 06:13  
2631
JavaScript   1600  2024-02-16 18:50 ~ 2024-02-16 20:37  
2630
Java   1597  2024-02-06 16:49  
2629
PHP   1802  2024-02-06 16:42  
2628
호스팅   1652  2024-01-29 12:54  
2627
PHP   1572  2024-01-26 11:04 ~ 2024-01-26 11:13  
2626
MySQL   1686  2024-01-08 17:37 ~ 2024-03-14 16:00  
2625
SQL   1981  2024-01-08 12:36  
2624
영카트   1977  2024-01-04 14:57  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2025 해피정닷컴. All Rights Reserved.