최근게시물 노이미지 생성질문? 정보
최근게시물 노이미지 생성질문?본문
게시물 첨부이미지가 없으면 최신게시물에 노이미지가 뜨지 않고
오류메시지와함께 엑박이미지가 뜹니다...
소스좀 보시고 잘못된부분 수정좀 부탁드립니다^^
오류나는 주소는 http://dusong.co.kr/
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style>
.rtop, .rbottom{display:block; background: #ffffff;}
.rtop *, .rbottom *{display: block; height: 1px; overflow: hidden; background: #F0F0F0;}
.rtop2, .rbottom2{display:block; background: #f0f0f0;}
.rtop2 *, .rbottom2 *{display: block; height: 1px; overflow: hidden; background: #f9f9f9;}
.rtop3, .rbottom3{display:block; background: #ffffff;}
.rtop3 *, .rbottom3 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.rtop5, .rbottom5{display:block; background: #ffffff;}
.rtop5 *, .rbottom5 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.rtop6, .rbottom6{display:block; background: #ffffff;}
.rtop6 *, .rbottom6 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.r1{margin: 0 5px}
.r2{margin: 0 3px}
.r3{margin: 0 2px}
.r4{margin: 0 1px; height: 2px}
.r5{margin: 0 5px}
.r6{margin: 0 3px}
.r7{margin: 0 2px}
.r8{margin: 0 1px; height: 2px}
</style>
<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<table width="361" border="0" cellspacing="0" cellpadding="0">
<tr>
<?
for ($i=0; $i<count($list); $i++)
{
if ($i > 0)
$title = cut_str(get_text($list[$i][wr_subject]),27);
$content = cut_str(get_text($list[$i][wr_content]), 80);
$subject = cut_str(get_text($list[$i][subject]), 10); //목록 글 줄이는 함수
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$latest_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
$thumbx=100;
$thumby=75;
$thumbyy = $thumby+6;
$destfile =$img.'Thumb';
$size = @getimagesize($img);
if(is_array($size) && !is_file($destfile)) {
switch($size[2]) {
case(1) :
if(function_exists('ImageCreateFromGif')) $im = ImageCreateFromGif($img);
break;
case(2) :
if(function_exists('ImageCreateFromJpeg')) $im = ImageCreateFromJpeg($img);
break;
case(3) :
if(function_exists('ImageCreateFromPng')) $im = ImageCreateFromPng($img);
break;
}
$fixsize = mando_image_size($size[0], $size[1], $thumbx, $thumby);
if($im) {
if($i==0) @exec("rm ".dirname($_SERVER[SCRIPT_FILENAME])."/data/file/$bo_table/*Thumb-rf");
if(function_exists('ImageCreateTrueColor')) $newim = ImageCreateTrueColor($fixsize[x],$fixsize[y]);
else $newim = ImageCreate($fixsize[x],$fixsize[y]);
if(function_exists('ImageCopyResampled')) ImageCopyResampled($newim,$im,0,0,0,0,$fixsize[x],$fixsize[y],$size[0],$size[1]);
else ImageCopyResized($newim,$im,0,0,0,0,$fixsize[x],$fixsize[y],$size[0],$size[1]);
ImageDestroy($im);
ImageJpeg($newim, $destfile, 100);
ImageDestroy($newim);
unset($im, $newim);
}
$list[$i][img][x] = $fixsize[x];
$list[$i][img][y] = $fixsize[y];
} else {
if(is_file($destfile)) {
$size = @getimagesize($destfile);
$list[$i][img][x] = $size[0];
$list[$i][img][y] = $size[1];
} else {
$img = "";
$size = @getimagesize($img);
$list[$i][img][x] = $thumbx;
$list[$i][img][y] = $thumby;
}
}
if(is_file($destfile))$img = $destfile;
if($i==0){
echo <<<HEREDOC
<td align="center" width="86">
<table width=90 cellpadding="0" cellspacing="0" border="0" style="padding:0px;">
<tr align=center>
<td width=90 align="center" style='padding-top:0px;'>
<table width=76 align="center" bgcolor='#ffffff' cellpadding="0" cellspacing="0" border="0">
<tr><td align="center" valign="middle" style='border:1px solid #cfcfcf'><a href="{$list[$i][href]}"><img src=" {$destfile}" width="{$list[$i][img][x]}" height="{$list[$i][img][y]}" border="0" alt="$content"></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height=17 align="center" valign="middle" style='padding-top:5px;padding-bottom:5px;border:0px solid #777777'><a href="{$list[$i][href]}" style='font-family:돋움;font-size:12px;color:#6A6A6A'>{$list[$i][subject]}</a>{$list[$i][icon_new]}</td>
<td width="30" align=right height="9" style="padding-top:2; padding-right:8" font style='font-family:돋움; font-size:8pt; color:#6A6A6A;'></td>
</tr>
</table>
</td>
<td align="center" >
<table width="100%" height=90 cellpadding="0" cellspacing="0" border="0" style="padding:0px;" >
HEREDOC;
}else{
echo <<<HEREDOC
<tr>
<td height=19 align="left" valign="middle" style='padding-top:2px;padding-bottom:2px;border:0px solid #777777'> <img src="$latest_skin_path/img/board_icon.gif" width="2" height="2">
<a href="{$list[$i][href]}" style='font-family:돋움;font-size:12px;color:#6A6A6A'>$title </a>{$list[$i][icon_new]}</td><td width="30" align=right height="17" style="padding-top:2; padding-right:8" font style='font-family:돋움; font-size:8pt; color:#6A6A6A;'>{$list[$i][datetime2]}</td>
</tr>
<? } ?>
HEREDOC;
if($i<(count($list)-1)){echo "<tr><td colspan='1' height='1' background='$latest_skin_path/img/dot_bg.gif'></td></tr>";}
}
}
?>
</table>
</td>
</tr>
</table>
오류메시지와함께 엑박이미지가 뜹니다...
소스좀 보시고 잘못된부분 수정좀 부탁드립니다^^
오류나는 주소는 http://dusong.co.kr/
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style>
.rtop, .rbottom{display:block; background: #ffffff;}
.rtop *, .rbottom *{display: block; height: 1px; overflow: hidden; background: #F0F0F0;}
.rtop2, .rbottom2{display:block; background: #f0f0f0;}
.rtop2 *, .rbottom2 *{display: block; height: 1px; overflow: hidden; background: #f9f9f9;}
.rtop3, .rbottom3{display:block; background: #ffffff;}
.rtop3 *, .rbottom3 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.rtop5, .rbottom5{display:block; background: #ffffff;}
.rtop5 *, .rbottom5 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.rtop6, .rbottom6{display:block; background: #ffffff;}
.rtop6 *, .rbottom6 *{display: block; height: 1px; overflow: hidden; background: #0099FF;}
.r1{margin: 0 5px}
.r2{margin: 0 3px}
.r3{margin: 0 2px}
.r4{margin: 0 1px; height: 2px}
.r5{margin: 0 5px}
.r6{margin: 0 3px}
.r7{margin: 0 2px}
.r8{margin: 0 1px; height: 2px}
</style>
<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<table width="361" border="0" cellspacing="0" cellpadding="0">
<tr>
<?
for ($i=0; $i<count($list); $i++)
{
if ($i > 0)
$title = cut_str(get_text($list[$i][wr_subject]),27);
$content = cut_str(get_text($list[$i][wr_content]), 80);
$subject = cut_str(get_text($list[$i][subject]), 10); //목록 글 줄이는 함수
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$latest_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
$thumbx=100;
$thumby=75;
$thumbyy = $thumby+6;
$destfile =$img.'Thumb';
$size = @getimagesize($img);
if(is_array($size) && !is_file($destfile)) {
switch($size[2]) {
case(1) :
if(function_exists('ImageCreateFromGif')) $im = ImageCreateFromGif($img);
break;
case(2) :
if(function_exists('ImageCreateFromJpeg')) $im = ImageCreateFromJpeg($img);
break;
case(3) :
if(function_exists('ImageCreateFromPng')) $im = ImageCreateFromPng($img);
break;
}
$fixsize = mando_image_size($size[0], $size[1], $thumbx, $thumby);
if($im) {
if($i==0) @exec("rm ".dirname($_SERVER[SCRIPT_FILENAME])."/data/file/$bo_table/*Thumb-rf");
if(function_exists('ImageCreateTrueColor')) $newim = ImageCreateTrueColor($fixsize[x],$fixsize[y]);
else $newim = ImageCreate($fixsize[x],$fixsize[y]);
if(function_exists('ImageCopyResampled')) ImageCopyResampled($newim,$im,0,0,0,0,$fixsize[x],$fixsize[y],$size[0],$size[1]);
else ImageCopyResized($newim,$im,0,0,0,0,$fixsize[x],$fixsize[y],$size[0],$size[1]);
ImageDestroy($im);
ImageJpeg($newim, $destfile, 100);
ImageDestroy($newim);
unset($im, $newim);
}
$list[$i][img][x] = $fixsize[x];
$list[$i][img][y] = $fixsize[y];
} else {
if(is_file($destfile)) {
$size = @getimagesize($destfile);
$list[$i][img][x] = $size[0];
$list[$i][img][y] = $size[1];
} else {
$img = "";
$size = @getimagesize($img);
$list[$i][img][x] = $thumbx;
$list[$i][img][y] = $thumby;
}
}
if(is_file($destfile))$img = $destfile;
if($i==0){
echo <<<HEREDOC
<td align="center" width="86">
<table width=90 cellpadding="0" cellspacing="0" border="0" style="padding:0px;">
<tr align=center>
<td width=90 align="center" style='padding-top:0px;'>
<table width=76 align="center" bgcolor='#ffffff' cellpadding="0" cellspacing="0" border="0">
<tr><td align="center" valign="middle" style='border:1px solid #cfcfcf'><a href="{$list[$i][href]}"><img src=" {$destfile}" width="{$list[$i][img][x]}" height="{$list[$i][img][y]}" border="0" alt="$content"></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height=17 align="center" valign="middle" style='padding-top:5px;padding-bottom:5px;border:0px solid #777777'><a href="{$list[$i][href]}" style='font-family:돋움;font-size:12px;color:#6A6A6A'>{$list[$i][subject]}</a>{$list[$i][icon_new]}</td>
<td width="30" align=right height="9" style="padding-top:2; padding-right:8" font style='font-family:돋움; font-size:8pt; color:#6A6A6A;'></td>
</tr>
</table>
</td>
<td align="center" >
<table width="100%" height=90 cellpadding="0" cellspacing="0" border="0" style="padding:0px;" >
HEREDOC;
}else{
echo <<<HEREDOC
<tr>
<td height=19 align="left" valign="middle" style='padding-top:2px;padding-bottom:2px;border:0px solid #777777'> <img src="$latest_skin_path/img/board_icon.gif" width="2" height="2">
<a href="{$list[$i][href]}" style='font-family:돋움;font-size:12px;color:#6A6A6A'>$title </a>{$list[$i][icon_new]}</td><td width="30" align=right height="17" style="padding-top:2; padding-right:8" font style='font-family:돋움; font-size:8pt; color:#6A6A6A;'>{$list[$i][datetime2]}</td>
</tr>
<? } ?>
HEREDOC;
if($i<(count($list)-1)){echo "<tr><td colspan='1' height='1' background='$latest_skin_path/img/dot_bg.gif'></td></tr>";}
}
}
?>
</table>
</td>
</tr>
</table>
댓글 전체
해결 되었내요..
// <table width=76 align="center" bgcolor='#ffffff' cellpadding="0" cellspacing="0" border="0">
<tr><td align="center" valign="middle" style='border:1px solid #cfcfcf'><a href="{$list[$i][href]}"><img src=" {$destfile}" width="{$list[$i][img][x]}" height="{$list[$i][img][y]}" border="0" alt="$content"></a></td> //
이부분을
// <table width=76 align="center" bgcolor='#ffffff' cellpadding="0" cellspacing="0" border="0">
<tr><td align="center" valign="middle" style='border:1px solid #cfcfcf'><a href="{$list[$i][href]}"><img src=" {$img}" width="{$list[$i][img][x]}" height="{$list[$i][img][y]}" border="0" alt="$content"></a></td> //
하니까 되내요.. 감사합니다^^
// <table width=76 align="center" bgcolor='#ffffff' cellpadding="0" cellspacing="0" border="0">
<tr><td align="center" valign="middle" style='border:1px solid #cfcfcf'><a href="{$list[$i][href]}"><img src=" {$destfile}" width="{$list[$i][img][x]}" height="{$list[$i][img][y]}" border="0" alt="$content"></a></td> //
이부분을
// <table width=76 align="center" bgcolor='#ffffff' cellpadding="0" cellspacing="0" border="0">
<tr><td align="center" valign="middle" style='border:1px solid #cfcfcf'><a href="{$list[$i][href]}"><img src=" {$img}" width="{$list[$i][img][x]}" height="{$list[$i][img][y]}" border="0" alt="$content"></a></td> //
하니까 되내요.. 감사합니다^^