묻고답하기

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

이미지 가로 갯수를 기본값인 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 남기남
신상호945 [관리자모드에서 설정메뉴 선택시....] [1] file 2009.04.21 by 신상호945
궁금이 1.2.1 업데이트 후 네이버 검색에 안잡히네여.  
울프 바로앞의글  
울프 첨부파일 &관리자 권한 질문  
졸라빠른거북이 최근문서출력에서계시글클릭하면... [2] file 2009.04.21 by 졸라빠른거북이
청개굴이 탭식 최근글 큰제목 어케 입력하나요..? [5] file 2009.04.21 by 박노열
황규섭290 안녕하세요 Mysql에서  
얼음 회원 그룹이 제대로 나오지 않습니다.  
안준석758 경로, 도메인 등록 문제 입니다.  
하늘나라ㅠㅠ 메뉴 추가 후, index 화면 및 모든 화면... 백지상태...  
지인닷컴 XE에서 로그인하면 같은 서버에 설치된 제로보드4도 로그인되게 할 수 있는지요? [2] 2009.04.21 by 지인닷컴
zeroQQQ underline을 없세고 파란색을 회색/검정색으로 바꾸는 방법 부탁합니다/...... [3] 2009.04.21 by zeroQQQ
복고열전 웹진 모드에서 출력되는 사진 크기 수정 어떻게 하나요?? [1] 2009.04.21 by 느까끼
청개굴이 [캡쳐사진포함] 탭식 메뉴 보이기 어케 하는거죠..? [4] file 2009.04.21 by 희망일기
비상 탭 형태 최근 문서 출력 질문입니다. [1] 2009.04.21 by 느까끼
zeroQQQ 관리자 icon 문제...  
피아노요리 레이아윳에 관한 누구나 답변을 주실 수 잇는 간단하지만 응급 질문 올립니다 [1] 2009.04.21 by 느까끼
도파돌이 마이그레이션시 회원등급 관련 문제 [1] 2009.04.21 by 느까끼
moog 제발 답변부탁드립니다 ㅠㅠ 염치없지만 너무 급해서요 ㅠㅠ [1] 2009.04.21 by 제베
쌈꾼 게시판 추천 신고 기타 소스 문의..