jysoft 님 겔러리인데요 - 섬네일이 안되는데요 - 좀도와주실분~~

jysoft 님 겔러리인데요 - 섬네일이 안되는데요 - 좀도와주실분~~

QA

jysoft 님 겔러리인데요 - 섬네일이 안되는데요 - 좀도와주실분~~

본문

<?
for ($i=0; $i<count($list); $i++) {
 
 // 썸네일 이미지가 존재하지 않는다면
 $img = "<img src='$board_skin_path/img/noimages.gif' width='{$thumb_width}' height='{$thumb_height}' border=0 title='이미지 없음'>";
 $thumfile = "";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];
 
 $image = $list[$i][file][0][file];
    //$thumb = $thumb_path.'/'.$list[$i][wr_id];
 $thumb_number = ($list[$i][wr_10])? "".$list[$i][wr_10]."":"0";
 $file = $list[$i][file][0][path] .'/'. $list[$i][file][$thumb_number][file];
    // 썸네일 이미지가 존재하지 않는다면
    if (!file_exists($thumb)) {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        // 업로드된 파일이 이미지라면
        if (preg_match("/\.(jpg|gif|png)$/i", $file) && file_exists($file)) {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                continue;
            $rate = $thumb_width / $size[0];
            $height = (int)($size[1] * $rate);
            // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
            if ($height < $thumb_height)
                // 계산된 이미지 높이로 복사본 이미지 생성
                $dst = imagecreatetruecolor($thumb_width, $height);
            else
                // 설정된 이미지 높이로 복사본 이미지 생성
                $dst = imagecreatetruecolor($thumb_width, $thumb_height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
            imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
        } else { //게디터에서 삽입한 이미지 뽑자ㅠㅠ
   $edit_img = $list[$i]['wr_content'];
   if (eregi("data/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)", $edit_img, $tmp)) { // data/cheditor------
    $file = '../' . $tmp[0]; // 파일명
    $size = getimagesize($file);
    if ($size[2] == 1)
     $src = imagecreatefromgif($file);
    else if ($size[2] == 2)
     $src = imagecreatefromjpeg($file);
    else if ($size[2] == 3)
     $src = imagecreatefrompng($file);
    else
     continue;
    $rate = $thumb_width / $size[0];
    $height = (int)($size[1] * $rate);
    // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
    if ($height < $thumb_height)
     // 계산된 이미지 높이로 복사본 이미지 생성
     $dst = imagecreatetruecolor($thumb_width, $height);
    else
     // 설정된 이미지 높이로 복사본 이미지 생성
     $dst = imagecreatetruecolor($thumb_width, $thumb_height);
    imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
    imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);
    chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
   }
     }
 }
 //이미지
 if (file_exists($thumb) && $list[$i][file][0][file])
  $img = $thumb;
  $thumb = $thumb_path. "/". $list[$i][wr_id];
  if ( file_exists($thumb) ){
   $img = $thumb;
  }else{
   $img = "{$board_skin_path}/img/ga_noimage.gif";
   
  }
    
  $subject = "<span class='txt_subject'>비밀글 입니다.</span>";
  $list[$i][preview] = "비밀글 입니다.";
  $thumfile = "<img src='{$board_skin_path}/img/secret_masonry.jpg' alt='' class='service-tipsy' title='비밀글' />";
  $fancybox = "";   
 if (!strstr($list[$i][wr_option], "secret") || $is_admin || ($list[$i][mb_id]==$member[mb_id] && $member[mb_id])) {
  if ($wr_id == $list[$i][wr_id]) {
   $thumfile = "<img src='$img' alt='' />";
  } else if ($list[$i][is_notice] && ! $list[$i][file][0][file]) {
   $thumfile = "<img src='{$board_skin_path}/img/notice_masonry.jpg' alt='' class='service-tipsy' title='공지사항' />";
  } else if ($list[$i][is_notice] && $list[$i][file][0][file]) {
   $thumfile = "<img src='$img' alt='' class='service-tipsy' title='공지사항' />";
  } else {
   $thumfile = "<img src='$img' width='$thumb_width' alt='' />";
  }
    $notice = "";
        if ($list[$i][is_notice]) $notice = "<div class='ribbon'><span class='notice'></span></div>";
 $hot = "";
  if ($list[$i][icon_hot]) $hot = "<div class='ribbon'><span class='hot'></span></div>";
 $new_icon = "";
  if ($list[$i][icon_new]) $new_icon = "<div class='ribbon'><span class='new'></span></div>";
 $class = "off";
        if ($wr_id == $list[$i][wr_id]) $class = "on";
  /*겔러리에만 클릭표시*/
  if($bo_table=="gallery") $click=" ☜ 클릭";
  $subject = "<span class='txt_subject'>".$list[$i][subject].$click."</span>";
  $list[$i][preview] = strip_tags($list[$i][wr_content]);
  $list[$i][preview] = nl2br($list[$i][preview]);
  $list[$i][preview] = preg_replace("/\s*<br\s?\/?>\s*/i", " ", $list[$i][preview]);
  $list[$i][preview] = str_replace("\"", "", $list[$i][preview]);
  $list[$i][preview] = str_replace(" ", "", $list[$i][preview]);
  $list[$i][preview] = str_replace(">", "", $list[$i][preview]);
  $list[$i][preview] = conv_subject($list[$i][preview], 100, "...");
  if(!$list[$i][preview]) $list[$i][preview] = "내용없음";
  $fancybox = "class=\"fancybox\" href='$file' data-fancybox-group='$board[bo_table]' ";
 }
 if (! is_file($file)) $fancybox = "";
    $comment_cnt = "";
    if ($list[$i][comment_cnt])
        $comment_cnt = " <a class='txt_comment' href=\"{$list[$i][comment_href]}\"><span style='font-family:Tahoma;font-size:10px;color:#FF4326;'><strong>{$list[$i][comment_cnt]}</strong></span></a>";
 if($board[bo_2] == "fancy") {
  echo "<div class='box {$list[$i][ca_name]}'>".$notice."".$hot."".$new_icon."<a $fancybox title='".strip_tags($subject)."'>$thumfile</a>\n";
 } else {
  echo "<div class='box {$list[$i][ca_name]}'>".$notice."".$hot."".$new_icon."<a href='{$list[$i][href]}'>$thumfile</a>\n";
 }
 
 
>>>
 
jysoft 님 겔러리인데요 - 섬네일이 안되는데요 - 좀도와주실분~~
 
해당 소스인데요 - 몇번시도끝에 안되어서 포기상태였는데요  - 모바일에서 섬내일 이미지가 있어야 될듯해서요.
 
그래야 카카오톡으로 보낼것같은데요  섬네일 소스좀 봐주실분~~
 
 

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
전체 6
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

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