본문 내용을 리스트에 출력할 때 줄바꿈 문제
안녕하세요.
어제 본 게시판에서 질문드려 시원하게 해결하고 한가지 더 질문 드리고자 합니다..^^;
write.skin.php의 추가필드에서 줄바꿈 적용해서 입력한 내용이 list.skin.php에서도 줄바꿈 된 형태로 나오길 원했는데
<input>태그를 <textarea>로 수정하여 잘 해결했습니다. php 코드에 대한 도움도 받았구요...
지금 질문드리려는 내용은 추가필드가 아닌 본문 내용에 입력한 내용을 list.skin.php에 줄바꿈된 형태로 출력하는 방법입니다.
추가필드에서 본문내용으로 바뀐것 뿐이죠..
write.skin.php
<tr> <th scope="row"><label for="wr_content">내용<strong class="sound_only">필수</strong></label></th> <td class="wr_content"> <?php if($write_min || $write_max) { ?> <!-- 최소/최대 글자 수 사용 시 --> <p id="char_count_desc">이 게시판은 최소 <strong><?php echo $write_min; ?></strong>글자 이상, 최대 <strong><?php echo $write_max; ?></strong>글자 이하까지 글을 쓰실 수 있습니다.</p> <?php } ?> <?php echo $editor_html; // 에디터 사용시는 에디터로, 아니면 textarea 로 노출 ?> <?php if($write_min || $write_max) { ?> <!-- 최소/최대 글자 수 사용 시 --> <div id="char_count_wrap"><span id="char_count"></span>글자</div> <?php } ?> </td> </tr>
list.skin.php
<?php $wr_content = preg_replace("/<(.*?)\>/"," ",$list[$i][wr_content]); $wr_content = preg_replace("/ /"," ",$wr_content); $wr_content = str_replace("//##", " ", $wr_content); $wr_content = cut_str(get_text($wr_content), $content_length, '…'); echo '<div style="display:block;overflow:hidden;padding-top:1.000em;height:80px;line-height:1.500em;border-top:1px solid #ddd;">'; echo nl2br($wr_content); echo '</div>'; ?>
nl2br을 적용하긴 했는데 구현이 안되네요...그 이상의 코드를 수정하기에는 능력의 한계가 있어서...ㅠ.ㅜ
다시한번 고수님들의 도움을 부탁드려보겠습니다...
감사합니다~^^
답변 1개
$wr_content = cut_str(get_text($wr_content), $content_length, '…');
이 부분 제거해주세요.
답변을 작성하려면 로그인이 필요합니다.