갤러리 게시판 뷰페이지에서 노이미지 noimage 출력 질문 입니다. 정보
갤러리 게시판 뷰페이지에서 노이미지 noimage 출력 질문 입니다.
첨부파일
본문
뷰페이지에서 도대체 어디에 코드를 넣어야 노이미지가 출력 될까요.
<table id=image_content cellpadding=0 cellspacing=0 border=0>
<tr>
<?
// 파일 출력
for ($i = 0; $i < count( $file ); $i++ )
{
$original_file = $file[$i][path]."/".$file[$i][file];
$thumb_file = $file[$i][path]."/thumb_".$file[$i][file];
if ( ! file_exists( $thumb_file ) ) // 썸네일 시작
{
list( $img_width, $img_height, $type ) = @getimagesize( $original_file );
if ( $type == 1 ) $img_sour = imagecreatefromgif( $original_file );
else if ( $type == 2 ) $img_sour = imagecreatefromjpeg( $original_file );
else if ( $type == 3 ) $img_sour = imagecreatefrompng( $original_file );
else return false;
if ( $img_width > $img_height )
{
$width = round( $reheight * $img_width / $img_height );
$height = $reheight;
}
else
{
$width = $rewidth;
$height = round( $rewidth * $img_height / $img_width );
}
if ( $width < $rewidth )
{
$width = round( ( $height + $rewidth - $width ) * $img_width / $img_height );
$height = round( ( $width + $rewidth - $width ) * $img_height / $img_width );
}
else if ($height < $reheight)
{
$height = round( ( $width + $reheight - $height ) * $img_height / $img_width );
$width = round( ( $height + $reheight - $height ) * $img_width / $img_height );
}
$x_last = round( ( $width - $rewidth ) / 2 );
$y_last = round( ( $height - $reheight ) / 2 );
if ( ( $img_width < $rewidth ) || ( $img_height < $reheight ) )
{
$img_last = imagecreatetruecolor( $rewidth, $reheight );
$x_last = round( ( $rewidth - $img_width ) / 2 );
$y_last = round( ( $reheight - $img_height ) / 2 );
imagecopy( $img_last, $img_sour, $x_last, $y_last, 0, 0, $width, $height );
imagedestroy( $img_sour );
$white = imagecolorallocate( $img_last, 255, 255, 255);
imagefill( $img_last, 0, 0, $white );
}
else
{
$img_dest = imagecreatetruecolor( $width, $height );
imagecopyresampled( $img_dest, $img_sour, 0, 0, 0, 0, $width, $height, $img_width, $img_height );
$img_last = imagecreatetruecolor( $rewidth, $reheight );
imagecopy( $img_last, $img_dest, 0, 0, $x_last, $y_last, $width, $height );
imagedestroy( $img_dest );
}
if ( $type == 1 ) imagegif($img_last, $thumb_file, 100);
else if ( $type == 2 ) imagejpeg($img_last, $thumb_file, 100);
else if ( $type == 3 ) imagepng($img_last, $thumb_file, 100);
imagedestroy($img_last);
} // 썸네일 끝
?>
<td style='padding:5px;' width=<?=$td_width?> height=<?=$td_height?> align=center valign=bottom onmouseover='image_over ( <?=$i?> )' onmouseout='image_out( <?=$i?> )'>
<div style='clear:both;'>
<img src='<?=$thumb_file?>' id=thumb_image align=absmiddle style='border:3px solid #ffffff;'>
</div>
</td>
<script language='javascript'>
array_image[<?=$i?>] = "<?=$original_file?>";
</script>
<?
}
?>
<table id=image_content cellpadding=0 cellspacing=0 border=0>
<tr>
<?
// 파일 출력
for ($i = 0; $i < count( $file ); $i++ )
{
$original_file = $file[$i][path]."/".$file[$i][file];
$thumb_file = $file[$i][path]."/thumb_".$file[$i][file];
if ( ! file_exists( $thumb_file ) ) // 썸네일 시작
{
list( $img_width, $img_height, $type ) = @getimagesize( $original_file );
if ( $type == 1 ) $img_sour = imagecreatefromgif( $original_file );
else if ( $type == 2 ) $img_sour = imagecreatefromjpeg( $original_file );
else if ( $type == 3 ) $img_sour = imagecreatefrompng( $original_file );
else return false;
if ( $img_width > $img_height )
{
$width = round( $reheight * $img_width / $img_height );
$height = $reheight;
}
else
{
$width = $rewidth;
$height = round( $rewidth * $img_height / $img_width );
}
if ( $width < $rewidth )
{
$width = round( ( $height + $rewidth - $width ) * $img_width / $img_height );
$height = round( ( $width + $rewidth - $width ) * $img_height / $img_width );
}
else if ($height < $reheight)
{
$height = round( ( $width + $reheight - $height ) * $img_height / $img_width );
$width = round( ( $height + $reheight - $height ) * $img_width / $img_height );
}
$x_last = round( ( $width - $rewidth ) / 2 );
$y_last = round( ( $height - $reheight ) / 2 );
if ( ( $img_width < $rewidth ) || ( $img_height < $reheight ) )
{
$img_last = imagecreatetruecolor( $rewidth, $reheight );
$x_last = round( ( $rewidth - $img_width ) / 2 );
$y_last = round( ( $reheight - $img_height ) / 2 );
imagecopy( $img_last, $img_sour, $x_last, $y_last, 0, 0, $width, $height );
imagedestroy( $img_sour );
$white = imagecolorallocate( $img_last, 255, 255, 255);
imagefill( $img_last, 0, 0, $white );
}
else
{
$img_dest = imagecreatetruecolor( $width, $height );
imagecopyresampled( $img_dest, $img_sour, 0, 0, 0, 0, $width, $height, $img_width, $img_height );
$img_last = imagecreatetruecolor( $rewidth, $reheight );
imagecopy( $img_last, $img_dest, 0, 0, $x_last, $y_last, $width, $height );
imagedestroy( $img_dest );
}
if ( $type == 1 ) imagegif($img_last, $thumb_file, 100);
else if ( $type == 2 ) imagejpeg($img_last, $thumb_file, 100);
else if ( $type == 3 ) imagepng($img_last, $thumb_file, 100);
imagedestroy($img_last);
} // 썸네일 끝
?>
<td style='padding:5px;' width=<?=$td_width?> height=<?=$td_height?> align=center valign=bottom onmouseover='image_over ( <?=$i?> )' onmouseout='image_out( <?=$i?> )'>
<div style='clear:both;'>
<img src='<?=$thumb_file?>' id=thumb_image align=absmiddle style='border:3px solid #ffffff;'>
</div>
</td>
<script language='javascript'>
array_image[<?=$i?>] = "<?=$original_file?>";
</script>
<?
}
?>
댓글 전체
<img src='<?=$thumb_file?>' id=thumb_image align=absmiddle style='border:3px solid #ffffff;'> 를
<img src='<?=$thumb_file?>' id=thumb_image align=absmiddle style='border:3px solid #ffffff;' onerror="this.src='noimage경로';"> 로해보세요
<img src='<?=$thumb_file?>' id=thumb_image align=absmiddle style='border:3px solid #ffffff;' onerror="this.src='noimage경로';"> 로해보세요
반응이 앖네요 ㅠㅠ