전체 최신글에서 특정 게시판을 제외 하고 싶은데요 ㅠ 채택완료
<?php
include_once("./_common.php");
$list = array();
$sql_common = " from {$g5['board_new_table']} a, {$g5['board_table']} b where a.bo_table = b.bo_table and b.bo_use_search = 1 ";
$sql_common .= " and a.wr_id = a.wr_parent ";
$sql_order = " order by a.bn_id desc ";
$sql = " select a.*, b.bo_subject {$sql_common} {$sql_order} limit {$rows} ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++) {
$tmp_write_table = $g5['write_prefix'].$row['bo_table'];
//원글
$row2 = sql_fetch(" select * from {$tmp_write_table} where wr_id = '{$row['wr_id']}' ");
$list[$i] = $row2;
// 당일인 경우 시간으로 표시함
$datetime = substr($row2['wr_datetime'],0,10);
$datetime2 = $row2['wr_datetime'];
if ($datetime == G5_TIME_YMD) {
$datetime2 = substr($datetime2,11,5);
} else {
$datetime2 = substr($datetime2,5,5);
}
$list[$i]['board_href'] = G5_BBS_URL.'/board.php?bo_table='.$row['bo_table'];
$list[$i]['href'] = G5_BBS_URL.'/board.php?bo_table='.$row['bo_table'].'&wr_id='.$row2['wr_id'];
$list[$i]['subject'] = conv_subject($row2['wr_subject'], $subject_len, '…');
$list[$i]['datetime'] = $datetime;
$list[$i]['datetime2'] = $datetime2;
$list[$i]['bo_subject'] = $row['bo_subject'];
$list[$i]['wr_subject'] = $row2['wr_subject'];
}
for ($i=0,$count_list=count($list); $i<$count_list; $i++) {
?>
<li>
<div class="conts">
<a href="<?php echo $list[$i]['board_href']; ?>" class="board_name"><?php echo $list[$i]['bo_subject']; ?></a>
<a href="<?php echo $list[$i]['href']; ?>" class="over">
<span class="board_title"><?php echo $list[$i]['subject']; ?></span>
<span class="board_hits"><?php echo $list[$i]['wr_hit']; ?></span>
<span class="board_time"><?php echo $list[$i]['datetime2']; ?></span>
</a>
</div>
</li>
<?php
}
?>
스킨게시판에서 받아서 적용하는데 ..
특정 게시판을 제외하고 싶은데 어떻게 해야 할까요??
답변 2개
2개 이상일 경우 계속 사용하기 좀 뭐하시면
and a.bo_table not in ('특정게시판코드1', '특정게시판코드2',)"'특정게시판코드3';
이런식으로 사용하셔도 되십니다.
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
</strong></p><p>$sql_common = " from {$g5['board_new_table']} a, {$g5['board_table']} b where a.bo_table = b.bo_table and b.bo_use_search = 1<strong> and a.bo_table != '특정게시판코드'</strong>";</p><p>이렇게 수정하시면 됩니다. </p><p><strong>
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
'특정게시판코드','특정게시판코드' 이렇게 하니 에러가 나네요
and a.bo_table != '특정게시판코드' and a.bo_table != '특정게시판코드' and a.bo_table != '특정게시판코드' 이렇게 계속 써줘야 하나요 ㅠㅠ?