전체 최신글에서 게시판 제외 하는 방법 좀 알려주세요 정보
전체 최신글에서 게시판 제외 하는 방법 좀 알려주세요본문
똑같은 질문은 한 적이 있는데 ㅠ_ㅠ
코드가 틀려놓으니..손 댈 수가 없네요..ㅠ_ㅠ
http://sir.co.kr/bbs/board.php?bo_table=g4_qa&wr_id=75687&sca=&sfl=wr_subject&stx=%C0%FC%C3%BC%B0%D4%BD%C3%B9%B0+%C1%A6%BF%DC&sop=and
expand에 소스입니다.
<?
function latest_scroll($skin_dir="",$rows, $subject_len,$options="")
{
global $config;
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
$list = array();
$sql = " select a.*, b.bo_subject, c.gr_subject, c.gr_id
from $g4[board_new_table] a, $g4[board_table] b, $g4[group_table] c
where a.bo_table = b.bo_table and b.gr_id = c.gr_id and b.bo_use_search = '1' and a.wr_id = a.wr_parent
order by a.bn_id desc limit 0,$rows";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
{
$tmp_write_table = $g4[write_prefix].$row[bo_table];
$row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
$list[$i] = $row2;
$list[$i][bo_table] = $row[bo_table];
$list[$i][bo_subject] = $row[bo_subject];
$list[$i][gr_subject] = $row[gr_subject];
$list[$i][href] = "$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row2[wr_id]";
$list[$i][wr_subject] = cut_str($row2[wr_subject], $subject_len, "…");
$list[$i][comment_cnt] = "";
if ($row2[wr_comment])
$list[$i][comment_cnt] = "($row2[wr_comment])";
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
코드가 틀려놓으니..손 댈 수가 없네요..ㅠ_ㅠ
http://sir.co.kr/bbs/board.php?bo_table=g4_qa&wr_id=75687&sca=&sfl=wr_subject&stx=%C0%FC%C3%BC%B0%D4%BD%C3%B9%B0+%C1%A6%BF%DC&sop=and
expand에 소스입니다.
<?
function latest_scroll($skin_dir="",$rows, $subject_len,$options="")
{
global $config;
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
$list = array();
$sql = " select a.*, b.bo_subject, c.gr_subject, c.gr_id
from $g4[board_new_table] a, $g4[board_table] b, $g4[group_table] c
where a.bo_table = b.bo_table and b.gr_id = c.gr_id and b.bo_use_search = '1' and a.wr_id = a.wr_parent
order by a.bn_id desc limit 0,$rows";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
{
$tmp_write_table = $g4[write_prefix].$row[bo_table];
$row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
$list[$i] = $row2;
$list[$i][bo_table] = $row[bo_table];
$list[$i][bo_subject] = $row[bo_subject];
$list[$i][gr_subject] = $row[gr_subject];
$list[$i][href] = "$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row2[wr_id]";
$list[$i][wr_subject] = cut_str($row2[wr_subject], $subject_len, "…");
$list[$i][comment_cnt] = "";
if ($row2[wr_comment])
$list[$i][comment_cnt] = "($row2[wr_comment])";
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
댓글 전체
for 문 바로 다음줄에 넣으세요
if($row['bo_table'] == "제외할게시판 테이블명") continue;
if($row['bo_table'] == "제외할게시판 테이블명") continue;
투사님이 알려주신 방법을 사용하면, 게시물이 보이지 않는게 아니라 공백으로 처리되어 노출이 됩니다.. 제목만 뜨지 않을뿐 이라는거죠.... 그래도 투사님 덕에 힌트 얻어서 root님 답변 참고삼아 해결했네요
$sql = " select a.*, b.bo_subject, c.gr_subject, c.gr_id
from $g4[board_new_table] a, $g4[board_table] b, $g4[group_table] c
where a.bo_table = b.bo_table and b.gr_id = c.gr_id and b.bo_use_search = '1' and a.wr_id = a.wr_parent
and a.bo_table <> '특정게시판' order by a.bn_id desc limit 0,$rows";
이렇게 하니 되네요^^
$sql = " select a.*, b.bo_subject, c.gr_subject, c.gr_id
from $g4[board_new_table] a, $g4[board_table] b, $g4[group_table] c
where a.bo_table = b.bo_table and b.gr_id = c.gr_id and b.bo_use_search = '1' and a.wr_id = a.wr_parent
and a.bo_table <> '특정게시판' order by a.bn_id desc limit 0,$rows";
이렇게 하니 되네요^^