default 스킨을 방명록 스타일로 수정하고 싶어서 진행중입니다.
document 와 list를 합쳐서 while 문 사이에 content를 출력하게 했습니다.
소스를 붙이기 전에 2가지 문제가 있습니다.
1. 본문이 표시는 되지만 줄바꿈이 사라져버립니다.
2. 대댓글의 기능이 이상해집니다. 현재 본문이 표시된 글갯수만큼 대댓글 입력창이 나타나지만 입력은 안됩니다.
## list.php ##
<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()):?>
<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()):?>
<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>
</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 if ($content->member_uid > 0) echo '<b>'; ?><?php echo $content->member_display?><?php if ($content->member_uid > 0) echo '</b>'; ?></td>
<td class="kboard-list-date"><?php echo date("Y.m.d", strtotime($content->date))?></td>
</tr>
<?php endwhile?>
<!-- 공지사항 끝 -->
</tbody>
</table>
</div>
<!-- 리스트 끝 -->
</div>
<div id="kboard-default-document">
<div class="kboard-header"></div>
<!-- 일반 글 시작 -->
<?php while($content = $list->hasNext()):?>
<div class="kboard-document-wrap" itemscope itemtype="http://schema.org/Article">
<div class="kboard-title" itemprop="name">
<p><?php echo $content->title?></p>
</div>
<div class="kboard-detail">
<?php if($content->category1):?>
<div class="detail-attr detail-category1">
<div class="detail-name"><?php echo $content->category1?></div>
</div>
<?php endif?>
<?php if($content->category2):?>
<div class="detail-attr detail-category2">
<div class="detail-name"><?php echo $content->category2?></div>
</div>
<?php endif?>
<div class="detail-attr detail-writer">
<div class="detail-name"><?php echo __('Author', 'kboard')?></div>
<div class="detail-value"><?php if ($content->member_uid > 0) echo '<b>'; ?><?php echo $content->member_display?><?php if ($content->member_uid > 0) echo '</b>'; ?></div>
</div>
<div class="detail-attr detail-date">
<div class="detail-name"><?php echo __('Date', 'kboard')?></div>
<div class="detail-value"><?php echo date('Y-m-d H:i', strtotime($content->date))?></div>
</div>
</div>
<div class="kboard-content" itemprop="description" >
<div class="content-view" >
<?php echo $content->content?>
</div>
</div>
<?php if(isset($content->attach->file1)):?>
<div class="kboard-attach">
<?php echo __('Attachment', 'kboard')?> : <a href="<?php echo $url->getDownloadURLWithAttach($content->uid, 'file1')?>"><?php echo $content->attach->file1[1]?></a>
</div>
<?php endif?>
<?php if(isset($content->attach->file2)):?>
<div class="kboard-attach">
<?php echo __('Attachment', 'kboard')?> : <a href="<?php echo $url->getDownloadURLWithAttach($content->uid, 'file2')?>"><?php echo $content->attach->file2[1]?></a>
</div>
<?php endif?>
</div>
<?php if($board->isComment()):?>
<div class="kboard-comments-area"><?php echo $board->buildComment($content->uid)?></div>
<?php endif?>
<!--
<?php $boardBuilder->builderReply($content->uid)?>
-->
<div class="kboard-control">
<!--
<div class="left">
<a href="<?php echo $url->toString()?>" class="kboard-default-button-small"><?php echo __('List', 'kboard')?></a>
<?php if($board->isWriter() && !$content->notice):?><a href="<?php echo $url->set('parent_uid', $content->uid)->set('mod', 'editor')->toString()?>" class="kboard-default-button-small"><?php echo __('Reply', 'kboard')?></a><?php endif?>
</div>-->
<?php if($board->isEditor($content->member_uid) || $board->permission_write=='all'):?>
<div class="right">
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'editor')->toString()?>" class="kboard-default-button-small"><?php echo __('Edit', 'kboard')?></a>
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'remove')->toString()?>" class="kboard-default-button-small" onclick="return confirm('<?php echo __('Are you sure you want to delete?', 'kboard')?>');"><?php echo __('Delete', 'kboard')?></a>
</div>
<?php endif?>
</div>
<?php endwhile?>
</div>
<div id="kboard-default-list">
<!-- 페이징 시작 -->
<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 $content->content?>
위 코드를 아래처럼 변경해보시겠어요?
<?php echo nl2br($content->content)?>
그리고 댓글은.. 이렇게는 테스트 해보지 않아서 문제의 원인을 모르겠군요.
테스트 가능한 페이지 주소를 알려주시면 테스트 해보겠습니다.
KBoard 게시판과 댓글은 모두 최신버전인가요?
네 모두 최신 버전입니다.
분문 출력을 말씀해주신 부분으로 수정해서 잘 출력이 됩니다.
일단 서비스 게시판은 댓글 스킨을 변경해서 대댓글을 아예 못달게 했는데요.
대댓글의 이상 현상은 http://soniarma.com/?page_id=225 주소에서 확인하실 수 있습니다.