최신글 타이틀 질문드립니다.
본문
초보라서 어려움이 많네요ㅠㅠ..
최신글 타이틀이 공지사항,질문과답변
이라고 하면 공지,질문 부분에 css를 주고싶은데 어떻게 해야되나요?
latest.skin 에 아래 코드를 수정해야 되는거같은데..
<div id="oneshot">
<div class="la_title"><a href="<?php echo G5_BBS_URL; ?>/board.php?bo_table=<?php echo $bo_table; ?>&me_code=<?php echo $me_code?>"><?php echo $bo_subject; ?></a></div>
<ul>
<?php for ($i=0; $i<count($list); $i++) { ?>
<li>
<div class="img_set">
<a href="<?php echo $list[$i]['href'] ?>">
<?php
$thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $imgwidth, $imgheight);
if($thumb['src']) {
$img_content = '<img class="img_left" src="'.$thumb['src'].'" alt="'.$list[$i]['subject'].'" width="'.$imgwidth.'" height="'.$imgheight.'">';
} else {
$img_content = 'NO IMAGE';
}
echo $img_content;
?>
</a>
<p class="img_title"><a href="<?php echo $list[$i]['href'] ?>"><?=cut_str($list[$i]['wr_subject'], 30)?></a></p>
</div>
</li>
<?php } ?>
</ul>
</div>
답변 1
목록에서 공지글인지 확인은
$list[$i]['is_notice']
이 변수를 이용해요. 값이 있으면 공지글이에요
<?php
$noticecss = "";
if( $list[$i]['is_notice'] )
$noticecss = "noticecss"; // noticecss를 정의해야겠죠.
if( !$list[$i]['wr_is_comment']){
//원글
$qnacss = "qnacss";
}
?>
<div class="<?php echo $noticecss?> <?php echo $qnacss?>">.....</div>
답변을 작성하시기 전에 로그인 해주세요.