말

전체게시물을 특정 게시판을 제외하고 뽑고 싶은데 방법좀 알려주세요

검색으로 조금이나마 흡사한 질문을 보니 - -;대부분 미완료더군요..해서 이래 글남깁니다...
http://moneymaking.co.kr 좌측 하단부에 최근게시물이라고 보일겁니다^^;;;
 
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가(특정페이지에 include시키는 경우만 출력시켜 줌)
include_once("./_common.php");
$g4['title'] = "나의 최근 게시물";
$wid = "190";//전체적인 폭
$hgt = "20";//(예비) 전체저긴 높이(셀당 높이)
?>
<?
    $new_count = 10;//출력될 목록 수
    $cnt = 0;
    $sql = " select bo_table, wr_parent from $g4[board_new_table] a
              where a.wr_id = a.wr_parent
                group by bo_table, wr_parent
                order by bn_id desc
                limit $new_count ";
    $res = sql_query($sql);
echo "
<table width='{$wid}' height='{$hgt}' border='0' bgcolor='#ffffff' cellspacing='0' cellpadding='0' background='' nowrap>
";
  echo "<tr>";
echo "<td>";
    echo "<table width=100% cellpadding=0 cellspacing=0 align=center>";
    //echo "<tr height='{$hgt}'><td><a href='$g4[bbs_path]/new.php'><img src='$g4[path]/images/t_post.gif'><span style='color:#333333; margin-top:10px;'></span></a></td></tr>";
    echo "<tr height='{$hgt}'><td><span style='color:#333333;'>최근게시물</span></td></tr>";
    echo "<tr height='5'><td></td></tr>";
    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_subject, wr_comment from $tmp_table where wr_id = '$row[wr_parent]' ";
        $row2 = sql_fetch($sql2);
        $subj = get_text($row2[wr_subject]);
        $comment = "";
        if ($row2[wr_comment])
            $comment = "<span class=small>($row2[wr_comment])</span>";
        echo "<tr height='{$hgt}'><td class=bg_menu2 title='$subj'>";
        echo "<nobr style='display:block;overflow:hidden;width:190px;'>"; //추출되는 제목의 길이를 제어
        echo "<a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_parent]'>";
         if ($comment) {
          echo "<span style='color:#666666;'> $comment $subj</span></a>";//코멘트 있을 경우 출력
     //} else if ($comcol) {
     } else {
          echo "<span style='color:#666666;'> $subj</span></a>";//코멘트 없을 경우 출력
     }
        echo "</nobr></td></tr>";
        $cnt++;
    }
    if (!$cnt)
        echo "<tr><td><span style='color:gray;'>게시글이 없습니다.</span></td></tr>";
    echo "</table>";
echo "</td>";
echo "<td></td>";
  echo "</tr>";
echo "</table>\n";
?>

댓글 5개

$sql2 = " select wr_subject, wr_comment from $tmp_table where wr_id = '$row[wr_parent]' AND bo_table <> '특정게시판' ";

bo_table이 맞는지 모르겠습니다만... 게시판 ID 값 들어있는 필드 적으세용...

<> 이건 not 입니다..
select wr_subject, wr_comment from g4_write_md4 where wr_id = '1' AND bo_table <> 'scrollbanner'
1054 : Unknown column 'bo_table' in 'where clause'

에러문이 뜨네요 ㅠ- ㅠ
$sql = " select bo_table, wr_parent from $g4[board_new_table] a
where a.wr_id = a.wr_parent
and a.bo_table <> '특정게시판'
group by bo_table, wr_parent
order by bn_id desc
limit $new_count ";
^^되네요 감사합니다..제외게시판을 추가로 제외 하는 방법은 어떻게 하나요?
and a.bo_table <> '특정게시판' 만 추가하니 되네요^^ 감사합니다~~Root님 ㅎㅎㅎ
댓글을 작성하시려면 로그인이 필요합니다.

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

+
제목 글쓴이 날짜 조회
07-11-12 조회 940
07-11-12 조회 1,872
07-11-12 조회 1,023
07-11-12 조회 1,101
07-11-12 조회 1,631
07-11-12 조회 1,636
07-11-11 조회 1,667
07-11-11 조회 1,590
07-11-11 조회 896
07-11-11 조회 1,019
07-11-11 조회 1,697
07-11-11 조회 1,312
07-11-11 조회 1,598
07-11-11 조회 1,088
07-11-11 조회 1,603
07-11-11 조회 1,478
07-11-11 조회 1,136
07-11-11 조회 2,318
07-11-11 조회 1,596
07-11-11 조회 1,602