zbxe1.0.6버전에 첨부파일 삽입이 아닌 본문 내 이미지의 썸네일이 생성 되지 않는 문제

/?document_srl=207341에서 4699 이후를 업데이트 한 경우 포함되어 있으니 따로 할 필요 없습니다.

설명이 무슨 말인지 모르겠으면 첨부파일을 다운받아 /modules/document/ 폴더 아래에 올리면 됩니다.

/modules/document/document.item.php 493에 삽입

if(!is_dir('./files/cache/tmp')) FileHandler::makeDir('./files/cache/tmp');

modulesdocumentdocument.item.php
            // 첨부된 파일이 없으면 내용중 이미지 파일을 구함
            if(!$source_file) {
                $content = $this->get('content');
                $target_src = null;
                preg_match_all("!src=("|')([^"' ]*?)("|')!is", $content, $matches, PREG_SET_ORDER);
                $cnt = count($matches);
                for($i=0;$i<$cnt;$i++) {
                    $target_src = $matches[$i][2];
                    if(preg_match('//(common|modules|widgets|addons|layouts)//i', $target_src)) continue;
                    else {
                        if(!preg_match('/^(http|https):///i',$target_src)) $target_src = Context::getRequestUri().$target_src;
                        $tmp_file = sprintf('./files/cache/tmp/%d', md5(rand(111111,999999).$this->document_srl));
                        if(!is_dir('./files/cache/tmp')) FileHandler::makeDir('./files/cache/tmp');
                        FileHandler::getRemoteFile($target_src, $tmp_file);
                        if(!file_exists($tmp_file)) continue;
                        else {
                            list($_w, $_h, $_t, $_a) = @getimagesize($tmp_file);
                            if($_w<$width || $_h<$height) continue;

                            $source_file = $tmp_file;
                            $is_tmp_file = true;
                            break;
                        }
                    }
                }
            }


현재평점 0 (평가자 수 : 0)
profile
여기에서 행복한 시간 되십시오.