반응형
function editor_html($id, $content, $is_dhtml_editor=true, $placeholder='')
{
global $g5, $config, $w, $board;
static $js = true;
</script>';
if( $is_dhtml_editor && $content && !$w && (isset($board['bo_insert_content']) && !empty($board['bo_insert_content']) ) ){ //글쓰기 기본 내용 처리
if( preg_match('/\r|\n/', $content) && $content === strip_tags($content, '<a><strong><b>') ) { //textarea로 작성되고, html 내용이 없다면
$content = nl2br($content);
}
}
$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>");
$(document).on("click", ".btn_cke_sc_close", function(){
$(this).parent("div.cke_sc_def").remove();
});
});';
$html .= "\n</script>";
$js = false;
}
$smarteditor_class = $is_dhtml_editor ? "smarteditor2" : "";
if($placeholder){
$html .= "\n<textarea id=\"$id\" name=\"$id\" class=\"$smarteditor_class\" maxlength=\"65536\" style=\"width:100%;height:300px\" placeholder=\"$placeholder\">$content</textarea>";
}else{
$html .= "\n<textarea id=\"$id\" name=\"$id\" class=\"$smarteditor_class\" maxlength=\"65536\" style=\"width:100%;height:300px\">$content</textarea>";
}
$html .= "\n<span class=\"sound_only\">웹 에디터 끝</span>";
return $html;
}
1.플러그인-에디터-스마트 에이터 2 lib.php 4~50줄수정
2. $editor_html2 = editor_html('wr_content', $content, $is_dhtml_editor,'placeholder에 쓸 내용');
3.에디터 값불러오는것 수정(예 - $editor_html을 $editor_html2 로 변경)
#::placeholder css
.header-search input::placeholder{
color:#a6a6a6;
font-weight:700;
font-size:12px;
}
728x90
반응형
'PHP & JAVA' 카테고리의 다른 글
var_dump() (0) | 2023.04.24 |
---|---|
URL 리다이렉션 & SSL (0) | 2022.01.17 |
User Agent를 이용하여 접속기기 확인 (0) | 2022.01.13 |