게시판에 글쓴것이 리스트에 나오게 하고 싶습니다...

게시판에 글쓴것이 리스트에 나오게 하고 싶습니다...

QA

게시판에 글쓴것이 리스트에 나오게 하고 싶습니다...

본문

아래처럼 전체 수정하고 했는데도 안나옵니다 왜이러는걸까요 소스좀 봐주세요 ㅠ_ㅠ]

1988200250_1522739408.7998.png

 

bbs/write.php

$is_name     = false;
$is_password = false;
$is_email    = true;
$is_homepage = true;
$is_1 = true;
$is_2 = true;
$is_3 = true;
$is_4 = true;
if ($is_guest || ($is_admin && $w == 'u' && $member['mb_id'] != $write['mb_id'])) {
    $is_name = true;
    $is_password = true;
    $is_email = true;
    $is_homepage = true;
    $is_1 = true;
    $is_2 = true;
    $is_3 = true;
    $is_4 = true;
}

write.skin.php

 

<?php if ($is_1) { ?>
        <tr>
            <th scope="row"><label for="wr_1">구분</label></th>
            <td><input type="text" name="wr_1" value="<?php echo $write['wr_1'] ?>" id="wr_1" class="frm_input" size="50"></td>
        </tr>
  <?php } ?>
<?php if ($is_2) { ?>
        <tr>
            <th scope="row"><label for="wr_2">교육기간</label></th>
            <td><input type="text" name="wr_2" value="<?php echo $write['wr_2'] ?>" id="wr_2" class="frm_input" size="50"></td>
        </tr>
  <?php } ?>
<?php if ($is_3) { ?>
        <tr>
            <th scope="row"><label for="wr_3">수강료</label></th>
            <td><input type="text" name="wr_3" value="<?php echo $write['wr_3'] ?>" id="wr_3" class="frm_input" size="50"></td>
        </tr>
  <?php } ?>
<?php if ($is_4) { ?>
        <tr>
            <th scope="row"><label for="wr_4">수강신청</label></th>
            <td><input type="text" name="wr_4" value="<?php echo $write['wr_4'] ?>" id="wr_4" class="frm_input" size="50"></td>
        </tr>
        
        <?php } ?>

1988200250_1522739286.9215.png

 

list.skin.php

 <th scope="col"><?php echo $list[$i]['wr2'] ;?>교육기간</th>
       <th scope="col"><?php echo $list[$i]['wr_3'] ;?>수강료</th>
        <th scope="col"><?php echo $list[$i]['wr_4'] ;?>수강신청</th>

 

1988200250_1522739346.9062.png

 

이 질문에 댓글 쓰기 :

답변 2

관리자모드에서 게시판설정의 여분필드는 그 게시판 전체에 적용되는 일반 설정에 해당합니다.

DB의 g5_board에 기록되는 겁니다.

 

게시물 각각에 적용하기 위해서는 그 여분필드를 사용해서는 안되고

글쓰기페이지(write.skin.php)에서 예를 들면

수강료: <input type="text" name="wr_1" id="wr_1" >

이런 식으로 각각 입력폼의  name값에서 wr_1에서 wr_10까지의 값을 부여해 

뷰페이지나 리스트페이지에서 그 값을 참조해야 합니다.

 

물론 wr_1~10까지 기본으로 주어져 있지만 필요에 따라 필드를 더 확장할 수 있습니다.

 

 

 <th scope="col"><?php echo $list[$i]['wr2'] ;?>교육기간</th>
       <th scope="col"><?php echo $list[$i]['wr_3'] ;?>수강료</th>
        <th scope="col"><?php echo $list[$i]['wr_4'] ;?>수강신청</th>

 

이부분은 헤더 부분으로 for 문이 돌지 않는 부분입니다.

그러므로 $list 변수를 사용할 수 없습니다.

 

스킨의 for 문 이하

<tbody>

<tr><td><?php echo $list[$i]['wr2'] ;?></td></tr>

 

이런식으로 넣어주셔야해요.

답변을 작성하시기 전에 로그인 해주세요.
전체 36
QA 내용 검색

회원로그인

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