최신글 이미지 출력 할때.. 정보
최신글 이미지 출력 할때..본문
최신글 이미지 출력할때
가로 2 세로 2 이렇게는 출력이 안되나요?
가로 갯수랑 세로 겟수 설정은 못하는지요?
가로 2 세로 2 이렇게는 출력이 안되나요?
가로 갯수랑 세로 겟수 설정은 못하는지요?
댓글 전체
가능합니다. 하지만 당연히 latest함수까지 변경되어져야 합니다.
그렇게 하다보면 다른 스킨들과 호환성에 문제가 발생하게 됩니다.
그래서 제가 처리하는 방법은
4입력시 2*2출력방식을 사용합니다.
실제 소스입니다.
get_image_ratio 함수부분은 삭제처리하세요!
<?
if (!defined("_GNUBOARD_")) exit;
$rolls = $rows/2;
if ($rows < 4) $rolls = $rows;
?>
<p>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td>
<span style='font-size:12pt;color:#DDBBBA'><b><?=strtoupper($bo_table)?></b></span>
</td>
</tr>
<tr>
<td valign=middle align=center valign=top>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<? for ($i=0; $i<count($list); $i++) {
$imgsize = get_image_ratio($list[$i][file_image1],$img_width,$img_height);
$align = "center";
if( ($i%$rolls) == 0) { echo "<tr height=10><td colspan=$rolls></td></tr><tr>"; $align = "left";
}
if( ($i%$rolls) == ($rolls-1) ) $align = "right";
?>
<td width='<?=(100/$rows)?>%' align=<?=$align?> valign=top><a href='<?=$list[$i][href]?>'><img src='<?=$list[$i][file_image1]?>' width="<?=$imgsize[width]?>" height="<?=$imgsize[height]?>" border="1" style='border-color:#FFFFFF;' title='<?=$list[$i][subject]?>'></a></td>
<? if( ($i%$rolls) == ($rolls-1) ) echo "</tr>"; ?>
<? } ?>
</table>
</td>
</tr>
</table>
그렇게 하다보면 다른 스킨들과 호환성에 문제가 발생하게 됩니다.
그래서 제가 처리하는 방법은
4입력시 2*2출력방식을 사용합니다.
실제 소스입니다.
get_image_ratio 함수부분은 삭제처리하세요!
<?
if (!defined("_GNUBOARD_")) exit;
$rolls = $rows/2;
if ($rows < 4) $rolls = $rows;
?>
<p>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td>
<span style='font-size:12pt;color:#DDBBBA'><b><?=strtoupper($bo_table)?></b></span>
</td>
</tr>
<tr>
<td valign=middle align=center valign=top>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<? for ($i=0; $i<count($list); $i++) {
$imgsize = get_image_ratio($list[$i][file_image1],$img_width,$img_height);
$align = "center";
if( ($i%$rolls) == 0) { echo "<tr height=10><td colspan=$rolls></td></tr><tr>"; $align = "left";
}
if( ($i%$rolls) == ($rolls-1) ) $align = "right";
?>
<td width='<?=(100/$rows)?>%' align=<?=$align?> valign=top><a href='<?=$list[$i][href]?>'><img src='<?=$list[$i][file_image1]?>' width="<?=$imgsize[width]?>" height="<?=$imgsize[height]?>" border="1" style='border-color:#FFFFFF;' title='<?=$list[$i][subject]?>'></a></td>
<? if( ($i%$rolls) == ($rolls-1) ) echo "</tr>"; ?>
<? } ?>
</table>
</td>
</tr>
</table>