배추 베이직 스킨에 cheditor 간단 적용법 정보
배추 베이직 스킨에 cheditor 간단 적용법관련링크
본문
배추빌더를 사용하시는 분들은 '배추빌더 메뉴얼' 보시면 되겠습니다.
이 팁은 빌더는 다른 빌더 쓰면서 게시판 스킨만 배추 베이직 스킨을 쓰시는 분들만 해당 됩니다.
배추 베이직 스킨은 지에디터가 적용이 되었습니다.
그래서 cheditor 적용이 좀 까다로운데, 적용하는 방법을 알아내었습니다.
일단,
write.skin.php 파일을 엽니다.
----------------------------------------------------------------------------
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if ($is_dhtml_editor) {
include_once("$g4[path]/lib/cheditor4.lib.php");
echo "<script src='$g4[cheditor4_path]/cheditor.js'></script>";
echo cheditor1('wr_content', '100%', '250');
}
include_once("$board_skin_path/mw.lib/mw.skin.basic.lib.php");
// 한 사람당 글 한개만 등록가능
-----------------------------------------------------------------------------
상단에 이렇게 바꿔주시고요.
그 다음 내용 부분에
-----------------------------------------------------------------------------
<tr>
<td class=mw_basic_write_title>· 내용</td>
<td style='padding:5 0 5 0;'>
<? if ($is_dhtml_editor) { ?>
<?=cheditor2('wr_content', $content);?>
<? } else { ?>
<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>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
-----------------------------------------------------------------------------
이렇게 바꿔주시면 글쓰기 창에선 cheditor가 잘 보이게 됩니다.
하지만 여기서 끝내시면 나중에 글쓰기를 하실때 글내용이 백지 상태가 되는 문제가 생깁니다.
그래서 write.skin.php 하단에
-----------------------------------------------------------------------------
document.getElementById('btn_submit').disabled = true;
document.getElementById('btn_list').disabled = true;
<?=cheditor3('wr_content');?>
f.action = "./write_update.php";
f.submit();
}
-----------------------------------------------------------------------------
이렇게 바꿔주시기만 하면 글내용에도 정상적으로 보이게 됩니다.
2