묻고답하기
category_srl 질문입니다
2016.07.19 10:56
category_srl값을 여러곳에서 받아오고싶은데 자꾸 값을못가져오네요 ㅠㅠㅠ
module_srl값은 array로가져오면 여러곳에서 가져와지는데 똑같이 카테고리값을 여러곳에서 가져올라하면
하나도안가져와지네요 ㅠㅠ 고수님들 도와주십시오
소스는 아래 첨부했습니다 부탁드립니다 ㅠㅠ
{@ $docModel = getModel('document'); }
{@ unset($args); }
{@ $page = Context::get('page'); }
{@ $args->category_srl = array(131,122,131); }
{@ $args->module_srl = $textyle->module_srl; }
{@ $args->list_count = 6; }
{@ $args->page = $page ? $page : 1; }
{@ $args->search_target = Context::get('search_target'); }
{@ $args->search_keyword = Context::get('search_keyword'); }
{@ $output = $docModel->getDocumentList($args); }
{@ $document_list = $output->data; }
{@ Context::set('page', $page); }
<!--@if($document_list)-->
<div class="row document-list clearfix">
<ul>
{@ $count = 1; }
<!--@foreach($document_list as $document)-->
{@ $images = $document->getUploadedFiles(); }
{@ $img = $images[0]; }
{@ $text=$document->getContent();}
{@ $context = strpos($text,"RitzVideo"); }
{@ $startstr=$context - 5}
<li class="LastInRow"|cond="$count%3 == 0" id="InRow">
<div class="list-wrapper">
<div class="thumb-container">
<a href="{getUrl('document_srl', $document->document_srl)}">
<div class="info-container">
<div class="info-wrapper">
{$document->getSummary(120)}
<img class="img_icon" src="img/list/view_more.png" />
</div>
</div>
<img class="thumb" src="{$document->getThumbnail(420, 320, 'crop')}" alt="" />
</a>
</div>
<a href="{getUrl('', 'document_srl', $document->document_srl)}" class="hover-info">
<span>
{$document->getTitle(26)}<br />
<b>views: {$document->get('readed_count')} | date: {$document->getRegDate('Y-m-d')}</b>
<i class="arrow"></i>
</span>
</a>
</div>
{@ $time_interval = 172800; }
{@ $time_check = date("YmdHis", time() - $time_interval); }
<div class="title">{$document->getTitle()} <img src="img/list/new_icon.png" cond="$document->get('regdate') > $time_check" /></div>
<!--@if($startstr!=-5) -->
<a href="{getUrl('document_srl', $document->document_srl)}">
<div class="hover-border-video"></div>
</a>
<!--@end-->
</li>
{@ $count++; }
<!--@end-->
</ul>
</div>
<div class="clear"></div>
<!--@end-->
댓글 3
-
sejin7940
2016.07.19 11:42
-
멍멍
2016.07.19 13:28
어떻게수정을해야하는거죠 ㅠㅠ 같은게시판에서 카테고리만 나누고싶은것입니다!
-
멍멍
2016.07.19 13:59
수정완료했습니다 ! 모듈불러오는부분 보고 수정했습니다 ㅠㅠ 너무힘드네요
글쓴이 | 제목 | 최종 글 |
---|---|---|
XE | 공지 글 쓰기,삭제 운영방식 변경 공지 [16] | 2019.03.05 by 남기남 |
덥붜 | 중고마켓 모듈 수정 | |
에이치오 | [파일 올리기]버튼 문구 변경하고 싶습니다. | |
홍찬 | if 문 질문 | |
미연조 | xe 다국어 회원가입하신분 | |
허허길드짱 | 특권시스템이라는 모듈에서 검색기능은 어떻게 넣을수 있는지 아시나요? | |
에이치오 | {$contents} 내용 수정을 어떻게 하나요? [6] | 2016.07.19 by 에이치오 |
AvAtAr | 글등록버튼과 삭제버튼 클릭시 권한 체크 하는 로직이 어떤 함수인지요 [1] | 2016.07.19 by sejin7940 |
thdwjdtjr | 포인트 "회원포인트목록"에서 나오는 회원 나오지 않는 회원 [1] | 2016.07.19 by sejin7940 |
사업가 | 스케치북 FAQ 게시판에서 제목클릭시 답변글이 안보여요 [1] | 2016.07.19 by 사업가 |
wo**** | 관리자 메일 수신 시 메일내용이 깨집니다. [1] | 2016.07.18 by 기진곰 |
바오밥나무 | 스마트폰 홈페이지 사진연동 기능 [2] | 2016.07.18 by SimpleCode |
왕킥굳킥 | element.style 수정 어캐하나요 [2] | 2016.07.18 by 왕킥굳킥 |
saramjh | 윈도우 아파치 서버과부하 [2] | 2016.07.18 by 불금 |
벼뤼총총 | 게시판에 별도 업로드파일 [4] | 2016.07.18 by 벼뤼총총 |
rlath4 | 이미지 비율 관해 문의드립니다 [2] | 2016.07.18 by rlath4 |
생컨38889 | 휴지통비우기가 먹통입니다.. [1] | 2016.07.18 by Luatic™ |
코델리아 | 저작권 관련 문의 [2] | 2016.07.18 by 워프101 |
차나왕 | 쉬운설치 설치후 생성 초보자입니다. [3] | 2016.07.17 by 댑펑 |
SpeaC | 게시판 확장변수 날짜에서 오늘날짜+3일 까지 선택안되게 하기.. | |
댑펑 | 사이트 속도 문제에 대해.. 관리자만 느린 현상 |
getDocumentList 함수 자체가 카테고리를 변수로 받을 경우 하나만 받는다는 가정으로 코딩이 되어있네요
이유가 상위카테고리를 선택했을 경우, 그 하위 카테고리번호까지 다 추출을 해내는 부분 때문이예요
( 게시판들에서 생각해보면 복수 카테고리를 선택할 일이 없거든요 )
이건 Core 에 버그 수정으로 올려도 될 부분이네요
( 그래서 위젯들은 보통 별도의 query 를 쓸거예요. 이 함수를 쓰지 않고 )
modules/document/document.model.php 에서
__setSearchOption 에서
if($args->category_srl)
{
$category_list = $this->getCategoryList($args->module_srl);
$category_info = $category_list[$args->category_srl];
$category_info->childs[] = $args->category_srl;
$args->category_srl = implode(',',$category_info->childs);
}
부분을 고치셔야할거예요.
같은 게시판 에서 여러 카테고리라면 explode 시켜서 for 문을 돌려 category_srl 을 쭉 모으면 되겠지만..
만약 카테고리가 같은 게시판에서면 상관없는데, 게시판까지 복수개에서 뽑고프면
해당 category_srl 을 이용해 category 정보를 DB 에서 불러와 module_srl 값까지 다시 찾아서
쭉 돌려야하는등 조금 수정을 많이 해야할 수도 있겠네요