¢¸ 2010³â 09¿ù ¢º 123456789101112131415161718192021222324252627282930
Feb
14
Thursday

±×´©º¸µå ¸®½ºÆ® ½æ³×ÀÏ ¸¸µé±â~_~

PHP

<?
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<? for ($i=0; $i<count($list); $i++) { ?>
<?
    $img = "<img src='$board_skin_path/img/noimage.gif' border=0 width='$board[bo_1]' 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_1] / $size[0];
            $height = (int)($size[1] * $rate);

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

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

À̸§ *
ºñ¹Ð¹øÈ£ *
ȨÆäÀÌÁö
½ºÆÔ¹æÁö* 5589bd7b5b (»¡°£»ö ±ÛÀÚ¸¸ ÀÔ·Â Çϼ¼¿ä)
ÀÌÀü±Û¼³ÀÌ´Ù~~~ (2008-02-04)