이미지 최근글 관련 도와주시면 감사합니다..
본문
위 사진처럼 메뉴 클릭시 해당 게시판 정보만 나오게 하고 싶은데 아래처럼 다 나오더군요...
도와주시면 감사합니다.
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
// 썸네일 크기 설정
$thumb_width = '200'; //썸네일 넓이
$thumb_height = '80'; //썸네일 높이
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css?ver=1">', 0);
?>
<div class="ltt">
<a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>" class="lt_titlea1"><strong>
<?php echo $bo_subject ?></strong> </a>
<ul style="both:clear;">
<?php for ($i=0; $i<count($list); $i++) {
if ($i=='0' || (($i%2)=='0'))
echo "<li class=\"moc\">";
else echo "<li class=\"moc2\">";
?>
<?php
if ($list[$i]['wr_link1']) {
echo "<a href=\"".$list[$i]['wr_link1']."\" target='_self'>";
} else {
echo "<a href=\"".$list[$i]['href']."\">";
}
if ($list[$i]['ca_name']) echo "<span class='ca_namepink'>" . $list[$i]['ca_name'] . "</span>";
$thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], 320, 200, false, true);
if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" class="img">';
} else {
$img_content = '<img src="'.$latest_skin_url.'/img/noimage.png" alt="'.$thumb['alt'].'" class="img">';
}
echo $img_content;
//echo "</a>";
//echo $list[$i]['icon_reply']." ";
// echo "<a href=\"".$list[$i]['href']."\">";
// if ($list[$i]['is_notice']) echo "<strong>".$list[$i]['subject']."</strong>";
// else
if ($list[$i]['subject']) echo "<span class='subject'>". $list[$i]['subject']."</span>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
//if (isset($list[$i]['icon_new'])) echo " " . $list[$i]['icon_new'];
//if (isset($list[$i]['icon_hot'])) echo " " . $list[$i]['icon_hot'];
//if (isset($list[$i]['icon_file'])) echo " " . $list[$i]['icon_file'];
//if (isset($list[$i]['icon_link'])) echo " " . $list[$i]['icon_link'];
//if (isset($list[$i]['icon_secret'])) echo " " . $list[$i]['icon_secret'];
echo "</a>";
?>
</li>
<?php } ?>
<?php if (count($list) == 0) { //게시물이 없을 때 ?>
<span>게시물이 없습니다.</span>
<?php } ?>
</ul>
</div>
<style>
.ltt .subject { padding:0px 0px 0px 10px;font-size:14px;font-weight:400;}
.ltt .subject{color:#000000;}
</style>
@charset "utf-8";
/* 최근게시물 스킨 (latest) */
.ltt {position:relative;padding:5px 5px ;}
.ltt ul {list-style:none}
.ltt ul:after {display:block;visibility:hidden;clear:both;content:""}
.ltt .moc {float:left;width:49%; height:auto;padding:0 0px 20px 10px;}
.ltt .moc2 {float:right;max-width:50%;height:auto;padding:0 4px 0px 12px;margin-bottom:5px;}
.ltt .img {width:100%;height:auto;border:1px solid #fff;margin:0px 0px 6px 0px;border-radius:7px;}
.ltt a {display:block;color:#000000;font-size:14px; font-weight: 400;font-family: 'Nanum Gothic'; text-decoration:none}
.ltt .lt_titlea1 {display:inline-block;color: #000000;font-size:13px;font-weight:900;line-height: 30px;padding: 0 10px 5px 0px;}
.ltt .lt_allowso2{display:inline-block;padding:0 2px;color:#000000;font-size:0.8em;}
.ltt .ca_namepink {position: absolute; z-index: 1;
padding: 5px 7px 5px 7px;
border-radius: 0px;
margin:1px;
font-weight: 400;
font-size: 14px;
color: #fff;
text-align: center;
background: linear-gradient(to right,rgb(70 93 186),rgb(104 12 124 / 90%));
}
/* Style the tab */
.tab {
overflow: hidden;
border: 1px solid #ccc;
background-color: #f1f1f1;
}
/* Style the buttons that are used to open the tab content */
.tab button {
background-color: inherit;
float: left;
border: none;
outline: none;
cursor: pointer;
padding: 14px 16px;
transition: 0.3s;
}
/* Change background color of buttons on hover */
.tab button:hover {
background-color: #ddd;
}
/* Create an active/current tablink class */
.tab button.active {
background-color: #ccc;
}
/* Style the tab content */
.tabcontent {
display: none;
padding: 6px 12px;
border: 1px solid #ccc;
border-top: none;
}
<!-- Tab links -->
<div class="tab">
<button class="tablinks" onclick="openCity(event, 'movie_pic')">영화</button>
<button class="tablinks" onclick="openCity(event, 'book')">도서</button>
<button class="tablinks" onclick="openCity(event, 'newsplus')">굿즈</button>
</div>
<!-- Tab content -->
<div id="movie_pic" class="ltt">
<?php echo latest("theme/latest_category", 'movie_pic', 2, 38); ?>
</div>
<div id="book" class="ltt">
<?php echo latest("theme/latest_category", 'book', 2, 38); ?>
</div>
<div id="newsplus" class="ltt">
<?php echo latest("theme/latest_category", 'newsplus', 2, 38); ?>
</div>
답변 1
<!-- Tab links -->
<div class="tab">
<button class="tablinks" onclick="openCity(event, 'movie_pic')">영화</button>
<button class="tablinks" onclick="openCity(event, 'book')">도서</button>
<button class="tablinks" onclick="openCity(event, 'newsplus')">굿즈</button>
</div>
<!-- Tab content -->
<div id="movie_pic" class="ltt">
<?php echo latest("theme/latest_category", 'movie_pic', 2, 38); ?>
</div>
<div id="book" class="ltt">
<?php echo latest("theme/latest_category", 'book', 2, 38); ?>
</div>
<div id="newsplus" class="ltt">
<?php echo latest("theme/latest_category", 'newsplus', 2, 38); ?>
</div>
->
<!-- Tab links -->
<div class="tab">
<button class="tablinks" onclick="openCity(event, 'movie_pic')">영화</button>
<button class="tablinks" onclick="openCity(event, 'book')">도서</button>
<button class="tablinks" onclick="openCity(event, 'newsplus')">굿즈</button>
</div>
<!-- Tab content -->
<div id="movie_pic" class="ltt">
<?php echo latest("theme/latest_category", 'movie_pic', 2, 38); ?>
</div>
<div id="book" class="ltt">
<?php echo latest("theme/latest_category", 'book', 2, 38); ?>
</div>
<div id="newsplus" class="ltt">
<?php echo latest("theme/latest_category", 'newsplus', 2, 38); ?>
</div>
<script>
function openCity(evt, cate) {
$('.ltt').hide();
$('#' + cate).show();
}
</script>
!-->!-->
답변을 작성하시기 전에 로그인 해주세요.