php 문외한이라 설명들 보고 따라 하다가 막혀서 질문드립니다.
customer 스킨을 수정해서 새로 게시판을 만드려고 합니다.
국가 선택란, 이메일 필드를 추가하고 글목록 리스트 화면에 상단바에서도 보이게 하고 싶은데
글 화면에 입력값이 글 화면에 안 나타나네요.
또 list.php 파일에서 어디를 건드려야 글목록 상단바에도 국가 이메일 란이 추가될 수 있을지 도와주세요..
■ customer 스킨에서 editor.php 파일 수정해서 국가선택란, 이메일 필드를 추가했습니다.
■ eidtor.php ■
<!--국가-->
<div class="kboard-attr-row">
<label class="attr-name">
<?php echo __('국가', 'kboard')?>
</label>
<div class="attr-value">
<select name="kboard_option_newoptionID" value="<?php echo $content->option->yourcountry?>">
<option value="">–국가 선택–</option>
<option value="Korea"<?php if($content->option->location == 'Korea'):?> selected<?php endif?>>대한민국</option>
</select>
</div>
</div>
<!--END-->
<!--New Label-Email-->
<div class="kboard-attr-row">
<label class="attr-name">
<?php echo __('Email', 'kboard')?>
</label>
<div class="attr-value">
<input name="kboard-option-useremail" type="text" value="<?php echo $content->option->useremail?>">
</div>
</div>
<!--END-->
■ 글 화면에 입력값이 나오도록 document.php 파일에서 아래를 추가했습니다. 근데 입력값이 안뜹니다........
■ document.php ■
<!--국가선택-->
<div class="detail-attr detail-view">
<div class="detail-name">
<?php echo __('국가', 'kboard')?>
</div>
<div class="detail-value">
<?php echo $content->option->yourcountry?>
</div>
</div>
<!--End-->
<!-- Display New Label Email-->
<div class="detail-attr detail-view">
<div class="detail-name">
<?php echo __('Email', 'kboard')?>
</div>
<div class="detail-value">
<?php echo $content->option->useremail?>
</div>
</div>
<!--End-->
■ list.php ■ list.php 파일에서 어디를 건드려야 글목록 상단바에도 국가 이메일 란이 추가될까요?
<!-- 리스트 시작 -->
<div class="kboard-list">
<table>
<thead>
<tr>
<td class="kboard-list-uid"><?php echo __('Number', 'kboard')?></td>
<td class="kboard-list-title"><?php echo __('Title', 'kboard')?></td>
<td class="kboard-list-user"><?php echo __('Author', 'kboard')?></td>
<td class="kboard-list-date"><?php echo __('Date', 'kboard')?></td>
<td class="kboard-list-vote"><?php echo __('Votes', 'kboard')?></td>
<td class="kboard-list-view"><?php echo __('Views', 'kboard')?></td>
</tr>
</thead>
<tbody>
<?php while($content = $list->hasNextNotice()):?>
<tr class="kboard-list-notice<?php if($content->uid == kboard_uid()):?> kboard-list-selected<?php endif?>">
<td class="kboard-list-uid"><?php echo __('Notice', 'kboard')?></td>
<td class="kboard-list-title">
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'document')->toString()?>">
<div class="kboard-customer-cut-strings">
<?php if($content->secret):?><img src="<?php echo $skin_path?>/images/icon-lock.png" alt="<?php echo __('Secret', 'kboard')?>"><?php endif?>
<?php if($content->isNew()):?><span class="kboard-customer-new-notify">New</span><?php endif?>
<?php echo $content->title?>
<span class="kboard-comments-count"><?php echo $content->getCommentsCount()?></span>
</div>
</a>
<div class="kboard-mobile-contents">
<span class="contents-item"><?php echo apply_filters('kboard_user_display', $content->member_display, $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo $content->getDate()?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo __('Votes', 'kboard')?> <?php echo $content->vote?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo __('Views', 'kboard')?> <?php echo $content->view?></span>
</div>
</td>
<td class="kboard-list-user"><?php echo apply_filters('kboard_user_display', $content->member_display, $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></td>
<td class="kboard-list-date"><?php echo $content->getDate()?></td>
<td class="kboard-list-vote"><?php echo $content->vote?></td>
<td class="kboard-list-view"><?php echo $content->view?></td>
</tr>
<?php endwhile?>
<?php while($content = $list->hasNext()):?>
<tr class="<?php if($content->uid == kboard_uid()):?>kboard-list-selected<?php endif?>">
<td class="kboard-list-uid"><?php echo $list->index()?></td>
<td class="kboard-list-title">
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'document')->toString()?>">
<div class="kboard-customer-cut-strings">
<?php if($content->isNew()):?><span class="kboard-customer-new-notify">New</span><?php endif?>
<?php if($content->secret):?><img src="<?php echo $skin_path?>/images/icon-lock.png" alt="<?php echo __('Secret', 'kboard')?>"><?php endif?>
<?php echo $content->title?>
<span class="kboard-comments-count"><?php echo $content->getCommentsCount()?></span>
</div>
</a>
<div class="kboard-mobile-contents">
<span class="contents-item"><?php echo apply_filters('kboard_user_display', $content->member_display, $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo $content->getDate()?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo __('Votes', 'kboard')?> <?php echo $content->vote?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo __('Views', 'kboard')?> <?php echo $content->view?></span>
</div>
</td>
<td class="kboard-list-user"><?php echo apply_filters('kboard_user_display', $content->member_display, $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></td>
<td class="kboard-list-date"><?php echo $content->getDate()?></td>
<td class="kboard-list-vote"><?php echo $content->vote?></td>
<td class="kboard-list-view"><?php echo $content->view?></td>
</tr>
<?php $boardBuilder->builderReply($content->uid)?>
<?php endwhile?>
</tbody>
</table>
</div>
<!-- 리스트 끝 -->
teble 태그에 대해서 알아보세요.
스킨의 list.php 파일에서 아래처럼 하시면 될 듯합니다~^^
<table>
<thead>
<tr>
<td class="kboard-list-uid"><?php echo __('Number', 'kboard')?></td>
<td class="">국가</td>
<td class="kboard-list-title"><?php echo __('Title', 'kboard')?></td>
<td class="kboard-list-user"><?php echo __('Author', 'kboard')?></td>
<td class="">이메일</td>
<td class="kboard-list-date"><?php echo __('Date', 'kboard')?></td>
<td class="kboard-list-vote"><?php echo __('Votes', 'kboard')?></td>
<td class="kboard-list-view"><?php echo __('Views', 'kboard')?></td>
</tr>
</thead>
<tbody>
<?php while($content = $list->hasNextNotice()):?>
<tr class="kboard-list-notice<?php if($content->uid == kboard_uid()):?> kboard-list-selected<?php endif?>">
<td class="kboard-list-uid"><?php echo __('Notice', 'kboard')?></td>
<td class=""><?php echo $content->option->yourcountry?></td>
<td class="kboard-list-title">
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'document')->toString()?>">
<div class="kboard-default-cut-strings">
<?php if($content->isNew()):?><span class="kboard-default-new-notify">New</span><?php endif?>
<?php if($content->secret):?><img src="<?php echo $skin_path?>/images/icon-lock.png" alt="<?php echo __('Secret', 'kboard')?>"><?php endif?>
<?php echo $content->title?>
<span class="kboard-comments-count"><?php echo $content->getCommentsCount()?></span>
</div>
</a>
<div class="kboard-mobile-contents">
<span class="contents-item"><?php echo apply_filters('kboard_user_display', $content->member_display, $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo $content->getDate()?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo __('Votes', 'kboard')?> <?php echo $content->vote?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo __('Views', 'kboard')?> <?php echo $content->view?></span>
</div>
</td>
<td class="kboard-list-user"><?php echo apply_filters('kboard_user_display', $content->member_display, $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></td>
<td class=""><?php echo $content->option->useremail?></td>
<td class="kboard-list-date"><?php echo $content->getDate()?></td>
<td class="kboard-list-vote"><?php echo $content->vote?></td>
<td class="kboard-list-view"><?php echo $content->view?></td>
</tr>
<?php endwhile?>
<?php while($content = $list->hasNext()):?>
<tr class="<?php if($content->uid == kboard_uid()):?>kboard-list-selected<?php endif?>">
<td class="kboard-list-uid"><?php echo $list->index()?></td>
<td class=""><?php echo $content->option->yourcountry?></td>
<td class="kboard-list-title">
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'document')->toString()?>">
<div class="kboard-default-cut-strings">
<?php if($content->isNew()):?><span class="kboard-default-new-notify">New</span><?php endif?>
<?php if($content->secret):?><img src="<?php echo $skin_path?>/images/icon-lock.png" alt="<?php echo __('Secret', 'kboard')?>"><?php endif?>
<?php echo $content->title?>
<span class="kboard-comments-count"><?php echo $content->getCommentsCount()?></span>
</div>
</a>
<div class="kboard-mobile-contents">
<span class="contents-item"><?php echo apply_filters('kboard_user_display', $content->member_display, $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo $content->getDate()?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo __('Votes', 'kboard')?> <?php echo $content->vote?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo __('Views', 'kboard')?> <?php echo $content->view?></span>
</div>
</td>
<td class="kboard-list-user"><?php echo apply_filters('kboard_user_display', $content->member_display, $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></td>
<td class=""><?php echo $content->option->useremail?></td>
<td class="kboard-list-date"><?php echo $content->getDate()?></td>
<td class="kboard-list-vote"><?php echo $content->vote?></td>
<td class="kboard-list-view"><?php echo $content->view?></td>
</tr>
<?php $boardBuilder->builderReply($content->uid)?>
<?php endwhile?>
</tbody>
</table>
오타때문이었네요! 감사합니다. 수정하니 입력값이 나옵니다 정말 감사드려요
근데 list.php 파일은 제가 질문을 잘못드린 것 같은데
번호 (((국가))) 제목 작성자 (((이메일))) 작성일 추천 조회
이렇게 사이에 상단바에 국가랑 이메일 칸을 추가해서 밑으로 값이 나오게 하고싶습니다!
방법좀알려주세요~~~~
원리는 단순합니다.
또한 PHP 코드보다는 HTML 코드만 사용하셔도 필드는 충분히 추하실 수 있으니 어렵게 생각하지 마세요~^^
아래는 직접 작성하신 코드입니다.
조금 잘못되어 있습니다.
<select name="kboard_option_newoptionID" value="<?php echo $content->option->yourcountry?>">
<input name="kboard-option-useremail" type="text" value="<?php echo $content->option->useremail?>">
아래처럼 작성해주셔야 합니다.
<select name="kboard_option_yourcountry" value="<?php echo $content->option->yourcountry?>">
<input name="kboard_option_useremail" type="text" value="<?php echo $content->option->useremail?>">
list.php 파일에서는
<?php echo $content->title?> 코드 옆에 출력 코드를 추가해보세요.
<?php echo $content->title?> <?php echo $content->option->useremail?> <?php echo $content->option->yourcountry?>
코드가 정상적으로 나오는걸 확인 한 후에 적절히 배치해주시면 될 듯합니다.