제외게시판 또는 제외그룹 다는 방법 좀 알려 주세요. 정보
제외게시판 또는 제외그룹 다는 방법 좀 알려 주세요.
본문
extend/new.php입니다.
나타나지 말아야 할 게시판이 있는데요.
제외그룹이나 제외게시판 다는 방법이 있을까요?
실력이 딸려서 적용하기 너무 어렵네요.
======================================
<?php
/*
사용 예) <?php echo my_new(20, 40, "120px");
*/
function get_new($rowCnt, $maxStr)
{
global $g4, $gr_id, $config;
$maxRow = 100;
$s = "
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'
order by a.bn_id desc
limit $maxRow
";
$i = 0;
$res = mysql_query($s);
while ($row = mysql_fetch_array($res))
{
if ($i >= $rowCnt) break;
if ($row[wr_id] == $row[wr_parent]) // 원글이라면
{
$s = "
select wr_id, wr_subject, wr_comment, wr_datetime
from $g4[write_prefix]$row[bo_table]
where wr_id = '$row[wr_id]'
";
$list[$i] = mysql_fetch_array(mysql_query($s));
$list[$i][commentCnt] = $list[$i][wr_comment];
$list[$i][subject] = cut_str(get_text($list[$i][wr_subject]), $maxStr);
$list[$i][href] = "$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id={$list[$i][wr_id]}";
$list[$i][title] = addslashes(get_text($list[$i][wr_subject])." / ".$list[$i][wr_datetime]);
$i++;
}
}
return $list;
}
function my_new($rowCnt = 10, $maxStr = 20, $maxWidth = "100%") { global $g4; $list = get_new($rowCnt, $maxStr); ?>
<table width="220" border="0" cellpadding="0" cellspacing="1" bgcolor="C0C0C0">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td valign="top" bgcolor="FFFFFF" style="padding:0px">
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0" height="28">
<tr>
<td width="4%" height="30"> </td>
<td width="96%" height="30"><strong><a href="<?=$g4['bbs_path']?>/new.php"><span style="font-size:9pt;"><font face="돋움" color="#000000">새로운 게시물</font></span></a>
</strong></td>
</tr>
</table>
</td>
</tr>
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" >
<tr>
<td width="5"></td>
<td width="210" height="1" bgcolor="#DDDDDD"></td>
<td width="5"></td>
</tr>
</table>
</td>
</tr>
<?php $n = count($list); for ($i = 0; $i < $n; $i++) { ?>
<tr>
<td colspan=4 align=center>
<table width=95%>
<tr>
<td height=19>
<nobr style='display:block; overflow:hidden; width:210;'>
<span style="font-weight:normal;">
<!-- 코멘트 수 -->
<?php if ($list[$i][commentCnt]) { ?>
<font color="#E60000">(<?php echo $list[$i][commentCnt]; ?>)</font>
<?php } ?>
<!-- // 코멘트 수 -->
<!-- 제목 -->
<a href="<?php echo $list[$i][href]; ?>" title="<?php echo $list[$i][title]; ?>">
<font color="#000000">
<?php echo $list[$i][subject]; ?>
<!-- // 제목 -->
</span>
</a>
</nobr>
</td></tr>
</table></td>
</tr>
<?php } ?>
</table>
</td></tr>
</table>
</td></tr>
</table>
<?php } ?>
나타나지 말아야 할 게시판이 있는데요.
제외그룹이나 제외게시판 다는 방법이 있을까요?
실력이 딸려서 적용하기 너무 어렵네요.
======================================
<?php
/*
사용 예) <?php echo my_new(20, 40, "120px");
*/
function get_new($rowCnt, $maxStr)
{
global $g4, $gr_id, $config;
$maxRow = 100;
$s = "
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'
order by a.bn_id desc
limit $maxRow
";
$i = 0;
$res = mysql_query($s);
while ($row = mysql_fetch_array($res))
{
if ($i >= $rowCnt) break;
if ($row[wr_id] == $row[wr_parent]) // 원글이라면
{
$s = "
select wr_id, wr_subject, wr_comment, wr_datetime
from $g4[write_prefix]$row[bo_table]
where wr_id = '$row[wr_id]'
";
$list[$i] = mysql_fetch_array(mysql_query($s));
$list[$i][commentCnt] = $list[$i][wr_comment];
$list[$i][subject] = cut_str(get_text($list[$i][wr_subject]), $maxStr);
$list[$i][href] = "$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id={$list[$i][wr_id]}";
$list[$i][title] = addslashes(get_text($list[$i][wr_subject])." / ".$list[$i][wr_datetime]);
$i++;
}
}
return $list;
}
function my_new($rowCnt = 10, $maxStr = 20, $maxWidth = "100%") { global $g4; $list = get_new($rowCnt, $maxStr); ?>
<table width="220" border="0" cellpadding="0" cellspacing="1" bgcolor="C0C0C0">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td valign="top" bgcolor="FFFFFF" style="padding:0px">
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0" height="28">
<tr>
<td width="4%" height="30"> </td>
<td width="96%" height="30"><strong><a href="<?=$g4['bbs_path']?>/new.php"><span style="font-size:9pt;"><font face="돋움" color="#000000">새로운 게시물</font></span></a>
</strong></td>
</tr>
</table>
</td>
</tr>
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" >
<tr>
<td width="5"></td>
<td width="210" height="1" bgcolor="#DDDDDD"></td>
<td width="5"></td>
</tr>
</table>
</td>
</tr>
<?php $n = count($list); for ($i = 0; $i < $n; $i++) { ?>
<tr>
<td colspan=4 align=center>
<table width=95%>
<tr>
<td height=19>
<nobr style='display:block; overflow:hidden; width:210;'>
<span style="font-weight:normal;">
<!-- 코멘트 수 -->
<?php if ($list[$i][commentCnt]) { ?>
<font color="#E60000">(<?php echo $list[$i][commentCnt]; ?>)</font>
<?php } ?>
<!-- // 코멘트 수 -->
<!-- 제목 -->
<a href="<?php echo $list[$i][href]; ?>" title="<?php echo $list[$i][title]; ?>">
<font color="#000000">
<?php echo $list[$i][subject]; ?>
<!-- // 제목 -->
</span>
</a>
</nobr>
</td></tr>
</table></td>
</tr>
<?php } ?>
</table>
</td></tr>
</table>
</td></tr>
</table>
<?php } ?>
댓글 전체

$s 가 정의 되어 있는
select 구문 a.bo_table = b.bo_table 아래 형태로 코드를 추가 시키면 될 듯 합니다~^^
and a.bo_table != '제외시킬 테이블명01'
and a.bo_table != '제외시킬 테이블명02'
and c.gr_id != '제외시킬 그룹명01'
and c.gr_id != '제외시킬 그룹명02'
select 구문 a.bo_table = b.bo_table 아래 형태로 코드를 추가 시키면 될 듯 합니다~^^
and a.bo_table != '제외시킬 테이블명01'
and a.bo_table != '제외시킬 테이블명02'
and c.gr_id != '제외시킬 그룹명01'
and c.gr_id != '제외시킬 그룹명02'

괄호로 묶어 주는게 낫겠네요^^

감사합니다.
소스를 모르는 저로서는 까막눈이나 마찬가지 였는데 넘 감사하네요.
휴 한숨 덜었습니다. 정말 고맙습니다. ^^
소스를 모르는 저로서는 까막눈이나 마찬가지 였는데 넘 감사하네요.
휴 한숨 덜었습니다. 정말 고맙습니다. ^^
아 이런거 였군요,,,,여러개면 반복으로 계속 and 하면 되는 군요
감사합니다....
감사합니다....