공지사항처럼 게시판에 카테고리 제목을 바깥 게시판에 보이게 할수있는 코드가 있나요?
<?php echo $content->category1?>
<?php echo $content->category2?>
이렇게 하시면 리스트에서 출력이 가능합니다. 제목 옆에 추가해서 테스트 해주세요.
네;;; 감사합니다
혹시 특정한 kboard 에도 적용할 수 있나요?
그렇다면 리스트에 카테고리를 출력해주셔야죠 ㅎㅎ
처음부터 말씀주시면 더 쉽게 설명해드렸을텐데요 ㅎㅎ
<td class="kboard-list-uid"><?php echo $list->index()?></td> 이부분을
<td class="kboard-list-uid"><?php echo $content->category1?></td> 이렇게 바꿔서 봐보세요.
번호 대신 카테고리를 출력합니다.
게시판 리스트에 '공지사항'처럼 글 번호 대신 카테고리를 나오게 하고싶습니다 ;;
어떤걸 하시려는지 제가 이해가 안가네요 ㅎㅎ
<?php echo isset($_GET['category1'])?$_GET['category1']:'선택된 카테고리 없음'?>
<?php echo isset($_GET['category2'])?$_GET['category2']:'선택된 카테고리 없음'?>
이렇게 하시면 선택된 카테고리가 없다면 '선택된 카테고리 없음' 이라고 나올겁니다.
카테고리를 선택하셨다면 카테고리 이름이 나올겁니다.
이렇게 썻는데 카테고리 출력이 안돼네요~
ㅠㅠ
<div id="kboard-default-list">
<!-- 검색폼 시작 -->
<div class="kboard-header">
<form id="kboard-search-form" method="get" action="<?php echo $url->set('mod', 'list')->toString()?>">
<?php echo $url->set('category1', '')->set('category2', '')->set('pageid', '1')->set('target', '')->set('keyword', '')->set('mod', 'list')->toInput()?>
<?php if($board->use_category == 'yes'):?>
<div class="kboard-category">
<?php if($board->initCategory1()):?>
<?php echo isset($_GET['category1'])?$_GET['category1']:''?>
<select name="category1" onchange="jQuery('#kboard-search-form').submit();">
<option value=""><?php echo __('All', 'kboard')?></option>
<?php while($board->hasNextCategory()):?>
<option value="<?php echo $board->currentCategory()?>"<?php if($_GET['category1'] == $board->currentCategory()):?> selected="selected"<?php endif?>><?php echo $board->currentCategory()?></option>
<?php endwhile?>
</select>
<?php endif?>
<?php if($board->initCategory2()):?>
<?php echo isset($_GET['category2'])?$_GET['category2']:''?>
<select name="category2" onchange="jQuery('#kboard-search-form').submit();">
<option value=""><?php echo __('All', 'kboard')?></option>
<?php while($board->hasNextCategory()):?>
<option value="<?php echo $board->currentCategory()?>"<?php if($_GET['category2'] == $board->currentCategory()):?> selected="selected"<?php endif?>><?php echo $board->currentCategory()?></option>
<?php endwhile?>
</select>
<?php endif?>
</div>
<?php endif?>
<div class="kboard-search">
<select name="target">
<option value=""><?php echo __('All', 'kboard')?></option>
<option value="title"<?php if($_GET['target'] == 'title'):?> selected="selected"<?php endif?>><?php echo __('Title', 'kboard')?></option>
<option value="content"<?php if($_GET['target'] == 'content'):?> selected="selected"<?php endif?>><?php echo __('Content', 'kboard')?></option>
<option value="member_display"<?php if($_GET['target'] == 'member_display'):?> selected="selected"<?php endif?>><?php echo __('Author', 'kboard')?></option>
</select>
<input type="text" name="keyword" value="<?php echo $_GET['keyword']?>">
<button type="submit" class="kboard-default-button-small"><?php echo __('Search', 'kboard')?></button>
</div>
</form>
</div>
<!-- 검색폼 끝 -->
<!-- 리스트 시작 -->
<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-view"><?php echo __('Views', 'kboard')?></td>
</tr>
</thead>
<tbody>
<?php while($content = $list->hasNextNotice()):?>
<tr class="kboard-list-notice">
<td class="kboard-list-uid"><?php echo __('Notice', 'kboard')?></td>
<td class="kboard-list-title"><div class="cut_strings">
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'document')->toString()?>"><?php echo $content->title?></a>
<?php echo $content->getCommentsCount()?>
</div></td>
<td class="kboard-list-user"><?php echo $content->member_display?></td>
<td class="kboard-list-date"><?php echo date("Y.m.d", strtotime($content->date))?></td>
<td class="kboard-list-view"><?php echo $content->view?></td>
</tr>
<?php endwhile?>
<?php while($content = $list->hasNext()):?>
<tr>
<td class="kboard-list-uid"><?php echo $list->index()?></td>
<td class="kboard-list-title"><div class="cut_strings">
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'document')->toString()?>"><?php echo $content->title?>
<?php if($content->secret):?><img src="<?php echo $skin_path?>/images/icon_lock.png" alt="<?php echo __('Secret', 'kboard')?>"><?php endif?>
</a>
<?php echo $content->getCommentsCount()?>
</div></td>
<td class="kboard-list-user"><?php echo $content->member_display?></td>
<td class="kboard-list-date"><?php echo date("Y.m.d", strtotime($content->date))?></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>
<!-- 페이징 끝 -->
<?php if($board->isWriter()):?>
<!-- 버튼 시작 -->
<div class="kboard-control">
<a href="<?php echo $url->set('mod', 'editor')->toString()?>" class="kboard-default-button-small"><?php echo __('New', 'kboard')?></a>
</div>
<!-- 버튼 끝 -->
<?php endif?>
<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>
</div>
그자리에는 아래처럼 해주셔야 합니다.
<?php echo isset($_GET['category1'])?$_GET['category1']:''?>
<?php echo isset($_GET['category2'])?$_GET['category2']:''?>
선택된 카테고리가 없으면 아무 값도 안나올겁니다.
제가말은 제목은 <?php echo $content->title?> 이것, 게시글 제목입니다. 그 지금 삽입하신 위쪽에는 $content 가 초기화 안됐으니 <?php echo $content->category2?> 값이 나오지 않습니다.
여기 표시된 부분에 이렇게 쓰면 돼나요?
<div id="kboard-default-list">
<!-- 검색폼 시작 -->
<div class="kboard-header">
<form id="kboard-search-form" method="get" action="<?php echo $url->set('mod', 'list')->toString()?>">
<?php echo $url->set('category1', '')->set('category2', '')->set('pageid', '1')->set('target', '')->set('keyword', '')->set('mod', 'list')->toInput()?>
<?php if($board->use_category == 'yes'):?>
<div class="kboard-category">
<?php if($board->initCategory1()):?> <?php echo $content->category1?>
<select name="category1" onchange="jQuery('#kboard-search-form').submit();">
<option value=""><?php echo __('All', 'kboard')?></option>
<?php while($board->hasNextCategory()):?>
<option value="<?php echo $board->currentCategory()?>"<?php if($_GET['category1'] == $board->currentCategory()):?> selected="selected"<?php endif?>><?php echo $board->currentCategory()?></option>
<?php endwhile?>
</select>
<?php endif?>
<?php if($board->initCategory2()):?> <?php echo $content->category2?>
<select name="category2" onchange="jQuery('#kboard-search-form').submit();">
<option value=""><?php echo __('All', 'kboard')?></option>
<?php while($board->hasNextCategory()):?>
<option value="<?php echo $board->currentCategory()?>"<?php if($_GET['category2'] == $board->currentCategory()):?> selected="selected"<?php endif?>><?php echo $board->currentCategory()?></option>
<?php endwhile?>
</select>
<?php endif?>
</div>
<?php endif?>
<div class="kboard-search">
<select name="target">
<option value=""><?php echo __('All', 'kboard')?></option>
<option value="title"<?php if($_GET['target'] == 'title'):?> selected="selected"<?php endif?>><?php echo __('Title', 'kboard')?></option>
<option value="content"<?php if($_GET['target'] == 'content'):?> selected="selected"<?php endif?>><?php echo __('Content', 'kboard')?></option>
<option value="member_display"<?php if($_GET['target'] == 'member_display'):?> selected="selected"<?php endif?>><?php echo __('Author', 'kboard')?></option>
</select>
<input type="text" name="keyword" value="<?php echo $_GET['keyword']?>">
<button type="submit" class="kboard-default-button-small"><?php echo __('Search', 'kboard')?></button>
</div>
</form>
</div>
<!-- 검색폼 끝 -->
<!-- 리스트 시작 -->
<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-view"><?php echo __('Views', 'kboard')?></td>
</tr>
</thead>
<tbody>
<?php while($content = $list->hasNextNotice()):?>
<tr class="kboard-list-notice">
<td class="kboard-list-uid"><?php echo __('Notice', 'kboard')?></td>
<td class="kboard-list-title"><div class="cut_strings">
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'document')->toString()?>"><?php echo $content->title?></a>
<?php echo $content->getCommentsCount()?>
</div></td>
<td class="kboard-list-user"><?php echo $content->member_display?></td>
<td class="kboard-list-date"><?php echo date("Y.m.d", strtotime($content->date))?></td>
<td class="kboard-list-view"><?php echo $content->view?></td>
</tr>
<?php endwhile?>
<?php while($content = $list->hasNext()):?>
<tr>
<td class="kboard-list-uid"><?php echo $list->index()?></td>
<td class="kboard-list-title"><div class="cut_strings">
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'document')->toString()?>"><?php echo $content->title?>
<?php if($content->secret):?><img src="<?php echo $skin_path?>/images/icon_lock.png" alt="<?php echo __('Secret', 'kboard')?>"><?php endif?>
</a>
<?php echo $content->getCommentsCount()?>
</div></td>
<td class="kboard-list-user"><?php echo $content->member_display?></td>
<td class="kboard-list-date"><?php echo date("Y.m.d", strtotime($content->date))?></td>
<td class="kboard-list-view"><?php echo $content->view?></td>
</tr>
<?php $boardBuilder->builderReply($content->uid)?>
<?php endwhile?>
</tbody>
</table>
</div>
<!-- 리스트 끝 -->
아무자리가 아니라 bkim0929 님께서 게시글의 카테고리를 표시하고 싶은 자리가 있을텐데 거기가 추가를 해보세요.
그리고 어디에 추가를 했는지 알려주시면 문제해결에 훨씬 수월 할 것같군요.
스킨의 list.php 또는 document.php 파일의 제목 옆에다가 추가를 해서 봐보세요.
아무자리에다가 추가했더니 페이지 에러가 나네요...
정확히 어디 코드 옆인지 알려주실수있을까요....ㅜㅜ
FTP로 접속해서 스킨 파일을 수정해주셔야죠 ㅎㅎ
게시판 리스트 페이지는 list.php 파일입니다.
어디 제목 옆이요? FTP에서 하는게 아닌건가요?
특정한 KBoard라하면 어떤?
스킨을 복사해서 사용해보세요 ㅎㅎ