에디터 게시판으로 변경후 뷰화면 소스출력~ 정보
에디터 게시판으로 변경후 뷰화면 소스출력~본문
안녕하세요~
정상적으로 write.skin.php부분을 에디터 게시판으로 전환했습니다.
기본적으로 일반 웹문서를 드래그해서 복사하면 그대로 write.skin.php 글쓰기 폼에
그림 부터 일반 표까지 잘 입력이 됩니다. 그런데 뷰화면으로 출력하면 모두 html소스로
출력되어 나옵니다. 혹시 제가 잘못적용 하질 않았나 일반 basic게시판 부분의 wirte.skin.php부분으로 에디터화 했는데 모두 입력으 잘되는데 출력시 모두 html소스로 보여집니다~
일반 글 입력시에는 정상 출력되는데 일반 웹문서를 그대로 붙이는 문서는 꼭 소스가 출력되거든요~ 해결 방법이 있을까요
------------> 수정했던 소스는 아래 소스를 참조해서 변경했었습니다~
write.skin.php 파일의
1. 꼭대기
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
부분을
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$g4[path]/lib/cheditor.lib.php");
if ($w != 'u') $content = '';
?>
<script src="<?=$g4[editor_path]?>/cheditor.js"></script>
<?=cheditor1('wr_content', $content);?>
으로
2. 중간 '내용' 입력부분을
<td style='padding:5 0 5 0;'>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td width=50% align=left valign=bottom>
<span style="cursor: pointer;" onclick="textarea_decrease('wr_content', 10);"><img src="<?=$board_skin_path?>/img/up.gif"></span>
<span style="cursor: pointer;" onclick="textarea_original('wr_content', 10);"><img src="<?=$board_skin_path?>/img/start.gif"></span>
<span style="cursor: pointer;" onclick="textarea_increase('wr_content', 10);"><img src="<?=$board_skin_path?>/img/down.gif"></span></td>
<td width=50% align=right><? if ($write_min || $write_max) { ?><span id=char_count></span>글자<?}?></td>
</tr>
</table>
<textarea id=wr_content name=wr_content class=tx style='width:100%; word-break:break-all;' rows=10 itemname="내용" required
<? if ($write_min || $write_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?}?>><?=$content?></textarea>
<? if ($write_min || $write_max) { ?><script language="javascript"> check_byte('wr_content', 'char_count'); </script><?}?></td>
을 통채로 주석처리하시거나 삭제하시고
<td style='padding:5 0 5 0;'><?=cheditor2('fwrite', 'wr_content', '100%', '350');?></td>
으로
3. 마지막 파일 끝부분
document.getElementById('btn_submit').disabled = true;
document.getElementById('btn_list').disabled = true;
f.action = "./write_update.php";
f.submit();
}
을
document.getElementById('btn_submit').disabled = true;
document.getElementById('btn_list').disabled = true;
<?=cheditor3('wr_content');?>
f.action = "./write_update.php";
f.submit();
}
1. 꼭대기
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
부분을
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$g4[path]/lib/cheditor.lib.php");
if ($w != 'u') $content = '';
?>
<script src="<?=$g4[editor_path]?>/cheditor.js"></script>
<?=cheditor1('wr_content', $content);?>
으로
2. 중간 '내용' 입력부분을
<td style='padding:5 0 5 0;'>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td width=50% align=left valign=bottom>
<span style="cursor: pointer;" onclick="textarea_decrease('wr_content', 10);"><img src="<?=$board_skin_path?>/img/up.gif"></span>
<span style="cursor: pointer;" onclick="textarea_original('wr_content', 10);"><img src="<?=$board_skin_path?>/img/start.gif"></span>
<span style="cursor: pointer;" onclick="textarea_increase('wr_content', 10);"><img src="<?=$board_skin_path?>/img/down.gif"></span></td>
<td width=50% align=right><? if ($write_min || $write_max) { ?><span id=char_count></span>글자<?}?></td>
</tr>
</table>
<textarea id=wr_content name=wr_content class=tx style='width:100%; word-break:break-all;' rows=10 itemname="내용" required
<? if ($write_min || $write_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?}?>><?=$content?></textarea>
<? if ($write_min || $write_max) { ?><script language="javascript"> check_byte('wr_content', 'char_count'); </script><?}?></td>
을 통채로 주석처리하시거나 삭제하시고
<td style='padding:5 0 5 0;'><?=cheditor2('fwrite', 'wr_content', '100%', '350');?></td>
으로
3. 마지막 파일 끝부분
document.getElementById('btn_submit').disabled = true;
document.getElementById('btn_list').disabled = true;
f.action = "./write_update.php";
f.submit();
}
을
document.getElementById('btn_submit').disabled = true;
document.getElementById('btn_list').disabled = true;
<?=cheditor3('wr_content');?>
f.action = "./write_update.php";
f.submit();
}
댓글 전체

에디터를 사용하면 다음과 같이 히든으로 값을 넘깁니다.
<input type=hidden value="html1" name="html">
<? if ($is_notice || $is_html || $is_secret || $is_mail) { ?>
<tr>
<td style='padding-left:20px; height:30px;'>· 옵션</td>
<td><? if ($is_notice) { ?><input type=checkbox name=notice value="1" <?=$notice_checked?>>공지 <? } ?>
<? if ($is_html) { ?>
<? if ($is_dhtml_editor) { ?>
<input type=hidden value="html1" name="html">
<? } else { ?>
<input onclick="html_auto_br(this);" type=checkbox value="<?=$html_value?>" name="html" <?=$html_checked?>><span class=w_title>html</span>
<? } ?>
<? } ?>
<? if ($is_secret) { ?>
<? if ($is_admin || $is_secret==1) { ?>
<input type=checkbox value="secret" name="secret" <?=$secret_checked?>><span class=w_title>비밀글</span>
<? } else { ?>
<input type=hidden value="secret" name="secret">
<? } ?>
<? } ?>
<? if ($is_mail) { ?><input type=checkbox value="mail" name="mail" <?=$recv_email_checked?>>답변메일받기 <? } ?></td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>
<input type=hidden value="html1" name="html">
<? if ($is_notice || $is_html || $is_secret || $is_mail) { ?>
<tr>
<td style='padding-left:20px; height:30px;'>· 옵션</td>
<td><? if ($is_notice) { ?><input type=checkbox name=notice value="1" <?=$notice_checked?>>공지 <? } ?>
<? if ($is_html) { ?>
<? if ($is_dhtml_editor) { ?>
<input type=hidden value="html1" name="html">
<? } else { ?>
<input onclick="html_auto_br(this);" type=checkbox value="<?=$html_value?>" name="html" <?=$html_checked?>><span class=w_title>html</span>
<? } ?>
<? } ?>
<? if ($is_secret) { ?>
<? if ($is_admin || $is_secret==1) { ?>
<input type=checkbox value="secret" name="secret" <?=$secret_checked?>><span class=w_title>비밀글</span>
<? } else { ?>
<input type=hidden value="secret" name="secret">
<? } ?>
<? } ?>
<? if ($is_mail) { ?><input type=checkbox value="mail" name="mail" <?=$recv_email_checked?>>답변메일받기 <? } ?></td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>
에디터를 사용하면 다음과 같이 히든으로 값을 넘깁니다.
<input type=hidden value="html1" name="html">
값을 넘겨도 마찬가지입니다~ 질문전에 html체크 상태로 wirte.skin.php에 복사한 웹페이지
넣은 내용은 정상 출력되긴 했지만 상하단 값 간격이 너무 벌어져서 체크하지 않은 상태에서
해결 할 수 있는 방법이 없을까해서 질문드렸습니다~ 답변 감사드립니다~
<input type=hidden value="html1" name="html">
값을 넘겨도 마찬가지입니다~ 질문전에 html체크 상태로 wirte.skin.php에 복사한 웹페이지
넣은 내용은 정상 출력되긴 했지만 상하단 값 간격이 너무 벌어져서 체크하지 않은 상태에서
해결 할 수 있는 방법이 없을까해서 질문드렸습니다~ 답변 감사드립니다~
제가 착각했어요~ 님께서 올려주신 소스의
<? if ($is_html) { ?>
<? if ($is_dhtml_editor) { ?>
<input type=hidden value="html1" name="html">
<? } else { ?>
<input onclick="html_auto_br(this);" type=checkbox value="<?=$html_value?>" name="html" <?=$html_checked?>><span class=w_title>html</span>
<? } ?>
<? } ?>
까지 넣었던게 아니였는데 제가 잘못적용했네요!
<input type=hidden value="html1" name="html">
부분만 넘기면 될것을~ 즐거운 하루되세요!!
<? if ($is_html) { ?>
<? if ($is_dhtml_editor) { ?>
<input type=hidden value="html1" name="html">
<? } else { ?>
<input onclick="html_auto_br(this);" type=checkbox value="<?=$html_value?>" name="html" <?=$html_checked?>><span class=w_title>html</span>
<? } ?>
<? } ?>
까지 넣었던게 아니였는데 제가 잘못적용했네요!
<input type=hidden value="html1" name="html">
부분만 넘기면 될것을~ 즐거운 하루되세요!!