답변에 원글 내용 표시 방법 정보
답변에 원글 내용 표시 방법
첨부파일
본문
일단 html 모드를 사용하지 않을 경우에는 답변에 원글이 표시되는데
에디터 사용시에는 해당 답글의 원글이 표시 되지 않습니다.
에디터를 사용하면서도 답글의 원글이 표시되도록 수정했습니다.
write.skin.php 파일 상단에 editor_html2 함수를 만들어서 editor_html 함수를 복사해서 넣습니다.
===========================================================================================================
function editor_html2($id, $content, $is_dhtml_editor=true)
{
global $g5, $config;
static $js = true;
$editor_url = G5_EDITOR_URL.'/'.$config['cf_editor'];
$html = "";
$html .= "<span class=\"sound_only\">웹에디터 시작</span>";
if ($is_dhtml_editor)
$html .= '<script>document.write("<div class=\'cke_sc\'><button type=\'button\' class=\'btn_cke_sc\'>단축키 일람</button></div>");</script>';
if ($is_dhtml_editor && $js) {
$html .= "\n".'<script src="'.$editor_url.'/js/HuskyEZCreator.js"></script>';
$html .= "\n".'<script>var g5_editor_url = "'.$editor_url.'", oEditors = [];</script>';
$html .= "\n".'<script src="'.$editor_url.'/config.js"></script>';
$html .= "\n<script>";
$html .= '
$(function(){
$(".btn_cke_sc").click(function(){
if ($(this).next("div.cke_sc_def").length) {
$(this).next("div.cke_sc_def").remove();
$(this).text("단축키 일람");
} else {
$(this).after("<div class=\'cke_sc_def\' />").next("div.cke_sc_def").load("'.$editor_url.'/shortcut.html");
$(this).text("단축키 일람 닫기");
}
});
$(".btn_cke_sc_close").live("click",function(){
$(this).parent("div.cke_sc_def").remove();
});
});';
$html .= "\n</script>";
$js = false;
}
$smarteditor_class = $is_dhtml_editor ? "smarteditor2" : "";
$html .= "\n<textarea id=\"$id\" name=\"$id\" class=\"$smarteditor_class\" maxlength=\"65536\" style=\"width:100%\">$content</textarea>";
$html .= "\n<span class=\"sound_only\">웹 에디터 끝</span>";
return $html;
}
===========================================================================================================
그리고 아래 내용을 더 추가 해주시면 됩니다.
===========================================================================================================
if($w == "r") {
$content = "<br><br>========================= [원 글] =========================<div>".get_text($write['wr_content'], 0)."</div>";
$editor_html = editor_html2('wr_content', $content, true);
}
===========================================================================================================
혹시 몰라서 write.skin.php 파일을 첨부했으니 해당 파일을 확인해보시면 될 것 같습니다.
에디터 사용시에는 해당 답글의 원글이 표시 되지 않습니다.
에디터를 사용하면서도 답글의 원글이 표시되도록 수정했습니다.
write.skin.php 파일 상단에 editor_html2 함수를 만들어서 editor_html 함수를 복사해서 넣습니다.
===========================================================================================================
function editor_html2($id, $content, $is_dhtml_editor=true)
{
global $g5, $config;
static $js = true;
$editor_url = G5_EDITOR_URL.'/'.$config['cf_editor'];
$html = "";
$html .= "<span class=\"sound_only\">웹에디터 시작</span>";
if ($is_dhtml_editor)
$html .= '<script>document.write("<div class=\'cke_sc\'><button type=\'button\' class=\'btn_cke_sc\'>단축키 일람</button></div>");</script>';
if ($is_dhtml_editor && $js) {
$html .= "\n".'<script src="'.$editor_url.'/js/HuskyEZCreator.js"></script>';
$html .= "\n".'<script>var g5_editor_url = "'.$editor_url.'", oEditors = [];</script>';
$html .= "\n".'<script src="'.$editor_url.'/config.js"></script>';
$html .= "\n<script>";
$html .= '
$(function(){
$(".btn_cke_sc").click(function(){
if ($(this).next("div.cke_sc_def").length) {
$(this).next("div.cke_sc_def").remove();
$(this).text("단축키 일람");
} else {
$(this).after("<div class=\'cke_sc_def\' />").next("div.cke_sc_def").load("'.$editor_url.'/shortcut.html");
$(this).text("단축키 일람 닫기");
}
});
$(".btn_cke_sc_close").live("click",function(){
$(this).parent("div.cke_sc_def").remove();
});
});';
$html .= "\n</script>";
$js = false;
}
$smarteditor_class = $is_dhtml_editor ? "smarteditor2" : "";
$html .= "\n<textarea id=\"$id\" name=\"$id\" class=\"$smarteditor_class\" maxlength=\"65536\" style=\"width:100%\">$content</textarea>";
$html .= "\n<span class=\"sound_only\">웹 에디터 끝</span>";
return $html;
}
===========================================================================================================
그리고 아래 내용을 더 추가 해주시면 됩니다.
===========================================================================================================
if($w == "r") {
$content = "<br><br>========================= [원 글] =========================<div>".get_text($write['wr_content'], 0)."</div>";
$editor_html = editor_html2('wr_content', $content, true);
}
===========================================================================================================
혹시 몰라서 write.skin.php 파일을 첨부했으니 해당 파일을 확인해보시면 될 것 같습니다.
추천
5
5
댓글 3개
감사합니다. 해결하였습니다.

필요한 기능이었는데...감사합니다.
예전에 스마트에디터를 사용하려했으나
답변에 원글 내용이 표시가 안 되고
또 하나는 링크의 타겟이 self로 열리는 것 때문에 사용하지 않고 있다가
답변에 원글 내용이 표시가 되고 링크의 타겟이 blank로 열리게끔 해결을 하여
어제부터 스마트에디터를 가동하여 사용 중 입니다.
다시 한번 감사드립니다.
예전에 스마트에디터를 사용하려했으나
답변에 원글 내용이 표시가 안 되고
또 하나는 링크의 타겟이 self로 열리는 것 때문에 사용하지 않고 있다가
답변에 원글 내용이 표시가 되고 링크의 타겟이 blank로 열리게끔 해결을 하여
어제부터 스마트에디터를 가동하여 사용 중 입니다.
다시 한번 감사드립니다.

오웃... 매우 유익한 기능입니다. 감사합니다.