최근 이미지 게시물 질문;; 정보
최근 이미지 게시물 질문;;본문
여기 적용한 최근게시물 이미지는 전체크기에서 반토막 나서 상위모습만 보여지게
올라오는데요.
전체이미지가 축소된채로 보이게 할려면 어떻게 소스를 수정해야되나요?
밑은 적용된 스킨 소스입니다.
-------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!$board[bo_9]) alert("해당 게시판 설정 : 여분 필드 9 에 목록에서 보여질 이미지의 질(quality)을 비율로 설정하십시오. (100 이하)");
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb100';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
$mod = 5; //이미지 가로 갯수
?>
<!-- <?=$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> </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 = 100 / $size[0];
$height = (int)($size[1] * $rate);
if ($height < 75)
$dst = imagecreatetruecolor(100, $height);
else
$dst = imagecreatetruecolor(100, 75);
imagecopyresampled($dst, $src, 0, 0, 0, 0, 100, $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 width='100' height='75' style='width:100px;height:75px;border:1px solid #CCCCCC; padding:3px'><div style='width:100px; height:75px; 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 width="100" height="20" align="center" class="sub"><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'>{$list[$i][subject]}</a></td>
</tr>
</table>
</td>
HEREDOC;
}
?>
</tr>
</table>
</td></tr>
</table>
올라오는데요.
전체이미지가 축소된채로 보이게 할려면 어떻게 소스를 수정해야되나요?
밑은 적용된 스킨 소스입니다.
-------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!$board[bo_9]) alert("해당 게시판 설정 : 여분 필드 9 에 목록에서 보여질 이미지의 질(quality)을 비율로 설정하십시오. (100 이하)");
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb100';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
$mod = 5; //이미지 가로 갯수
?>
<!-- <?=$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> </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 = 100 / $size[0];
$height = (int)($size[1] * $rate);
if ($height < 75)
$dst = imagecreatetruecolor(100, $height);
else
$dst = imagecreatetruecolor(100, 75);
imagecopyresampled($dst, $src, 0, 0, 0, 0, 100, $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 width='100' height='75' style='width:100px;height:75px;border:1px solid #CCCCCC; padding:3px'><div style='width:100px; height:75px; 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 width="100" height="20" align="center" class="sub"><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'>{$list[$i][subject]}</a></td>
</tr>
</table>
</td>
HEREDOC;
}
?>
</tr>
</table>
</td></tr>
</table>
댓글 전체
헐. 소스가 길어서 다음 분으루 패스...ㅠㅠ