묻고답하기

^^

아래 소스 한번 봐주세요.

2개의 다른 위젯 소스 입니다.  코드중 빨간줄은 위제의 이미지를 받아오는 코드 같은데요.

 

웹진 위젯은 설정한 모듈에서 가져오고요,  최근 이미지 위젯은  file 폴더에서 가져오는것 같습니다.

 

2번째의  최근 이미지 위젯도 모둘을 기준으로 이미지를 출력을 할려면, 어찌 해야 할지

알려 주시면 감사 드립니다.

 

 

 

 

1. 웹진 위젯 입니다.

// 대상 모듈 (mid_list는 기존 위젯의 호환을 위해서 처리하는 루틴을 유지. module_srl로 위젯에서 변경)
            if($args->mid_list) {
                $mid_list = explode(",",$args->mid_list);
                $oModuleModel = &getModel('module');
                if(count($mid_list)) {
                    $module_srl = $oModuleModel->getModuleSrlByMid($mid_list);
                } else {
                    $site_module_info = Context::get('site_module_info');
                    if($site_module_info) {
                        $margs->site_srl = $site_module_info->site_srl;
                        $oModuleModel = &getModel('module');
                        $output = $oModuleModel->getMidList($margs);
                        if(count($output)) $mid_list = array_keys($output);
                        $module_srl = $oModuleModel->getModuleSrlByMid($mid_list);
                    }
                }
            } else $module_srl = explode(',',$args->module_srls);

            $obj->module_srl = implode(",",$module_srl);
            $obj->sort_index = $widget_info->order_target;
            $obj->order_type = $widget_info->order_type=="desc"?"asc":"desc";
            $obj->list_count = $widget_info->rows_list_count * $widget_info->cols_list_count;

            $output = executeQueryArray('widgets.webzine.getNewestDocuments', $obj);      ---> 모듈에서 이미지를 찾아 출력

            // document 모듈의 model 객체를 받아서 결과를 객체화 시킴
            $oDocumentModel = &getModel('document');

 

 

 

 

 

2.최근 이미지 위젯 입니다.

// 제목
            $widget_info->title = $args->title;

            $oModuleModel = &getModel('module');

            // 대상 모듈이 선택되어 있지 않으면 해당 사이트의 전체 모듈을 대상으로 함
            $site_module_info = Context::get('site_module_info');
            if($args->module_srls) $obj->module_srls = $args->module_srls;
            else if($site_module_info) $obj->site_srl = (int)$site_module_info->site_srl;

            $obj->direct_download = 'Y';
            $obj->isvalid = 'Y';

            // 정해진 모듈에서 문서별 파일 목록을 구함
            $obj->list_count = $widget_info->rows_list_count*$widget_info->cols_list_count;
            $files_output = executeQueryArray("file.getOneFileInDocument", $obj);   ----> DATA 의 file폴더에서 이미지 찾아 출력
            $files_count = count($files_output->data);

            $document_srl_list = array();
            $document_list = array();

            $oDocumentModel = &getModel('document');
            if($files_count>0) {
                for($i=0;$i<$files_count;$i++) $document_srl_list[] = $files_output->data[$i]->document_srl;

                $tmp_document_list = $oDocumentModel->getDocuments($document_srl_list);
                if(count($tmp_document_list)) {
                    foreach($tmp_document_list as $val) $document_list[] = $val;
                }
            }

            $document_count = count($document_list);
            $total_count = $widget_info->rows_list_count * $widget_info->cols_list_count;
            for($i=$document_count;$i<$total_count;$i++) $document_list[] = new DocumentItem();
            $widget_info->document_list = $document_list;

            // 모듈이 하나만 선택되었을 경우 대상 모듈 이름과 링크를 생성
            $module_srl = explode(',',$args->module_srls);
            if(count($module_srl)==1) {
                $oModuleModel = &getModel('module');
                $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl[0]);
                if($module_info->site_srl) {
                    $site_info = $oModuleModel->getSiteInfo($module_info->site_srl);
                    if($site_info->domain) {
                        $widget_info->more_link = getSiteUrl('http://'.$site_info->domain, '','mid', $module_info->mid);
                    }
                } else {
                    $widget_info->more_link = getUrl(','mid',$module_info->mid);
                }
                $widget_info->module_name = $module_info->mid;
            }

            Context::set('widget_info', $widget_info);

 

 

 

 

 

 

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
제로보드굿굿 웹폰트적용법..  
김동하123 위젯 쉬운 설치 이후(답변프리즈)  
국가대표1 게시판 게시글 복원 문의좀 제발 플리즈  
송지욱745 모든 회원정보와 관리자 아이디까지 없어졌습니다. ㅠ (답변이 없어서 다시 올려요..ㅠㅠ)  
BITTER 캐시파일 재생성  
화재내니학교 쉬운설치 [1] 2011.10.24 by 카이네드
제로보드굿굿 동우님.. 봐주세요 ㅠㅠ [2] 2011.10.24 by 굿총
도라란 특정위치의 DB에 내용이 있을 경우, 게시판 글 본문에 지정내용 보여주기 [1] file 2011.10.24 by 송동우
도라란 이 소스가 맞는지 살펴봐 주시면 감사하겠습니다. [1] 2011.10.24 by 송동우
Sunt XE 기본 카운터에 특정 모듈만 출력되기 [1] 2011.10.24 by 송동우
김동하123 아래로 목록 따라나오지 않게 하기 [1] 2011.10.24 by 송동우
홍길동친구 포인트, 다운로드 관련하여 몇가지 질문들입니다. [6] 2014.11.14 by 송동우
툴툴스 현재 사용중인 출석부 모듈에서요... [1] 2011.10.24 by 송동우
김동하123 비회원글쓰기에서 닉네임 넣지 않기 [1] 2011.10.24 by 송동우
김동하123 게시판을 폼메일처럼 쓰기 [1] 2011.10.24 by 송동우
윤제한 제로보드4의 방문자 수를 가져올 수 없나요? [1] 2011.10.24 by 쿵푸팬더
모르겠어요 xe기본게시판 글쓰기버튼 [1] 2011.10.24 by 송동우
모르겠어요 회원가입 시, 생일달력이 가려져서 안보여요 [1] file 2011.10.24 by 송동우
엄한소년 모바일환경에서 쪽지 보기 및 답하기.  
저먼하늘아래 위젯의 이미지 소스 [1] 2011.10.24 by 배워서남준다