latest 스킨설정 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

latest 스킨설정 정보

latest 스킨설정

본문

http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=105451&sca=&sfl=wr_subject%7C%7Cwr_content&stx=latest&sop=and

블랙리스트님이 올려주신 멋진 latest 스킨을 적용하려고 애를 쓰고 있는데 , 설정에 대한 설명이 없어서 ^^;  블랙리스트님이 이글을 보신다면 답을 좀 주소서 ㅎ

thumb 가 www루트에 저장되기를 하려면 , 경로 설정을 어떻게 하면 되는지 ,  올려주신 파일을 그대로 적용하니 . latest 는 표현되고 , 경로가 안맞는지 액박이 뜹니다..

그리고  호스팅 계정에 www 와 thumb 폴더(이경로에 폴더가 생성됨니다..

www/thumb 가 되면 좋을거 같은데..thumb.lib.php 네용중 일부 입니다.


function thumbnail($file_name, $width=0, $height=0, $is_create=false, $is_crop=2, $quality=90, $small_thumb=true, $watermark="", $filter="", $noimg="", $thumb_type="")
{
    //if (!$file_name)
    //    return;

    // memory limit 설정 변경
    @ini_set("memory_limit", -1);

    // 썸네일 디렉토리
    $real_dir = dirname($_SERVER['DOCUMENT_ROOT'] . "/nothing");
    $dir = dirname(file_path($file_name));
    $file = basename($file_name);

    $thumb_dir = $dir . "/";

    // 썸네일을 저장할 디렉토리
    $thumb_path = $thumb_dir . "/" . $width . "x" . $height . "_" . $quality;

    if (!file_exists($thumb_dir)) {
        @mkdir($thumb_dir, 0707);
        @chmod($thumb_dir, 0707);
    }

    if (!file_exists($thumb_path)) {
        @mkdir($thumb_path, 0707);
        @chmod($thumb_path, 0707);
    }

    $source_file = $dir . "/" . $file;

    $size = @getimagesize($source_file);

    // animated gif에 대해서 썸을 만들고 싶으면 코멘트를 풀어주세요. 아래코드는 cpu와 disk access를 크게 유발할 수 있습니다
    //if ($size[2] == IMG_GIF && is_ani_gif($file_name)) return;

    // 이미지 파일이 없는 경우
    if (!$size[0]) {

        // $nomimg에 설정이 없으면 빈 이미지 파일을 생성
        if ($noimg)
            return $noimg;
        else
        {
            if (!$width)
                $width = 30;
            if (!$height)
                $height = $width;
            $thumb_file = $thumb_dir . "/" . $width . "x" . $height . "_noimg.gif";

            if (@file_exists($thumb_file))
                ;
            else
            {
                $target = imagecreate($width, $height);
               
                $bg_color = imagecolorallocate($target, 250, 250, 250);
                $font_color = imagecolorallocate($target, 0, 0, 0);
                $font_size = 12;
                $ttf = "$real_dir/img/han.ttf";
                $text = "no image...";
                $size = imagettfbbox($font_size, 8, $ttf, $text);
                $xsize = abs($size[0]) + abs($size[2])+($padding*2);
                $ysize = abs($size[5]) + abs($size[1])+($padding*2);
                $xloc = $width/2-$xsize/2;
                $yloc = $height/2-$ysize/2;
                imagefttext($target, $font_size, 8, $xloc, $yloc, $font_color, $ttf, $text);
                //imagecopy($target, $target, 0, 0, 0, 0, $width, $height);
                imagegif($target, $thumb_file, $quality);
                @chmod($thumb_file, 0606); // 추후 삭제를 위하여 파일모드 변경
            }
            return str_replace($real_dir, "", $thumb_file);
        }
    }

    $thumb_file = $thumb_path . "/" . $file;

댓글 전체

전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT