으

특정게시판 최근게시물에 보이지 안게

좌측에 나오는 최근게시물에 특정게시판 제목 나오지 안게 하려면 어떻게 해야되는지요?

댓글 4개

php 코드 수정을 해야 합니다.

좌측에 나오는 소스를 모르기 때문에 뭐라고 말씀 드릴 수는 없습니다.

아마도 select * from g4_board .... 이렇게 되어져 있을듯 한데

select * from g4_board ... where bo_table not in('해당 게시판이름') 하시면 됩니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$new_count = 11; //한번에 보여줄 갯수
$page_count = 11; //페이지출력수
$subjc = 37;//제목 글자수

?>
<table width="185" height="30" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td background="<?=$connect_skin_path?>/img/new_bg.gif">
<?
$target1 = "1";
$target = "3";//지정일(지정일 이후에 등록된 글만 추출하기 위함(by nasca)
$duration = date("Y-m-d", $g4[server_time] - ($target * 86400));
$duration1 = date("Y-m-d", $g4[server_time] + ($target1 * 86400));
$sql = " select count(bn_id) as cnt from $g4[board_new_table]
where bn_datetime between '$duration' and '$duration1'
order by bn_datetime ";
//print_r2($sql);//쿼리문 확인을 위해 기입
$result = sql_fetch($sql);
$total = $result[cnt];
?>    <a href='<?=$g4[bbs_path]?>/new.php' onfocus='this.blur()'>최근게시물   </a> <span class='small' style='color:#FF9900;'>(최근3일:<?=$total?>건<? if ($total>=1) {echo "<img src='$g4[path]/img/icon_new.gif'>";}?>)</span>
</td></tr></table><table><tr><td></td></tr></table>
<div style='float:center;' >
<table width="99%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" bgcolor=#ffffff>
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td bgcolor=#ffffff><img src="<?=$g4[path]?>/img/line_mid_p1.gif"></td>
<td width=100% background="<?=$g4[path]?>/img/line_mid_p5.gif" bgcolor=#ffffff></td>
<td bgcolor=#ffffff><img src="<?=$g4[path]?>/img/line_mid_p2.gif"></td></tr>
<tr><td background="<?=$g4[path]?>/img/line_mid_p8.gif" bgcolor=#ffffff></td><td width=170 bgcolor=#ffffff>

<?
$sql2 = " select count(*) as cnt from $g4[board_new_table]
where wr_id = wr_parent ";
$row2 = sql_fetch($sql2);
$total_count = number_format($row2[cnt]);
$rows = $page_count;
$total_page = ceil($total_count / $rows);
if (!$scpage) { $scpage = 1; }
$from_record = ($scpage - 1) * $rows;
$sql = " select bo_table, wr_id, wr_parent from $g4[board_new_table] a
where a.wr_id = a.wr_parent
and bo_table <> 'postit'
group by bo_table, wr_parent
order by bn_id desc limit $from_record, $new_count ";
$res = sql_query($sql);

echo "<table width=95% cellpadding=0 cellspacing=0 align=center>";

$list = array();
$list = array();
for ($i=0; $row=sql_fetch_array($res), $i<$new_count; $i++)
{
if (!$row[bo_table])
{
continue;
}
$tmp_table = $g4[write_prefix].$row[bo_table];
$sql2 = " select wr_datetime, wr_subject, wr_comment from $tmp_table where wr_id = '$row[wr_parent]' ";




$row2 = sql_fetch($sql2);
$list[$i] = $row2;
$subj = $list[$i][wr_subject];
$subj = conv_subject($subj, $subjc,'...');
$comment = "";
if ($list[$i][wr_comment])
$comment = "<span class=small>({$list[$i][wr_comment]})</span>";
echo "<tr><td height=18 class=bg_menu2 title='$subj' >";
echo "<nobr style='display:block;overflow:hidden;width:170px;'>";
if($list[$i][wr_datetime] >= date("Y-m-d", $g4[server_time] -(3600*24*4))) {
echo "<img src='$g4[path]/img/icon_new.gif' align='absmiddle'><a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_parent]'>";} else {
echo "<img src='$g4[path]/img/top.gif' align='absmiddle'><a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_parent]'>";}
echo " $comment $subj</a>";
echo "</nobr></td></tr>";
}
if (!$total_count) {
echo "<tr><td align=center width=170><span style='color:gray;'><br><img src='$g4[path]/img/latest_icon.gif' align='absmiddle'> 게시글이 없습니다.<br><br><br></span></td></tr>";
}else{

echo "<tr><td style='padding:0px;'><span style='color:gray;'>";
$scpage = get_paging($page_count, $scpage, $total_page, "?gr_id=$gr_id&bo_table=$bo_table&scpage=");
echo "<br>$scpage";
echo "</span></td></tr>";
}
echo "</table>\n";
?>
</td><td background="<?=$g4[path]?>/img/line_mid_p6.gif" bgcolor=#ffffff></td></tr>
<tr><td><img src="<?=$g4[path]?>/img/line_mid_p4.gif" bgcolor=#ffffff></td>
<td width=100% background="<?=$g4[path]?>/img/line_mid_p7.gif" bgcolor=#ffffff></td>
<td><img src="<?=$g4[path]?>/img/line_mid_p3.gif" bgcolor=#ffffff></td></tr></table></td></tr></table></div>
$sql = " select count(bn_id) as cnt from $g4[board_new_table]
where bn_datetime between '$duration' and '$duration1'
order by bn_datetime ";

-> where bn_datetime between '$duration' and '$duration1' and bo_table not in ('postit')


$sql2 = " select count(*) as cnt from $g4[board_new_table]
where wr_id = wr_parent ";
-> where wr_id = wr_parent and bo_table not in ('postit')";


$sql = " select bo_table, wr_id, wr_parent from $g4[board_new_table] a
where a.wr_id = a.wr_parent
and bo_table <> 'postit'
group by bo_table, wr_parent
order by bn_id desc limit $from_record, $new_count ";
->
where a.wr_id = a.wr_parent
and bo_table not in ('postit')


3군데 고치셔야 하겠네요 .

게시판을 추가 하실려면

bo_table not in ('postit', 'test1', 'test2')

처럼 하시면 됩니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
10-07-11 조회 1,918
10-07-11 조회 2,395
10-07-11 조회 1,207
10-07-11 조회 1,568
10-07-11 조회 1,679
10-07-11 조회 1,744
10-07-11 조회 1,654
10-07-11 조회 1,637
10-07-11 조회 1,808
10-07-10 조회 2,044
10-07-10 조회 2,403
10-07-10 조회 1,476
10-07-10 조회 1,606
10-07-10 조회 1,722
10-07-10 조회 1,637
10-07-10 조회 1,813
10-07-10 조회 1,420
10-07-10 조회 1,624
10-07-10 조회 1,607
10-07-10 조회 1,327