[이윰] 좀 더 전문적으로 관리자 본문 내용 없이 글 작성하기
페이지 정보
루루아빠
3,238 1
2015.04.22 19:02:46
짧은주소
-
https://yadolee.com/tip/130 주소복사
본문
각 에디터 폴더/editor.lib.php를 열고
// textarea 의 값이 비어 있는지 검사
function chk_editor_js($id, $is_dhtml_editor=true)
{
....생략
}
smarteditor 수정 후
// textarea 의 값이 비어 있는지 검사
function chk_editor_js($id, $is_dhtml_editor=true)
{
global $write_min, $is_admin;
if(!$write_min || $is_admin) return;
if ($is_dhtml_editor) {
return "if (!{$id}_editor_data || jQuery.inArray({$id}_editor_data.toLowerCase(), [' ','<p> </p>','<p><br></p>','<p></p>','<br>']) != -1) { alert(\"내용을 입력해 주십시오.\"); oEditors.getById['{$id}'].exec('FOCUS'); return false; }\n";
} else {
return "if (!{$id}_editor.value) { alert(\"내용을 입력해 주십시오.\"); {$id}_editor.focus(); return false; }\n";
}
}
ckeditor 수정 후
// textarea 의 값이 비어 있는지 검사
function chk_editor_js($id, $is_dhtml_editor=true)
{
global $write_min, $is_admin;
if(!$write_min || $is_admin) return;
if ($is_dhtml_editor) {
return "if (!{$id}_editor_data) { alert(\"내용을 입력해 주십시오.\"); CKEDITOR.instances.{$id}.focus(); return false; }\nif (typeof(f.{$id})!=\"undefined\") f.{$id}.value = {$id}_editor_data;\n";
} else {
return "if (!{$id}_editor.value) { alert(\"내용을 입력해 주십시오.\"); {$id}_editor.focus(); return false; }\n";
}
}
그누보드5/bbs/write.update.php을 열고
수정전
if ($wr_content == '') {
$msg[] = '<strong>내용</strong>을 입력하세요.';
}
수정후
if ($wr_content == '' && !$is_admin && !$board['bo_write_min']) {
$msg[] = '<strong>내용</strong>을 입력하세요.';
}
추천인 1
레벨 101
경험치 1,519,179
Progress Bar 13.8%
- 가입일 : 2015-03-04 03:24:54
- 서명 : KNOW YOUR LIMITS
BUT NEVER STOP TRYING TO EXCEED THEM !!
- 자기소개 : 루루의 자랑
루루아빠랍니다~~
최신댓글이 없습니다.


댓글
첫 번째 댓글을 남겨 주세요