최소글자제한 질문입니다.

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
최소글자제한 질문입니다.

QA

최소글자제한 질문입니다.

본문

게시판 내 최소 글자 제한을 사용중에 있습니다.

EX) 50글자 이하는 작성 불가 

 

문제는 에디터 사용시 글자 제한이 풀려버리는데...

이유는 알겠는데 혹시 이 부분 풀 수 있는 방법이 있을까요?

에디터와 글자수제한을 함께 사용하고 싶거든요...

아시는분 답주시면 감사하겠습니다.

이 질문에 댓글 쓰기 :

답변 1

다음 코드가 도움이 될지 모르겠습니다.

 

extend/user.config.php


function hook_write_update_before_content($board, $wr_id, $w, $qstr) {
    $write_min = (int)$board['bo_write_min'];
    $write_max = (int)$board['bo_write_max'];
 
    if ($write_min == 0 && $write_max == 0) {
        return;
    }   
 
    $wr_content = isset($_POST['wr_content']) == true ? $_POST['wr_content'] : ''; 
    $wr_content = strip_tags($wr_content);
    $wr_content_len = 0;
 
    if (function_exists('mb_strlen') == true) {
        $wr_content_len = mb_strlen($wr_content);
    } else {
        $wr_content_len = strlen($wr_content);
    }   
 
    if ($write_min > 0 && $write_min > $wr_content_len) {
        alert($write_min . ' > ' . $wr_content_len);
    }   
    if ($write_max > 0 && $write_max < $wr_content_len) {
        alert($write_max . ' < ' . $wr_content_len);
    }   
}
add_event('write_update_before', 'hook_write_update_before_content', G5_HOOK_DEFAULT_PRIORITY, 4);
답변을 작성하시기 전에 로그인 해주세요.
전체 2
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT