테스트 사이트 - 개발 중인 베타 버전입니다

겔러리형 최신글에서 이미지수 출력 조절은 어떻게 하나요?

· 14년 전 · 1493 · 2
겔러리형 최신글에서 다음과 같이 입력했습니다
<?=latest2("junggo", "aa", 12, 30,"파노라마")?>
했더니 가로5개 x 세로3(5+5+2)줄로 출력이 되네요

이것을 가로6개x세로2(6+6)줄로 하고 싶은데 아무리해도 안되서
이것 같고 밤세 씨름했는데도 해결을 못했어요...
부디 고수님의 지도를 간절히 부탁드립니다

아래에 최신글 스킨의 "latest.skin.php"파일을 올립니다
================================================


<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

// 이미지 보이기 전체 보이기는 0
$all_view = 1;
// 미리보기 이미지크기
$img_w = 100;
$img_h = 80;
// 넓이로 맞췄을때 높이의 중간지점에서 80%로 복구시킨다.
$Percent = 80;
?>
<style type="text/css">
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
</style>


<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width=7 height=7><img src="<?=$latest_skin_path?>/img/bg_tl.gif" width=7></td>
<td background="<?=$latest_skin_path?>/img/bg_t.gif"></td>
<td width=6><img src="<?=$latest_skin_path?>/img/bg_tr.gif" width=6></td>
</tr>
<tr>
<td background="<?=$latest_skin_path?>/img/bg_ml.gif"></td>
<td>


<div style="padding:5px; ">
<strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong> <?=$ca_name?>
</div>

<table width=100% border=0 cellpadding=0 cellspacing=0 <?=$options?>>
<tr>


<? for ($i=0; $i<count($list); $i++) {
$ex2_filed = explode("|",$list[$i][wr_2]);
$ext2_08 = $ex2_filed[8];

$ex3_filed = explode("|",$list[$i][wr_3]);
$ext3_00 = $ex3_filed[0];
$ext3_01 = $ex3_filed[1];
$ext3_02 = $ex3_filed[2];

?>
<td width="20%" align=center valign=top>
<table width=95% border=0 cellpadding=0 cellspacing=0>
<tr><td height="10"></td></tr>
<tr>
<td width="100%" align="center">
<?
//$list[$i]['file'] = get_file($board['bo_table'], $list[$i]['wr_id']);
for($j=0; $j<$list[$i]['file']['count']; $j++){
if($list[$i][file][$j][image_type]){
// 이미지 출력시 가로세로 사이지를 확인하여 틀에 공백이 않보이게 사이즈를 조절한다.
$size_w = $img_w/($list[$i][file][$j][image_width]/100);
$size_h = $list[$i][file][$j][image_height]/100*$size_w;
if($img_h < $size_h){
$size[$i] = "width=$img_w";
// 높이의 경우 벗어난 사이즈에서 $Percent만큼 복구 시킨다.
$position_top = ($img_h-$size_h)/2+($Percent*($size_h-$img_h)/200);
$position_left = 0;
}else{
$size[$i] = "height=$img_h";
$size_h = $img_h/($list[$i][file][$j][image_height]/100);
$size_w = $list[$i][file][$j][image_width]/100*$size_h;
$position_top = 0;
$position_left = ($img_w-$size_w)/2;
}

if($list[$i][wr_link1]){
$href = $list[$i][wr_link1];
$target = "_blank";
}else{
$href = "bbs/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}";
$target = "_self";
}
?>
<table width="<?=$img_w+6?>" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td align="center" valign="middle" bgcolor="#FFFFFF"><nobr style='display:block; overflow:hidden; width:<?=$img_w?>px; height:<?=$img_h?>px; vertical-align:middle;'><a href="<?=$href?>" target="<?=$target?>"><img src="<?=$list[$i][file][$j][path]."/".urlencode($list[$i][file][$j][file])?>" <?=$size[$i]?> border="0" style="cursor:pointer; position:relative; top:<?=$position_top?>; left:<?=$position_left?>"></a></nobr></td>
</tr>
</table>
<?
if($all_view)
break;
}
}
?>
</td>
</tr>
<tr>
<td height=30 align="center">

<p>
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
echo $list[$i]['subject'];
echo "</a>";

if ($list[$i]['comment_cnt'])
echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-size:10px; color:#FF6600;'>{$list[$i]['comment_cnt']}</span></a>";

// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }

//echo " " . $list[$i]['icon_new'];
//echo " " . $list[$i]['icon_file'];
//echo " " . $list[$i]['icon_link'];
//echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
?>
<br />
<?=$ext2_08?><br />
<img src="<?=$latest_skin_path?>/img/dada_1.gif"><?=$ext3_00?>/<?=$ext3_01?>/<?=$ext3_02?>
<br />
<?=$list[$i][wr_8]?>/<?=$list[$i][wr_9]?>/<?=$list[$i][wr_10]?><br />
<br />
</p></td>
</tr>
</table>
</td>
<?
if(($i+1)%5 == 0)
echo " </tr><tr>";
}

if(!count($list)){
?>
<td align=center valign=top>
<table width=95% border=0 cellpadding=0 cellspacing=0>
<tr>
<td height=50 align="center" >
등록되어진 게시물이 없습니다.
</td>
</tr>
</table>
</td>
<? } ?>


</tr>

</table>


</td>
<td background="<?=$latest_skin_path?>/img/bg_mr.gif"></td>
</tr>
<tr>
<td height=7><img src="<?=$latest_skin_path?>/img/bg_bl.gif" width=7></td>
<td background="<?=$latest_skin_path?>/img/bg_b.gif"></td>
<td><img src="<?=$latest_skin_path?>/img/bg_br.gif" width=6></td>
</tr>
</table>

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 2개

<?
if(($i+1)%5 == 0) // 가로출력(숫자를6으로)
echo " </tr><tr>";
}

if(!count($list)){
?>
초보의 3일간 고민을 찔러주신 정곡답변으로 완벽하게 해결했습니다!
감사의 말씀을 어떻게 전해야 할지 모르겠습니다
정말 기쁘고 감사합니다

게시글 목록

번호 제목
284508
284499
284492
284490
284484
284481
284478
284476
284474
284472
284470
284458
284457
284454
284453
284447
284446
284444
284441
284440