썸네일 갤러리 목록 속도개선 정보
썸네일 갤러리 목록 속도개선관련링크
본문
갤러리스킨중 썸네일작업 때문에 목록 처리속도가 많이 느리신분은 다음 사항을 체크해보시고 해당사항이 있으신분은 수정해보시기 바랍니다.
스킨폴더에 skin.lib.php 파일있다
그리고 list.skin.php 에서 썸네일 처리부분이 skin.lib.php에서 정의한 makeThumbs() 를 사용한다면
아래 소스에서 볼드처리된 부분을 추가한다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("makeThumbs")) {
function makeThumbs($oriPath, $oriFileName, $thmWidth="", $thmHeight="", $thmAlt="") {
global $g4, $board_skin_path;
$errorFilePrt = "<img src='$board_skin_path/img/noimage.gif' border=0 title='이미지 없음'>";
$oriFile = $oriPath . "/" . $oriFileName;
if (is_file($oriFile) == false) return $errorFilePrt; // 원본 부재
$thmPath = $oriPath . "/thumbs";
$thmFile = $thmPath . "/" . $oriFileName;
//20110407 속도개선 썸네일 유무를 체크하여 있다면 재생성 작업을 하지 않고 바로 리턴.
if (file_exists($thmFile)) { // 썸네일 유무
$thmFilePrt = "<img src=\"{$thmFile}\" border=\"0\" alt=\"{$thmAlt}\" />";
return $thmFilePrt;
}
$oriSize = getimagesize($oriFile);
$oriWidth = $oriSize[0];
$oriHeight = $oriSize[1];
$oriType = $oriSize[2];
if ($oriType > 3) return $errorFilePrt; // 원본 이미지 타입 오류
.... 이하 생략....
끝
스킨폴더에 skin.lib.php 파일있다
그리고 list.skin.php 에서 썸네일 처리부분이 skin.lib.php에서 정의한 makeThumbs() 를 사용한다면
아래 소스에서 볼드처리된 부분을 추가한다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("makeThumbs")) {
function makeThumbs($oriPath, $oriFileName, $thmWidth="", $thmHeight="", $thmAlt="") {
global $g4, $board_skin_path;
$errorFilePrt = "<img src='$board_skin_path/img/noimage.gif' border=0 title='이미지 없음'>";
$oriFile = $oriPath . "/" . $oriFileName;
if (is_file($oriFile) == false) return $errorFilePrt; // 원본 부재
$thmPath = $oriPath . "/thumbs";
$thmFile = $thmPath . "/" . $oriFileName;
//20110407 속도개선 썸네일 유무를 체크하여 있다면 재생성 작업을 하지 않고 바로 리턴.
if (file_exists($thmFile)) { // 썸네일 유무
$thmFilePrt = "<img src=\"{$thmFile}\" border=\"0\" alt=\"{$thmAlt}\" />";
return $thmFilePrt;
}
$oriSize = getimagesize($oriFile);
$oriWidth = $oriSize[0];
$oriHeight = $oriSize[1];
$oriType = $oriSize[2];
if ($oriType > 3) return $errorFilePrt; // 원본 이미지 타입 오류
.... 이하 생략....
끝
추천
4
4
댓글 3개
팝스클럽님의 "[갤러리] SIR 최신판 기본스킨에 충실한 갤러리 스킨" 스킨을 사용하시는 분은 꼭 적용해보시기 바랍니다.
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=95392
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=95392
제가 사용하는 게시판들은 skin.lib.php파일적용한건 없네여
원본 이미지가 변경되었을 경우에만 목록 이미지를 생성하도록 변경 했습니다. "root"님 감사 드립니다. 변경한 스킨 http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=105751