전체게시물을 특정 게시판을 제외하고 뽑고 싶은데 방법좀 알려주세요 > 그누4 질문답변

그누4 질문답변

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

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

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

본문

검색으로 조금이나마 흡사한 질문을 보니 - -;대부분 미완료더군요..해서 이래 글남깁니다...
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";
?>

댓글 전체

$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 ";
전체 66,558 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT