<?php
    if(!defined("__XE__")) exit();
    if($called_position != 'before_module_proc') return;
    
    if($this->module == 'admin' 
    || $this->module != 'communication' 
    || $this->grant->is_admin) return;
    
    $logged_info = Context::get('logged_info');
    if(!$logged_info) return;

    if( $this->act != 'procCommunicationSendMessage') return;

    if(    Context::get('logged_info')->is_admin!='Y' )
    {
        $args->target_member_srl = $logged_info->member_srl;
        $args->expdate = date("YmdHis");
        $output = executeQuery('userblock.getMemberCheckBan', $args);
        return $output->data;        
        

        if($output->data->count > 0 )
        {
            alertScript('정지기간에는 쪽지를 발송 할 수 없습니다.');
            closePopupScript();
            exit;
        }

    }
?>

 

 

애드온 php는 이렇게 제작을 했구요.

 

모듈의 쿼리파일은 이렇게 되어 있습니다.

<query id="getMemberCheckBan" action="select">
    <tables>
        <table name="userblock" />
    </tables>
    <columns>
        <column name="*" />
    </columns>
    <conditions>
        <condition operation="equal" column="target_member_srl" var="target_member_srl" />
        <group pipe="and">
                <condition operation="null" column="expdate" pipe="or" />
                <condition operation="excess" column="expdate" var="expdate" pipe="or" />
        </group>
    </conditions>
</query>

 

 

  • ?
    expdate excess가 아닌 less로 하면 되지 않을까요?
  • ? profile
    아.. 그럼 만들어주신 유저블록 모듈의 저 쿼리는 차단 아닌 사람을 체크하는 쿼리였던건가요?
  • ? profile
    그리고 저 조건을 일단 임시로 없애도 차단이 안되는 거 보니 쿼리 조건 말고도 다른 곳에 오류가 있어 차단이 안되고 팝업도 안뜨고 있어요.
  • profile ?

    return $output->data;

    이걸 제거해보세요.

    코드에서는 크게 문제될 만한게 없어 보입니다.

  • ? profile
    앗.... return $output->data; 제거하고 조건 걷어내니 쪽지가 안나가는 것 같습니다. 제가 잘못된 쿼리를 가져왔나보네요.
  • ? profile
    return $output->data; 제거하니 이제 아래 차단하는 코드가 동작합니다.

    그런데 말씀하신대로 쿼리를
    expdate excess 로 고쳐서 애드온에 폴더로 올려서 적용해보니 여전히 쪽지가 그대로 나가네요.

    if($output->data->count > 0 ) 이부분이 문제가 있을까요 ?
  • profile ?
    지금 보니 expdate less가 아닌 excess가 맞네요. ㅋㅋ;

    executeQuery를 executeQueryArray로 바꿔보시고
    $output->data->count > 0를
    count($output->data) > 0
    으로 바꿔보세요.
  • ? profile
    감사합니다! 덕분에 잘 처리되었습니다. 이제 글쓰기,댓글 포함 쪽지도 정지기간동안 정지시킬 수 있게 되었네요.