여분필드를 활용한 게시판 목록 문제 ..

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
여분필드를 활용한 게시판 목록 문제 ..

QA

여분필드를 활용한 게시판 목록 문제 ..

본문

5535049a3e01439b843661ad6ff332db_1688967750_7564.png 

 

안녕하세요? 그누보 왕초보 입니다. 항상 답글 감사합니다. 

위의 사진에서 보시다시피 제가 여분 필드를 이용해서 게시판 목록에서 항목을 더 추가해주려고 합니다. 

setup.skin.php 에서 항목을 더 추가해주었고 list.skin.pc.php 에서 
 

<?php if($boset['media']) { ?>

<th scope="col"><?php echo subject_sort_link('wr_9', $qstr2, 1) ?>제안매체</a></th>

<?php } ?>

  <?php if($boset['process']) { ?>

<th scope="col"><?php echo subject_sort_link('wr_6', $qstr2, 1) ?>진행가능성</a></th>

<?php } ?>

이렇게 추가해 주었는데 왜 여분 필드 데이타 값이 출력되지 않고 게다가 $boset[''] 정의해준 이름과 일치하지 않은데 앞의 데이터에서 밀려서 나올까요?
 

<th scope="col">업체명</th>

  <?php if($boset['media']) { ?>

<th scope="col"><?php echo subject_sort_link('wr_9', $qstr2, 1) ?>제안매체</a></th>

<?php } ?>

  <?php if($boset['process']) { ?>

<th scope="col"><?php echo subject_sort_link('wr_6', $qstr2, 1) ?>진행가능성</a></th>

<?php } ?>

<?php if($boset['name']) { ?>

<th scope="col">작성자</th>

<?php } ?>

<?php if($boset['date']) { ?>

<th scope="col"><?php echo subject_sort_link('wr_datetime', $qstr2, 1) ?>날짜</a></th>

<?php } ?>
전체 코드는 이렇습니다. 

이 질문에 댓글 쓰기 :

답변 3

여분 필터에 업데이트 되는지 먼저 확인해보세요 그리고 나서 음...........;;;

$boset[‘media’]와 $boset[‘process’]가 업데에 처리해야할 필요한 변수인데..... 정의되어 있지 않은 것 같네요 ~~도움이 되셔길 바랍니다.

테이블 header 절 조건을 body 절 에도 동일하게 적용하면 예상하는 내용이 출력됩니다.

다음 코드가 도움이 될지 모르겠습니다.


<?php
function subject_sort_link($arg1, $arg2, $arg3) {
  return '<a href="#">';
}
 
$boset = [
  'media' => true,
  'process' => true,
  'name' => true,
  'date' => false,
];
 
$qstr2 = '';
 
$datas = [
  ['wr_6' => 'wr_6_1', 'wr_9' => 'wr_9_1', 'wr_name' => 'wr_name_1', 'wr_datetime' => 'wr_datetime_1'],
  ['wr_6' => 'wr_6_2', 'wr_9' => 'wr_9_2', 'wr_name' => 'wr_name_2', 'wr_datetime' => 'wr_datetime_2'],
  ['wr_6' => 'wr_6_3', 'wr_9' => 'wr_9_3', 'wr_name' => 'wr_name_3', 'wr_datetime' => 'wr_datetime_3'],
];
?>

<table border="1">
  <tr>
    <th scope="col">업체명</th>
    <?php if($boset['media']) { ?>
    <th scope="col"><?php echo subject_sort_link('wr_9', $qstr2, 1) ?>제안매체</a></th>
    <?php } ?>
    <?php if($boset['process']) { ?>
    <th scope="col"><?php echo subject_sort_link('wr_6', $qstr2, 1) ?>진행가능성</a></th>
    <?php } ?>
    <?php if($boset['name']) { ?>
    <th scope="col">작성자</th>
    <?php } ?>
    <?php if($boset['date']) { ?>
    <th scope="col"><?php echo subject_sort_link('wr_datetime', $qstr2, 1) ?>날짜</a></th>
    <?php } ?>
  </tr>
  <?php
  $html_tr = '';
  while (($data = current($datas)) !== false) {
    $html_tr .= '<tr>';
 
    $html_tr .= '<td>company name</td>';
    if($boset['media']) {
      $html_tr .= '<td>' . $data['wr_9'] . '</td>';
    }
    if($boset['process']) {
      $html_tr .= '<td>' . $data['wr_6'] . '</td>';
    }
    if($boset['name']) {
      $html_tr .= '<td>' . $data['wr_name'] . '</td>';
    }
    if($boset['date']) {
      $html_tr .= '<td>' . $data['wr_datetime'] . '</td>';
    }
 
    $html_tr .= '</tr>';
    next($datas);
  }
  echo $html_tr;
  ?>
</table>
답변을 작성하시기 전에 로그인 해주세요.
전체 0
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

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