최신글 체인지 이미지 질문? > 그누4 질문답변

그누4 질문답변

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

최신글 체인지 이미지 질문? 정보

최신글 체인지 이미지 질문?

본문

동시에 한페이지에 여러개를 출력하려면 $options="1" 부분의 숫자를 각각 다르게 하라고 해서
작업을 진행 했는데 문제는....
썸네일 이미지 사이즈 조절이 않되네요 어떻게 해야 하나요?


<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");

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

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

$thumb_width = "600"; // 썸네일 가로사이즈
$thumb_height = "175"; // 썸네일 세로사이즈
$thumb_quality = "100"; // 썸네일 퀼리티
$thumb_delay = "5000"; //1초는 1000, 2초는 2000....
$thumb_id = $options;
?>

<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="1" align="center">
<tr><td align="center">
<?
for ($i=0; $i<count($list); $i++)
{
    $img = "<div style='width:100px; height:85px; border:1px; solid #CCCCCC;'></div>";
    //$thumb = $thumb_path.'/'.$list[$i][wr_id];
    $thumb = $thumb_path.'/'.$list[$i][file][0][file];
    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]);
            imagejpeg($dst, $thumb_path.'/'.$list[$i][file][0][file], $thumb_quality);
            chmod($thumb_path.'/'.$list[$i][file][0][file], 0606);

//            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 = "<img src='{$thumb}' align='absmiddle' border='0' width='259' height='175' >";
    }

$body_data = "
<table width='259' height='175'  id='id_".$thumb_id.$i."' style='display:none' border='1' cellpadding='0' cellspacing='0' align='center'>

<tr>
            <td style='border:1px; solid #CCCCCC; padding:3px;' align='center'><a href='{$list[$i][href]}' onfocus='this.blur()'>{$img}</a></td>
</tr>
</table>
";

echo $body_data;
}
?></td>
</tr>
</table>

<script language='JavaScript'>
var s_<?=$thumb_id?> = "1";
var s_id_<?=$thumb_id?> = "1";
function f_<?=$thumb_id?>_init() {
eval("document.all.id_<?=$thumb_id?>"+s_<?=$thumb_id?>+".style.display='none'");
eval("document.all.id_<?=$thumb_id?>"+s_id_<?=$thumb_id?>+".style.display='block'");

s_<?=$thumb_id?> = s_id_<?=$thumb_id?>;

s_id_<?=$thumb_id?>++;
if (s_id_<?=$thumb_id?> > <?=$i-1?>) s_id_<?=$thumb_id?> = "0";

setTimeout("f_<?=$thumb_id?>_init()", <?=$thumb_delay?>);
}
</script>

<script language='JavaScript'>
<? if (count($list) > "0"){ echo "f_{$thumb_id}_init();"; } ?>
</script>

* nate : *** 개인정보보호를 위한 이메일주소 노출방지 *** / 프로그래머분 과 같이 친구 하고 싶습니다. 약간의 정보공유하면서...

댓글 전체

전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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