썸네일이엑박납니다.해결방법좀알려주세요 > 그누4 질문답변

그누4 질문답변

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

썸네일이엑박납니다.해결방법좀알려주세요 정보

썸네일이엑박납니다.해결방법좀알려주세요

본문

오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 : http://cutiey.com/cy/bbs/board.php?bo_table=01_5

썸네일이 엑박나요
해결방법 좀 알려주세요..ㅡㅡ

소스입니다.
<?
if (!defined("_GNUBOARD_")) exit;

$thumb_width = "150"; //썸네일 가로길이 / 이미지 크기를 조정하실려면 조정하십시오.
$thumb_height = "80"; //썸네일 세로길이
$thumb_quality = "9"; //퀼리티 100이하로 설정
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';

@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);


?>
<!-- 상단 네비 + 검색 -->
<form name=fsearch method=get style="margin:0px;">
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=sca      value="<?=$sca?>">
<TABLE align=center WIDTH=635 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD HEIGHT=25 width=50%><IMG SRC="<?=$board_skin_path?>/img/navy/ecy_navy_00.gif"></TD>
<TD width=68><IMG SRC="<?=$board_skin_path?>/img/view/ecy_search.gif"></TD>
<td width="282">
        <select name=sfl>
            <option value='wr_subject'>이름</option>
            <option value='wr_content'>내용</option>
            <option value='wr_subject||wr_content'>이름+내용</option>
        </select><input name=stx maxlength=15 size=10 itemname="검색어" required value='<?=$stx?>'><select name=sop>
            <option value=and>and</option>
            <option value=or>or</option>
        </select>
        <input type=image src="<?=$board_skin_path?>/img/search_btn.gif" border=0 align=absmiddle></td>
</TR>
</TABLE>
</form>
<!-- End 상단 네비 + 검색 -->
<!-- 타이틀이미지 -->
<TABLE align=center WIDTH=635 HEIGHT=62 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD><IMG SRC="<?=$board_skin_path?>/img/list/title_01.gif" WIDTH=478 HEIGHT=8></TD>
<TD><IMG SRC="<?=$board_skin_path?>/img/list/title_02.gif" WIDTH=123 HEIGHT=8></TD>
<TD><IMG SRC="<?=$board_skin_path?>/img/list/title_03.gif" WIDTH=34 HEIGHT=8></TD>
</TR>
<TR>
<TD><IMG SRC="<?=$board_skin_path?>/img/list/title_04.gif" WIDTH=478 HEIGHT=45></TD>
<TD><a href="<?=$write_href?>"><IMG SRC="<?=$board_skin_path?>/img/list/btn_up.gif" WIDTH=123 HEIGHT=45 border="0"></a></TD>
<TD><IMG SRC="<?=$board_skin_path?>/img/list/title_06.gif" WIDTH=34 HEIGHT=45></TD>
</TR>
<TR>
<TD><IMG SRC="<?=$board_skin_path?>/img/list/title_07.gif" WIDTH=478 HEIGHT=9></TD>
<TD><IMG SRC="<?=$board_skin_path?>/img/list/title_08.gif" WIDTH=123 HEIGHT=9></TD>
<TD><IMG SRC="<?=$board_skin_path?>/img/list/title_09.gif" WIDTH=34 HEIGHT=9></TD>
</TR>
</TABLE>
<!-- End 타이틀이미지 -->
<table align=center width="635" cellspacing="0" cellpadding="0">
<tr height="20">
    <td width="50%"></td>
    <td align="right" style="font:normal 11px tahoma; color:#BABABA;">
        Total <?=number_format($total_count)?>
        <? if ($rss_href) { ?><a href='<?=$rss_href?>'><img src='<?=$board_skin_path?>/img/btn_rss.gif' border=0 align=absmiddle></a><?}?>
        <? if ($admin_href) { ?><a href="<?=$admin_href?>"><img src="<?=$board_skin_path?>/img/btn_admin.gif" title="관리자" width="63" height="22" border="0" align="absmiddle"></a><?}?></td>
</tr>
</table>
<!-- 게시판 목록 시작 -->
<table align=center width="635" background="<?=$board_skin_path?>/img/view/ecy_view_bg.gif" cellpadding=0 cellspacing=0>
<TR><TD><IMG SRC="<?=$board_skin_path?>/img/list/ecy_list_top.gif" WIDTH=635 HEIGHT=13 border="0"></TD></TR>
<tr><td>
<table align=center width="635" cellspacing="0" cellpadding="0">
<form name="fboardlist" method="post" style="margin:0px;">
<input type='hidden' name='bo_table' value='<?=$bo_table?>'>
<input type='hidden' name='sfl'  value='<?=$sfl?>'>
<input type='hidden' name='stx'  value='<?=$stx?>'>
<input type='hidden' name='spt'  value='<?=$spt?>'>
<input type='hidden' name='page' value='<?=$page?>'>
<input type='hidden' name='sw'  value=''>
<? if ($is_admin) { ?>
<tr><td height=30 style='padding-left:20px;'><INPUT onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox> 전체선택</td></tr>
<? } ?>
<tr>
<? for ($i=0; $i<count($list); $i++) { // Thumbnail
    $title = "클릭하시면 해당 상세페이지로 이동합니다.";
    $img = "<img src='$board_skin_path/img/noimg.gif' border=0 width='$thumb_width' title='이미지 없음'>";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];
    if (!file_exists($thumb))
    {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        if (preg_match("/\.(jp[e]?g|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]);
            imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0606);

if (file_exists($thumb))
        $img = "<img src='$thumb' border=0 style='border:1px solid #D4DBE1;'>";
        }
    }

    $view_href = "<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'>";
    if ($list[$i][file][0][file]) {
$thum = "<img src='{$thumb}' width=138 height=105>";
}else{
$thum = "<img src='{$board_skin_path}/img/noimg.gif' width=138 height=105>";
}
    $checkbox = "";
    if ($is_checkbox)
        $checkbox = "<input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'>";

    $tr = "";
    if ($i && $i%$board[bo_gallery_cols]==0)
        $tr = "</tr><tr><td height=10 colspan=$board[bo_gallery_cols]></td></tr><tr>";
    echo "$tr";

    echo <<<HEREDOC
    <td width="152" valign="top" align="center">
        <TABLE align=center WIDTH=138 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR><TD WIDTH=138 HEIGHT=105>{$view_href}{$thum}</a></TD></TR>
<TR><TD><TABLE WIDTH=138 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR><TD colspan=3 HEIGHT=3></TD></TR>
<TR>
<TD WIDTH=18></TD>
<TD align=center valign=middle bgcolor="#F18322" WIDTH=51 HEIGHT=16><font color=#FFFFFF>{$list[$i][ca_name]}</font></TD>
<TD WIDTH=69 HEIGHT=16> {$checkbox}{$view_href}{$list[$i][subject]}</a></TD>
</TR>
<TR><TD colspan=3 HEIGHT=9></TD></TR>
</TABLE></TD></TR>
</TABLE>
    </td>
HEREDOC;
}

// 나머지 td 를 채운다.

if (($cnt = $i%$board[bo_gallery_cols]) != 0)
    for ($k=$cnt; $k<$board[bo_gallery_cols]; $k++)
        echo "<td>&nbsp;</td>\n";

if ($i == 0)
    echo "<td colspan='$board[bo_gallery_cols]' height=50 align=center>게시물이 없습니다.</td>";
?>
</form>
</tr>
</table>

</td></tr>
<TR><TD><IMG SRC="<?=$board_skin_path?>/img/view/ecy_view_11.gif" WIDTH=635 HEIGHT=19 border="0"></TD></TR>
</table>
<!-- 페이지 -->
<table align=center width="635" cellspacing="0" cellpadding="0">
<tr>
    <td width="635" align="center" height=30 valign=bottom>
        <? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/btn_search_prev.gif' border=0 align=absmiddle title='이전검색'></a>"; } ?>
        <?
        // 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
        //echo $write_pages;
        $write_pages = str_replace("처음", "<img src='$board_skin_path/img/begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
        $write_pages = str_replace("이전", "<img src='$board_skin_path/img/prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
        $write_pages = str_replace("다음", "<img src='$board_skin_path/img/next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
        $write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
        $write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "<b><font style=\"font-family:tahoma; font-size:11px; color:#000000\">$1</font></b>", $write_pages);
        $write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font style=\"font-family:tahoma; font-size:11px; color:#E15916;\">$1</font></b>", $write_pages);
        ?>
        <?=$write_pages?>
        <? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' border=0 align=absmiddle title='다음검색'></a>"; } ?>
    </td>
</tr>
</table>

<!-- 링크 버튼 -->
<table align=center width=635 cellpadding=0 cellspacing=0>
<tr>
    <td height="30">
        <? if ($list_href) { ?><a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" border="0"></a><? } ?>
        <? if ($is_checkbox) { ?>
            <a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" border="0"></a>
            <a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/btn_select_copy.gif" border="0"></a>
            <a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/btn_select_move.gif" border="0"></a>
        <? } ?>
    </td>
</tr>
</table>

<script language="JavaScript">
if ('<?=$stx?>') {
    document.fsearch.sfl.value = '<?=$sfl?>';
    document.fsearch.sop.value = '<?=$sop?>';
}
</script>

<? if ($is_checkbox) { ?>
<script language="JavaScript">
function all_checked(sw) {
    var f = document.fboardlist;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]")
            f.elements[i].checked = sw;
    }
}

function check_confirm(str) {
    var f = document.fboardlist;
    var chk_count = 0;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
            chk_count++;
    }

    if (!chk_count) {
        alert(str + "할 게시물을 하나 이상 선택하세요.");
        return false;
    }
    return true;
}

// 선택한 게시물 삭제
function select_delete() {
    var f = document.fboardlist;

    str = "삭제";
    if (!check_confirm(str))
        return;

    if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
        return;

    f.action = "./delete_all.php";
    f.submit();
}

// 선택한 게시물 복사 및 이동
function select_copy(sw) {
    var f = document.fboardlist;

    if (sw == "copy")
        str = "복사";
    else
        str = "이동";
                     
    if (!check_confirm(str))
        return;

    var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");

    f.sw.value = sw;
    f.target = "move";
    f.action = "./move.php";
    f.submit();
}
</script>
<? } ?>
<!-- 게시판 목록 끝 -->
  • 복사

댓글 전체

우선 소스중
imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);
이 부분을 찾아. 
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);
변경후

계정ftp data파일에 엑박나는 게시판을 찾아 썸네일을 몽땅 삭제하시고.
다시 이미지를 업로드 하세요.
© SIRSOFT
현재 페이지 제일 처음으로