묻고답하기

최근이미지를 출력하면서 궁금한게 있어서 질문드립니다.

이미지 가로 갯수를 기본값인 5개로 했을 때나 10개, 20개로 늘렸을 때나 항상 고정된 크기의 이미지 출력방법을 알고 싶습니다.

질문이 애매한 거 같아서 부연설명을 하자면 이미지의 가로 숫자와 관계없이 코드출력시 생성된 이미지의 가로 크기를 유지할 수 있는 방법을 찾고 있는 것입니다.

현재는 이미지 가로 숫자를 늘리면 그것을 게시판 크기에 맞게 각각의 이미지 가로크기를 축소하는데, 이렇게 축소되지 않는 방법에 대해 문의드립니다.

아래는 ../widgets/newest_images/newest_images.class.php 파일입니다.

제 생각에는 게시판 넓이를 이미지 가로 숫자로 나눠줄 것 같은데 워낙 문외한이다보니 어느부분인지를 모르겠네요.

바쁘시더라도 부탁 좀 드리겠습니다.

모두들 좋은 밤 되시기 바랍니다.

 

<?php
    /**
     * @class newest_images
     * @author zero (zero@nzeo.com)
     * @brief 최근 이미지를 출력하는 위젯
     * @version 0.1
     **/

    class newest_images extends WidgetHandler {

        /**
         * @brief 위젯의 실행 부분
         *
         * ./widgets/위젯/conf/info.xml 에 선언한 extra_vars를 args로 받는다
         * 결과를 만든후 print가 아니라 return 해주어야 한다
         **/
        function proc($args) {
            // 글자 제목 길이
            $widget_info->title_length = (int)$args->title_length;
            if(!$widget_info->title_length) $widget_info->title_length = 10;

            // 썸네일 생성 방법
            $widget_info->thumbnail_type = $args->thumbnail_type;
            if(!$widget_info->thumbnail_type) $widget_info->thumbnail_type = 'crop';

            // 썸네일 가로 크기
            $widget_info->thumbnail_width = (int)$args->thumbnail_width;
            if(!$widget_info->thumbnail_width) $widget_info->thumbnail_width = 100;

            // 썸네일 세로 크기
            $widget_info->thumbnail_height = (int)$args->thumbnail_height;
            if(!$widget_info->thumbnail_height) $widget_info->thumbnail_height = 100;

            // 세로 이미지 수
            $widget_info->rows_list_count = (int)$args->rows_list_count;
            if(!$widget_info->rows_list_count) $widget_info->rows_list_count = 1;

            // 가로 이미지 수
            $widget_info->cols_list_count = (int)$args->cols_list_count;
            if(!$widget_info->cols_list_count) $widget_info->cols_list_count = 5;

            // 노출 여부 체크
            if($args->display_author!='Y') $widget_info->display_author = 'N';
            else $widget_info->display_author = 'Y';
            if($args->display_regdate!='Y') $widget_info->display_regdate = 'N'+ '+ ';
            else $widget_info->display_regdate = 'Y';
            if($args->display_readed_count!='Y') $widget_info->display_readed_count = 'N';
            else $widget_info->display_readed_count = 'Y';
            if($args->display_voted_count!='Y') $widget_info->display_voted_count = 'N';
            else $widget_info->display_voted_count = 'Y';

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

            // 대상 모듈 정리
            $mid_list = explode(",",$args->mid_list);

            // 템플릿 파일에서 사용할 변수들을 세팅
            if(count($mid_list)==1) $widget_info->module_name = $mid_list[0];

            // 변수 정리
            $obj->list_count = $widget_info->rows_list_count * $widget_info->cols_list_count;

            // mid에 해당하는 module_srl을 구함
            $oModuleModel = &getModel('module');
            $module_srl_list = $oModuleModel->getModuleSrlByMid($mid_list);
            if(is_array($module_srl_list)) $obj->module_srls = implode(",",$module_srl_list);
            else $obj->module_srls = $module_srl_list;
            $obj->direct_download = 'Y';
            $obj->isvalid = 'Y';

            $oDocumentModel = &getModel('document');

            // 정해진 모듈에서 문서별 파일 목록을 구함
   
$obj->category_srl = $args->category_srl;   
$files_output = executeQueryArray("file.getOneFileInDocument", $obj);
$files_count = count($files_output->data);

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

            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;

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

            // 템플릿의 스킨 경로를 지정 (skin, colorset에 따른 값을 설정)
            $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
            Context::set('colorset', $args->colorset);

            // 템플릿 파일을 지정
            $tpl_file = 'list';

            // 템플릿 컴파일
            $oTemplate = &TemplateHandler::getInstance();
            $output = $oTemplate->compile($tpl_path, $tpl_file);
            return $output;
        }
    }
?>

 

 

혹시 몰라서 ../newest_images/skins/default/list.html 파일도 올려봅니다.

 

<!--// 설정된 컬러셋의 종류에 따라서 css파일을 import 합니다 -->

<!--@if($colorset=="normal"||!$colorset)-->
    <!--%import("css/normal.css")-->
<!--@end-->

<div class="ni_box">
    <title">!--@if($widget_info->title)-->
    <div class="title_box">
        <div class="title">{$widget_info->title}</div>
        <module_name">!--@if($widget_info->module_name)-->
        <div class="more"><a href="{getUrl('','+ 'mid'+ ',$widget_info->module_name)}">more</a></div>
        <!--@end-->
    </div>
    <!--@end-->

    <document_list">!--@if(count($widget_info->document_list))-->
        <table class="thumbnail_box">
        {@ $count = 0; }
        <rows_list_count;$i">!--@for($i=0;$i<$widget_info->rows_list_count;$i++)-->
        <tr valign="top">
            <cols_list_count;$j">!--@for($j=0;$j<$widget_info->cols_list_count;$j++)-->
                {@ $oDocument = $widget_info->document_list[$i*$widget_info->cols_list_count + $j]}
            <td <rows_list_count>1)-->class="bottomBorder"[{$oDocument->getCommentCount()}]&nbsp;

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
황규섭290 안녕하세요 Mysql에서  
청개굴이 탭식 최근글 큰제목 어케 입력하나요..? [5] file 2009.04.21 by 박노열
졸라빠른거북이 최근문서출력에서계시글클릭하면... [2] file 2009.04.21 by 졸라빠른거북이
울프 첨부파일 &관리자 권한 질문  
울프 바로앞의글  
궁금이 1.2.1 업데이트 후 네이버 검색에 안잡히네여.  
신상호945 [관리자모드에서 설정메뉴 선택시....] [1] file 2009.04.21 by 신상호945
IT LEE 레이아웃 메뉴 부분에 대해서 답변 부탁드려요..ㅜㅜ  
건즈 files 폴더의 cache 폴더 지워도 되나요? [2] 2009.04.21 by 건즈
melongs 사진첩및 동영상 게시판에 파일첨부문제  
k0su 최근이미지위젯 이미지 크기 문의  
구퍼 리비젼 6139까지 적용된 상태입니다만 파일첨부가 안됩니다. [2] file 2009.04.22 by 구퍼
유정훈1 글쓰기 열었을때 기본 폼적혀 있게 하고 싶습니다 고수님 제발 [1] 2009.04.22 by 궁금이2
가너외라 XE 에서 다른것으로 이전할때.. [1] 2009.04.22 by 궁금이2
CHOBOS xe 에서 쪽지음 가능한가요?? [4] 2009.04.22 by CHOBOS
김은섭734 최근문서출력위젯 삽입시 스킨적용과 링크문제 [3] file 2009.04.22 by 궁금이2
sakurastorm 회원정보를 마스터만 볼 수 있게 하는 방법 [1] file 2009.04.22 by sakurastorm
crephi 로그인 사용자 대상 설정 [3] 2009.04.22 by crephi
남극백곰 페이지에 ''내용 직접 추가''를 통해 ''위젯'' 입력시 보이지 않는 문제 [8] file 2009.04.22 by 남극백곰
마컬 1.2.0 패치 후 mysql데몬에서 CPU에 상당한 과부하가 생기네요 [6] 2009.04.22 by LunarDream
meixi 노프레임 제로보드홈에서 메인이요..  
gosu.idtail.com castle 적용 시 첨부파일 기능 동작안함  
유석남 iboard 사용법좀 알려주세요!  
ePeMJF ''상담'' 옵션을 선택했을 때... [1] 2009.04.22 by ePeMJF
김은섭734 최근문서출력위젯 삽입시 more버튼 링크문제 [2] file 2009.04.22 by 김은섭734
밀로그 캐쉬데이타를 사용한다는게 어떤 역할을 하는거죠? [1] 2009.04.22 by 웃는기차
졸라빠른거북이 다시 한번 질물 드려요 ㅠㅜ  
쎄바스찬 위젯 사용 문의 [2] 2009.04.22 by 쎄바스찬
상추 레이아웃편집에서 뭐좀 여쭤볼께요.  
스포츠365 files 폴더 에 관련해서 왜 그럴까요? [4] 2009.04.22 by sports365