갤러리형 최신글 이미지 아래 제목추가 질문드립니다.
본문

<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$g4[path]/lib/thumb.lib.php");
global $is_admin, $member;
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
$thumb_width = "95"; //썸네일 가로 크기
$thumb_height = "95"; //썸네일 세로 크기
$thumb_quality = "90"; //썸네일 이미지 품질
$filter[type] = "99";
$filter[arg1] = "100";
$filter[arg2] = "1";
$filter[arg3] = "2";
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
$g2_color_set = "1"; //최근게시물 색상 선택은 1~4 중 하나를 입력하세요
$g2_round = "fff"; //최근게시물 기본색상 테두리를 넣으려면 "e1e1e1" 로 수정하세요
$thumb_main = "3"; //메인에 보이게 할 썸네일 갯수
$arrow_top = "35"; //좌우버튼 상단에서 떨어지는 거리
?>
<script type="text/javascript" src="<?php echo $latest_skin_path ?>/js/jquery.simple_slider.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $latest_skin_path ?>/css/color_set<?php echo $g2_color_set ?>.css">
<style type="text/css">
.g2_list_wrap {border-right:1px solid #<?php echo $g2_round ?>; border-bottom:1px solid #<?php echo $g2_round ?>; border-left:1px solid #<?php echo $g2_round ?>; text-align:left}
#g2_gallery_list {height:<?php echo $thumb_height + 20 ?>px; text-align:center; overflow:hidden}
#g2_main {margin:0 auto; width:<?php echo ($thumb_width * $thumb_main) + 50 ?>px; height:<?php echo $thumb_height ?>px; overflow:hidden}
#g2_arrow_prev {float:left; margin-top:<?php echo $arrow_top ?>px}
#g2_arrow_next {float:right; margin-top:<?php echo $arrow_top ?>px}
.objImgFrame {width:<?php echo $thumb_width ?>px}
.simple_slider_hover {cursor:pointer}
.simple_slider_disabled {cursor:default; opacity:0.5; filter:alpha(opacity=50); zoom:1}
.g2_no_list {text-align:center; color:#767676}
</style>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#g2_gallery_list').show();
jQuery('#g2_gallery_thumb').simple_slider({
'leftID': 'leftNav',
'rightID': 'rightNav',
'display': <?php echo $thumb_main ?> //메인에 보이게 할 썸네일 갯수
})
});
</script>
<div class="g2_latest_wrap">
<div class="g2_title_wrap">
<div class="g2_title"><a href="<?php echo $g4[bbs_path] ?>/board.php?bo_table=<?php echo $bo_table ?>"><?php echo $board[bo_subject] ?></a></div>
<div class="g2_title_shadow"><?php echo $board[bo_subject] ?></div>
</div>
<div class="g2_right_wrap">
<?php if ($is_admin == "super" || $is_auth) { ?>
<div class="g2_right_btn2"><a href="<?php echo $g4['path'] ?>/adm/board_form.php?w=u&bo_table=<?php echo $bo_table ?>">ADMIN</a></div>
<?php } ?>
<?php if ($member[mb_level] >= $board[bo_write_level]) { ?>
<?php if ($is_admin) { ?>
<div class="g2_right_btn1"><a href="<?php echo $g4[bbs_path] ?>/write.php?bo_table=<?php echo $bo_table ?><?php echo $write_href ?>">WRITE</a></div>
<?php } else { ?>
<div class="g2_right_btn2"><a href="<?php echo $g4[bbs_path] ?>/write.php?bo_table=<?=$bo_table?><?php echo $write_href ?>">WRITE</a></div>
<?php } ?>
<div class="g2_right_btn1"><a href="<?php echo $g4[bbs_path] ?>/board.php?bo_table=<?php echo $bo_table ?>">MORE</a></div>
<?php } else { ?>
<div class="g2_right_btn2"><a href="<?php echo $g4[bbs_path] ?>/board.php?bo_table=<?php echo $bo_table ?>">MORE</a></div>
<?php } ?>
</div>
<div class="g2_title_bg_top"></div>
<div class="g2_title_bg_bottom"></div>
<div class="g2_list_wrap" id="g2_gallery_list">
<div id="g2_main" style="margin-top:10px">
<?php if (!count($list) == 0) { ?>
<div id="g2_arrow_prev"><img src="<?php echo $latest_skin_path ?>/img/prev.gif" width="17" height="22" border="0" alt="" title="" id="leftNav" /></div>
<div id="g2_arrow_next"><img src="<?php echo $latest_skin_path ?>/img/next.gif" width="17" height="22" border="0" alt="" title="" id="rightNav" /></div>
<?php } ?>
<div id="g2_gallery_thumb">
<?php
for ($i = 0; $i < count($list); $i++) {
$noimg = $latest_skin_path."/img/_noimg.gif";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
if ($list[$i][wr_id]) {
$thumb = thumbnail($file, $thumb_width, $thumb_height, 0, 1, $thumb_quality, 0, "", $filter, $noimg);
}
if ($edit_img = $list[$i]['wr_content']) {
if (eregi("data/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)", $edit_img, $tmp)) {
$file = $g4[path].'/' . $tmp[0]; // 파일명
$thumb = thumbnail($file, $thumb_width, $thumb_height, 0, 1, $thumb_quality, 0, "", $filter, $noimg);
}
}
?>
<a href="<?php echo $list[$i][href] ?>"><img src="<?php echo $thumb ?>" width="<?php echo $thumb_width ?>" height="<?php echo $thumb_height ?>" border="0" alt="<?php echo $list[$i]['subject'] ?>" title="<?php echo $list[$i]['subject'] ?>"></a>
<?php } ?>
</div>
<?php if (count($list) == 0) { ?>
<div class="g2_no_list">게시물이 없습니다.</div>
<?php } ?>
</div>
</div>
</div>
답변 1
간단히 소스 뒤에 아래만 붙이면 되겠네요.
<br><?php echo $list[$i]['subject'] ?>" title="<?php echo $list[$i]['subject'] ?>
<a href="<?php echo $list[$i][href] ?>"><img src="<?php echo $thumb ?>" width="<?php echo $thumb_width ?>" height="<?php echo $thumb_height ?>" border="0" alt="<?php echo $list[$i]['subject'] ?>" title="<?php echo $list[$i]['subject'] ?>"></a>
<br><?php echo $list[$i]['subject'] ?>