default 게시판 관련 문의드립니다.

안녕하세요 
default 스킨을 복사하여
default2 스킨을 만들었습니다.

그 뒤 default2 게시판에 필드추가를 하였습니다. 

추가필드는    1. 계약일   2.금액    3.기타 
1.메타키를 (ymd)  2. 메타키를 (money)   3. 메타키를  (etc) 이렇게 하여 추가한 후 

-------------------------------------------------------------------------------------------------------------------------

리스트화면 상단에

번호    제목    작성자   작성일   추천    조회 

번호    제목    계약일    금액    기타   

저런식으로 나오게 하고 싶습니다.
어떻게 수정해야할까요?

답변 부탁드려용~

 

워드프레스 에러 기술지원 서비스 전문가에게 맡기세요
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
  • 안녕하세요~^^

    KBoard 플러그인에서 별도로 필드를 추가하셨다면

    필드 값은 아래 코드로 표시하실 수 있습니다.

    <?php echo $content->option->{'메타키'}?>

    위의 코드에서 메타키는 실제 필드의 메타키로 적용해보세요.

     

    워드프레스 관리자 -> KBoard -> 게시판 목록 -> 게시판 선택 -> 입력필드 설정 탭에서

    해당 필드의 스킨 출력 예제 쪽에서도 위의 코드를 확인해보실 수 있습니다.

     

    게시글 목록 페이지는

    FTP로 접속해서 /wp-content/plugins/kboard/skin/사용중인스킨/list.php 파일에서 표시하고 있습니다.

     

    아래 링크를 참고해서 스킨 파일을 수정해보시겠어요?

    https://www.cosmosfarm.com/threads/document/25279

    고맙습니다.

  • 1. FTP로 접속해서 /wp-content/plugins/kboard/skin/사용중인스킨/list.php 파일에

    아래의 코드를 찾아서
     

    <td class="kboard-list-title"><?php echo __('Title', 'kboard')?></td>

    찾은 코드 밑에 아래의 코드를 추가해보세요.

    (op1 이라는 메타이름이며 추가된 필드)

    <td class="kboard-list-op1">계약년월일</td>

    2. 아래의 코드를 찾아서

    <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-op1"><?php echo $content->option->op1?></td>

    확인부탁드립니당.


    전체코드입니다.

     

    <div id="kboard-default-list">
    	
    	<!-- 게시판 정보 시작 -->
    	<div class="kboard-list-header">
    		<?php if(!$board->isPrivate()):?>
    			<div class="kboard-total-count">
    				<?php echo __('Total', 'kboard')?> <?php echo number_format($board->getListTotal())?>
    			</div>
    		<?php endif?>
    		
    		<div class="kboard-sort">
    			<form id="kboard-sort-form-<?php echo $board->id?>" method="get" action="<?php echo $url->toString()?>">
    				<?php echo $url->set('pageid', '1')->set('category1', '')->set('category2', '')->set('target', '')->set('keyword', '')->set('mod', 'list')->set('kboard_list_sort_remember', $board->id)->toInput()?>
    				
    				<select name="kboard_list_sort" onchange="jQuery('#kboard-sort-form-<?php echo $board->id?>').submit();">
    					<option value="newest"<?php if($list->getSorting() == 'newest'):?> selected<?php endif?>><?php echo __('Newest', 'kboard')?></option>
    					<option value="best"<?php if($list->getSorting() == 'best'):?> selected<?php endif?>><?php echo __('Best', 'kboard')?></option>
    					<option value="viewed"<?php if($list->getSorting() == 'viewed'):?> selected<?php endif?>><?php echo __('Viewed', 'kboard')?></option>
    					<option value="updated"<?php if($list->getSorting() == 'updated'):?> selected<?php endif?>><?php echo __('Updated', 'kboard')?></option>
    				</select>
    			</form>
    		</div>
    	</div>
    	<!-- 게시판 정보 끝 -->
    	
    	<!-- 카테고리 시작 -->
    	<?php
    	if($board->use_category == 'yes'){
    		if($board->isTreeCategoryActive()){
    			$category_type = 'tree-select';
    		}
    		else{
    			$category_type = 'default';
    		}
    		$category_type = apply_filters('kboard_skin_category_type', $category_type, $board, $boardBuilder);
    		echo $skin->load($board->skin, "list-category-{$category_type}.php", $vars);
    	}
    	?>
    	<!-- 카테고리 끝 -->
    	
    	<!-- 리스트 시작 -->
    	<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-op1">계약년월일</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->getDocumentURLWithUID($content->uid)?>">
    							<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 kboard-user"><?php echo apply_filters('kboard_user_display', $content->member_display, $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></span>
    							<span class="contents-separator kboard-date">|</span>
    							<span class="contents-item kboard-date"><?php echo $content->getDate()?></span>
    							<span class="contents-separator kboard-vote">|</span>
    							<span class="contents-item kboard-vote"><?php echo __('Votes', 'kboard')?> <?php echo $content->vote?></span>
    							<span class="contents-separator kboard-view">|</span>
    							<span class="contents-item kboard-view"><?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-op1"><?php echo $content->option->op1?></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->getDocumentURLWithUID($content->uid)?>">
    							<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 kboard-user"><?php echo apply_filters('kboard_user_display', $content->member_display, $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></span>
    							<span class="contents-separator kboard-date">|</span>
    							<span class="contents-item kboard-date"><?php echo $content->getDate()?></span>
    							<span class="contents-separator kboard-vote">|</span>
    							<span class="contents-item kboard-vote"><?php echo __('Votes', 'kboard')?> <?php echo $content->vote?></span>
    							<span class="contents-separator kboard-view">|</span>
    							<span class="contents-item kboard-view"><?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>
    	<!-- 리스트 끝 -->
    	
    	<!-- 페이징 시작 -->
    	<div class="kboard-pagination">
    		<ul class="kboard-pagination-pages">
    			<?php echo kboard_pagination($list->page, $list->total, $list->rpp)?>
    		</ul>
    	</div>
    	<!-- 페이징 끝 -->
    	
    	<!-- 검색폼 시작 -->
    	<div class="kboard-search">
    		<form id="kboard-search-form-<?php echo $board->id?>" method="get" action="<?php echo $url->toString()?>">
    			<?php echo $url->set('pageid', '1')->set('target', '')->set('keyword', '')->set('mod', 'list')->toInput()?>
    			
    			<select name="target">
    				<option value=""><?php echo __('All', 'kboard')?></option>
    				<option value="title"<?php if(kboard_target() == 'title'):?> selected<?php endif?>><?php echo __('Title', 'kboard')?></option>
    				<option value="content"<?php if(kboard_target() == 'content'):?> selected<?php endif?>><?php echo __('Content', 'kboard')?></option>
    				<option value="member_display"<?php if(kboard_target() == 'member_display'):?> selected<?php endif?>><?php echo __('Author', 'kboard')?></option>
    			</select>
    			<input type="text" name="keyword" value="<?php echo kboard_keyword()?>">
    			<button type="submit" class="kboard-default-button-small"><?php echo __('Search', 'kboard')?></button>
    		</form>
    	</div>
    	<!-- 검색폼 끝 -->
    	
    	<?php if($board->isWriter()):?>
    	<!-- 버튼 시작 -->
    	<div class="kboard-control">
    		<a href="<?php echo $url->getContentEditor()?>" class="kboard-default-button-small"><?php echo __('New', 'kboard')?></a>
    	</div>
    	<!-- 버튼 끝 -->
    	<?php endif?>
    	
    	<?php if($board->contribution()):?>
    	<div class="kboard-default-poweredby">
    		<a href="http://www.cosmosfarm.com/products/kboard" onclick="window.open(this.href);return false;" title="<?php echo __('KBoard is the best community software available for WordPress', 'kboard')?>">Powered by KBoard</a>
    	</div>
    	<?php endif?>
    </div>

     

  • 올려주신 코드를 보면 공지사항을 표시하는 쪽에만 코드가 적용되어 있습니다.

    일반 게시글 목록을 표시하는 코드 쪽에도 추가해보시겠어요?

    이전 댓글에 안내해드린 링크에 해당 내용도 포함되어 있습니다.

    고맙습니다.

좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기