팁텍 전체게시물을 특정 게시판을 제외하고 뽑고 싶은데 방법좀 알려주세요
본문
<?
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";
?>
==========================================================
$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 ";
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";
?>
==========================================================
$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 ";
관련링크
댓글목록 0
등록된 댓글이 없습니다.