최근게시물 문의드려요
본문
사용중인 최근게시물 스킨엔데요 썸네일 1개가 나오고 다른글은 글씨만나오는데요 썸네일이 3개가 나오게하려면 어느부분을 수정해야하는지 문의드립니다 고수님들 도와주세욤~ㅠㅠ]
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
$sql = " select * from {$g5['board_table']} where bo_table = '{$bo_table}' ";
$board = sql_fetch($sql);
if ($options) list($width, $height, $wrap_width, $content_length) = explode(',', $options);
if (!$width) $width = 100;
if (!$height) $height = 65;
if (!$content_length) $content_length = 120;
add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);
?>
<a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>" class="lt_titl">
<?php echo $bo_subject ?> </a>
<div class="latest-zinez"<?php if ($wrap_width) { echo ' style="width:'.$wrap_width.'px;"'; } ?>>
<ul>
<?php
for ($i=0; $i<count($list); $i++) {
if ($i == 0) {
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $width, $height);
if($thumb['src']) {
$img_content = '<a href="'.$list[$i]['href'].'"><img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" class="img"></a>';
} else {
$img_content = '<span class="img" style="width:'.$width.'px; height:'.$height.'px;">No image</span>';
}
?>
<li>
<div class="title"><a href="<?php echo $list[$i]['href']; ?>"><?php echo $list[$i]['subject']; ?></a></div>
<div class="thumb"><?php echo $img_content; ?></div>
<div class="article" style="height:<?php echo $height; ?>px; margin-left:<?php echo $width+10; ?>px;">
<p class="co"><a href="<?php echo $list[$i]['href']; ?>"><?php echo cut_str(preg_replace("/ /", "", strip_tags($list[$i]['wr_content'])), $content_length); ?></a></p>
</div>
</li>
<?php
} else {
?>
<li class="text_lin"><a href="<?php echo $list[$i]['href']; ?>"><?php echo $list[$i]['subject']; ?></a></li>
<?php
}
}
if (count($list) == 0) { //게시물이 없을 때 ?>
<li class="nodata">게시물이 없습니다.</li>
<?php } ?>
</ul>
</div>
답변 1
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
$sql = " select * from {$g5['board_table']} where bo_table = '{$bo_table}' ";
$board = sql_fetch($sql);
if ($options) list($width, $height, $wrap_width, $content_length) = explode(',', $options);
if (!$width) $width = 100;
if (!$height) $height = 65;
if (!$content_length) $content_length = 120;
add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);
?>
<a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>" class="lt_titl">
<?php echo $bo_subject ?>
</a>
<div class="latest-zinez"<?php if ($wrap_width) { echo ' style="width:'.$wrap_width.'px;"'; } ?>>
<ul>
<?php
for ($i=0; $i<count($list); $i++) {
if ($i < 3 ) {
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $width, $height);
if($thumb['src']) {
$img_content = '<a href="'.$list[$i]['href'].'"><img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" class="img"></a>';
} else {
$img_content = '<span class="img" style="width:'.$width.'px; height:'.$height.'px;">No image</span>';
}
?>
<li>
<div class="title"><a href="<?php echo $list[$i]['href']; ?>"><?php echo $list[$i]['subject']; ?></a></div>
<div class="thumb"><?php echo $img_content; ?></div>
<div class="article" style="height:<?php echo $height; ?>px; margin-left:<?php echo $width+10; ?>px;">
<p class="co"><a href="<?php echo $list[$i]['href']; ?>"><?php echo cut_str(preg_replace("/ /", "", strip_tags($list[$i]['wr_content'])), $content_length); ?></a></p>
</div>
</li>
<?php
} else {
?>
<li class="text_lin"><a href="<?php echo $list[$i]['href']; ?>"><?php echo $list[$i]['subject']; ?></a></li>
<?php
}
}
if (count($list) == 0) { //게시물이 없을 때 ?>
<li class="nodata">게시물이 없습니다.</li>
<?php } ?>
</ul>
</div>
3개만 나오게
!-->