코멘트 줄바꿈수정 질문이요 ㅠㅠ 정보
코멘트 줄바꿈수정 질문이요 ㅠㅠ본문
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 :
<!-- 코멘트 출력 -->
<div>
<?
$str = $list[$i][content];
if ($str == '비밀글 입니다.')
$str = "<span class='cloudy small'>$str</span>";
$str = preg_replace("/(\<img )([^\>]*)(\>)/i", "\\1 name='target_resize_image[]' onclick='image_window(this)' style='cursor:pointer;' \\2 \\3", $str);
echo $str;
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(swf)\".*\<\/a\>\]/i", "<script>doc_write(flash_movie('$1://$2.$3'));</script>", $str);
?>
</div>
<? if ($list[$i][trackback]) { echo "<p>".$list[$i][trackback]."</p>"; } ?>
<span id='edit_<?=$comment_id?>' style='display:none;'></span><!-- 수정 -->
<span id='reply_<?=$comment_id?>' style='display:none;'></span><!-- 답변 --> </td>
</tr>
</table>
<? nl2br($list[$i][wr_content]); "<input type=hidden id='secret_comment_{$comment_id}' value='".strstr($list[$i][wr_option],"secret")."'>"; ?>
<table width=100% cellpadding=0 cellspacing=0>
<tr><td colspan=2 height=20></td></tr>
</table><textarea id='save_comment_<?=$comment_id?>' style='display:none;'><?=nl2br($list[$i][wr_content])?></textarea></td>
</tr>
</table>
<? } ?>
</div>
-----------------------------------------
<textarea id='save_comment_<?=$comment_id?>' style='display:none;'><?=nl2br($list[$i][wr_content])?></textarea>
이렇게 수정했는데도 줄바꿈이 되지않고 엔터 친부분이 그냥 띄어쓰기 되서 출력되는데
어디가 잘 못된건지 알 수있을까요??? ㅠㅠㅠㅠ 몇달째 혼자 앓고있는데 꼭 좀 답변 부탁드려요 ㅠㅠㅠㅠㅠㅠㅠㅠㅠ
오류 주소 :
<!-- 코멘트 출력 -->
<div>
<?
$str = $list[$i][content];
if ($str == '비밀글 입니다.')
$str = "<span class='cloudy small'>$str</span>";
$str = preg_replace("/(\<img )([^\>]*)(\>)/i", "\\1 name='target_resize_image[]' onclick='image_window(this)' style='cursor:pointer;' \\2 \\3", $str);
echo $str;
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(swf)\".*\<\/a\>\]/i", "<script>doc_write(flash_movie('$1://$2.$3'));</script>", $str);
?>
</div>
<? if ($list[$i][trackback]) { echo "<p>".$list[$i][trackback]."</p>"; } ?>
<span id='edit_<?=$comment_id?>' style='display:none;'></span><!-- 수정 -->
<span id='reply_<?=$comment_id?>' style='display:none;'></span><!-- 답변 --> </td>
</tr>
</table>
<? nl2br($list[$i][wr_content]); "<input type=hidden id='secret_comment_{$comment_id}' value='".strstr($list[$i][wr_option],"secret")."'>"; ?>
<table width=100% cellpadding=0 cellspacing=0>
<tr><td colspan=2 height=20></td></tr>
</table><textarea id='save_comment_<?=$comment_id?>' style='display:none;'><?=nl2br($list[$i][wr_content])?></textarea></td>
</tr>
</table>
<? } ?>
</div>
-----------------------------------------
<textarea id='save_comment_<?=$comment_id?>' style='display:none;'><?=nl2br($list[$i][wr_content])?></textarea>
이렇게 수정했는데도 줄바꿈이 되지않고 엔터 친부분이 그냥 띄어쓰기 되서 출력되는데
어디가 잘 못된건지 알 수있을까요??? ㅠㅠㅠㅠ 몇달째 혼자 앓고있는데 꼭 좀 답변 부탁드려요 ㅠㅠㅠㅠㅠㅠㅠㅠㅠ
댓글 전체
첫번째 라인에서
$str = $list[$i][content];
위 부분을
$str=nl2br($list[$i]['content']);
로 바꿔보세요.
소스상 혹시 댓글부분도 에디터를 사용하시는지요? 태그허용댓글스타일이라,
자동줄바꿈에 대한 처리가 되어있지 않은 것 같기도 해서.
$str = $list[$i][content];
위 부분을
$str=nl2br($list[$i]['content']);
로 바꿔보세요.
소스상 혹시 댓글부분도 에디터를 사용하시는지요? 태그허용댓글스타일이라,
자동줄바꿈에 대한 처리가 되어있지 않은 것 같기도 해서.
<? nl2br($list[$i][wr_content]); "<input type=hidden id='secret_comment_{$comment_id}' value='".strstr($list[$i][wr_option],"secret")."'>"; ?> 를
<?php echo 혹은 <?= 로 변경해주셔야 하구요.
<textarea><?=$list[$i]['wr_content'];?></textarea>
자스에서
$("#save_comment_<?=$comment_id?>").html().replace('\n', '<br>'); 해주심 될듯 한데요.
<?php echo 혹은 <?= 로 변경해주셔야 하구요.
<textarea><?=$list[$i]['wr_content'];?></textarea>
자스에서
$("#save_comment_<?=$comment_id?>").html().replace('\n', '<br>'); 해주심 될듯 한데요.