초보 최신글관련 질문좀 드립니다.
본문
안녕하세요 최신글관련 질문좀 드립니다.
아래 소스는 그누메인화면에 사용하고 있는 최신글 소스인데요 메인화면에서 이미지 클릭했을때
1번링크로 바로 이동하게 하고 싶은데 고수님들 한수 지도좀 부탁합니다.
"새해 복 많이 받으세요 감사합니다"
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$cols = 4; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$imgwidth=250; //표시할 이미지의 가로사이즈
$imgheight=300; //표시할 이미지의 세로사이즈
$image_h = 0; // 이미지 상하 간격
$col_width = (int)(100 / $cols);
$data_path = $g4[path]."/data/file/$bo_table";
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="F5F5F5">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100" align="center" bgcolor="red"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><font color="white">전체보기</font></td>
<td height="35" style="padding-left:10px;"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><b><?=$board[bo_subject]?></b></a></td>
<td width="30" height="35" align="center" valign="middle"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>">
<img src="<?=$latest_skin_path?>/img/btn_more.gif" alt="전체보기" border="0" title="전체보기" /></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="0"><!--여백--></td>
</tr>
<tr>
<td align="center" valign="top">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>
<td width="<?=$col_width?>%" align="center" valign="top" style="padding-top:10px;">
<?
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
echo $list[$i][icon_reply] . " ";
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
echo "<tr><td valign='top' align='center'><a href='{$list[$i]['href']}'><img src='$img' width='{$imgwidth}' height='{$imgheight}' align='center' style='width:{$imgwidth}px;height:{$imgheight}px;border:10px solid white; padding:0px'></a></td></tr>";
echo "<tr><td align='center' height='17'><a href='{$list[$i]['href']}'><span style='font-size:9pt;'><b>{$list[$i]['subject']}</b></span></a></td></tr>";
echo "</table>";
?>
</td>
<? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td width=$col_width%></td>";
}
?>
<? if (count($list) == 0) { echo "<td align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table>
</td>
</tr>
</table>
답변 6
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
echo $list[$i][icon_reply] . " ";
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
echo "<tr><td valign='top' align='center'><a href='{$list[$i]['href']}'><img src='$img' width='{$imgwidth}' height='{$imgheight}' align='center' style='width:{$imgwidth}px;height:{$imgheight}px;border:10px solid white; padding:0px'></a></td></tr>";
echo "<tr><td align='center' height='17'><a href='{$list[$i]['href']}'><span style='font-size:9pt;'><b>{$list[$i]['subject']}</b></span></a></td></tr>";
echo "</table>";
?>
네 유튜브요 게시판에 유튜브 동영상 올리면 이미지로 출력되게 할려구여
많은 도움이 되었습니다. 감사합니다.