최근게시물에 의해 썸네일은 생성되나 불러오지 못합니다. > 그누4 질문답변

그누4 질문답변

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

최근게시물에 의해 썸네일은 생성되나 불러오지 못합니다. 정보

최근게시물에 의해 썸네일은 생성되나 불러오지 못합니다.

본문

올 3월부터 갤러리 최근게시물이 작동하지 않네요.

최근게시물에 의해 썸네일은 생성되지만 제대로 생성이 안되는 것 같아요.

올 3월 이전에 올린 게시물은 메인화면에서 썸네일이 불러와 지는데...

3월 이후 게시물부터 썸네일이 불러와지지 않네요.

썸네일 경로를 찾아 보니 해당되는 곳에 화일이 존재하는 걸로 봐서

최근게시물에 의해 썸네일이 생성되는 것 같아요.

그래서 생성된 그 화일을 직접 다운로드 받은 후 그래픽뷰어로 불러오니

알 수 없는 포맷이라고 합니다.

조언부탁드릴게요.

참고로 latest.skin.php 파일입니다.

---------------------------------------------------------

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

if (!$board[bo_3]) alert("해당 게시판 설정 : 여분 필드 3 에 목록에서 보여질 이미지의 가로 크기를 설정하십시오.");
if (!$board[bo_4]) alert("해당 게시판 설정 : 여분 필드 4 에 목록에서 보여질 이미지의 세로 크기를 설정하십시오.");
if (!$board[bo_9]) alert("해당 게시판 설정 : 여분 필드 9 에 목록에서 보여질 이미지의 질(quality)을 비율로 설정하십시오. (100 이하)");
if (!$board[bo_5]) alert("해당 게시판 설정 : 여분 필드 5 에 목록에서 보여질 한 줄당 가로 이미지 수를 설정하십시오.");
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';

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

$mod = $board[bo_5]; //이미지 가로 갯수
?>
<link rel='stylesheet' type='text/css' href='<?=$latest_skin_path?>/ms1021style.css'>
<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
<tr><td align="center">

<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<?
for ($i=0; $i<count($list); $i++)
{
    if ($i && $i%$mod==0)
        echo "</tr><tr>";

    else if ($i > 0)
        echo "<td width=20>&nbsp;</td>";

    $img = "<img src='$latest_skin_path/img/no_image.gif' border=0 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 = $board[bo_3] / $size[0];
            $height = (int)($size[1] * $rate);

            if ($height < $board[bo_4])
                $dst = imagecreatetruecolor($board[bo_3], $height);
            else
                $dst = imagecreatetruecolor($board[bo_3], $board[bo_4]);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_3], $height, $size[0], $size[1]);
            imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $board[bo_9]);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
        }
    }

    if (file_exists($thumb))
        $img = "<img src='$thumb' border=0>";

    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";

    echo <<<HEREDOC
    <td valign="top" align="center">
        <table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
            <td height="5" align="center"></td>
</tr>

<tr>
            <td align=center style='border:1px solid #cccccc; padding:1px'><div style='position: relative; overflow:hidden;' align=center><a href='{$list[$i][href]}' onfocus='this.blur()'>{$img}</a></div></td>
</tr>

</tr>

<tr>
            <td height="5" align="center"></td>
</tr>

<tr>
            <td height="20" align="center" class="sub"><a href='{$list[$i][href]}'>{$list[$i][subject]}</a></td>
</tr>
<tr>
            <td height="30" align="center"></td>
</tr>
</table>
    </td>
HEREDOC;
}
?>
</tr>
</table>

</td></tr>
</table>
  • 복사

댓글 전체

단순히 섬네일 소스만 올려주신다고 해결되지 않습니다.
원인이 생기는 게시판의 주소같은걸 보여주시면
소스를 올려주시는것보다 더 빠른 답변을 얻으실수 잇습니다.
© SIRSOFT
현재 페이지 제일 처음으로