jQuery.exec_json(

    "board.dispBoardContentList", {

        "mid":current_mid

    }, function(data){

        console.log(data)

    }

);

 

이런 식으로 document_list를 불러오는데, list_count가 모듈 정보에 입력된 값으로 고정되어 있는 것 같더라구요.

이걸 스크립트에서 변경할 수 있는 방법이 있을까요?

  • profile

    ajax 요청에 파라미터를 추가하는 방법으로는 바꿀 수 없을 것 같네요.

    애드온을 사용해서 모듈 설정을 일시적으로 조작한다면 몰라도...

  • profile profile
    옛날옛적에 이런 이슈가 있었던 것 같은데,
    https://code.google.com/archive/p/xe-board/issues/107

    코어 수정은 아무래도 비추겠죠...?
  • profile ?
    그래도 필요하다면 해야겠죠..? ㅋㅋ;
  • ? profile
    음... 그럼 고고싱입니다~!
  • profile ?
    <?
    
        function dispBoardContentList(){
            // check the grant
            if(!$this->grant->list)
            {
                Context::set('document_list', array());
                Context::set('total_count', 0);
                Context::set('total_page', 1);
                Context::set('page', 1);
                Context::set('page_navigation', new PageHandler(0,0,1,10));
                return;
            }
    
            $oDocumentModel = getModel('document');
    
            // setup module_srl/page number/ list number/ page count
            $args = new stdClass();
            $args->module_srl = $this->module_srl;
            $args->page = Context::get('page');
            $args->list_count = Context::get('_count') ? Context::get('_count') : $this->list_count;
            $args->page_count = $this->page_count;
    

     

    대충 이렇게 하면 되지 않을까요? 

  • ? profile
    네, 이렇게 하고 ajax 요청에 파라미터 추가하니까 잘 됩니다. ^^/
    그런데 Context::get('_count')로 하신 건 list_count와 혼동이 생기는 걸 피하기 위함인가요?
  • profile ?
    그냥 아무생각없이 적은거라서 ㅋㅋ;
  • ? profile
    아주 심오한 생략이었군요 으흐흐흐
  • ?
    게시판 설정에 따라 list_count 값이 고정되어 있어서, AJAX 요청일 때만 애드온으로 $this->module_info->list_count 값을 조작하는 방법 밖에 없는 것 같네요.

    거기서 좀 더 자유롭게 조작하려면 모듈을 만드셔야....(쿨럭)
  • ? profile
    첩첩산중이네요. 코어 수정을 하면 페이지 전체가 영향을 받으니까 안 될 것 같고...
    결국 애드온을 만지게 될 줄이야...
    게다가, 모듈이라니요 ㅡㅡ+
  • profile profile

    애드온 버전:

    if ($called_position === 'before_module_proc' && $this->module_info->module === 'board')
    {
        if (Context::get('list_count'))
        {
            $this->module_info->list_count = Context::get('list_count');
        }
    }

  • profile profile
    친히 소스를 주시다니 감개무량입니다!!!
    처음 만드는 거여서 서툴겠지만 그래도 애드온으로다가 잘 복붙해보겠습니다.
    감사해요~!