'새글만 보기'시 전체그룹 내의 새글을 보이게 하는방법은요??
게시판을 여러개 생성해야되서요.. 그룹을 여러개 주고 그룹별 게시판을 생성하였는데
배포프로그램의 최신글보기는 한가지 그룹의 최신글 리스트만 보이던데...
제가 잘못만진건가요? 아님...
방법좀 알려주세요..
배포프로그램의 최신글보기는 한가지 그룹의 최신글 리스트만 보이던데...
제가 잘못만진건가요? 아님...
방법좀 알려주세요..
댓글 5개
22년 전
리스트가 뿌려지긴 하는데.. 에러가 나는걸요? 개체가 없다는....
22년 전
newlisting.php 파일명을 이렇게 저장했습니다. index.php 있는 곳에 root가 되겠죠
22년 전
관리자님이 사용 배포하신 소슨데 될 겁니다.
<?
require_once "./_lib.php";
if ($hours < 1 || $hours > 72) $hours = 24;
$intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * $hours));
$sql = " select a.bo_subject, a.bo_table, b.gr_subject
from $cfg[table_board] a, $cfg[table_group] b
where a.gr_id = b.gr_id
order by b.gr_id, a.bo_table ";
$result = sql_query_error($sql);
while ($row = mysql_fetch_array($result)) {
$tbl = "{$cfg[write_table_prefix]}{$row[bo_table]}";
$sql2 = " select a.wr_id,
a.wr_parent_id,
a.mb_id,
a.wr_name,
a.wr_email,
a.wr_num,
a.wr_subject,
a.wr_comment,
a.wr_commentcnt,
a.wr_datetime,
b.mb_icon
from $tbl a left join $cfg[table_member] b on (a.mb_id = b.mb_id)
where a.wr_datetime >= '$intime'
order by a.wr_id desc ";
$result2 = sql_query_error($sql2);
for ($i = 0; $row2 = mysql_fetch_array($result2); $i++) {
if ($row2[wr_comment] > 0) {
$sql3 = " select wr_subject
from $tbl
where wr_comment = 0
and wr_parent_id = '$row2[wr_parent_id]' ";
$row3 = sql_fetch_array($sql3);
$wr_subject = $row3[wr_subject];
} else {
$wr_subject = $row2[wr_subject];
}
$wr_subject = get_text($wr_subject);
$key = $row2[wr_datetime] . $row[bo_table] . $row2[wr_id];
$list[$key]->bo_table = $row[bo_table];
$list[$key]->mb_id = $row2[mb_id];
$list[$key]->mb_icon = $row2[mb_icon];
$list[$key]->wr_id = $row2[wr_parent_id];
$list[$key]->wr_email = $row2[wr_email];
$list[$key]->wr_name = get_text(cut_str($row2[wr_name],12));
$list[$key]->wr_subject = get_text(cut_str($wr_subject,70,'…'));
$list[$key]->wr_comment = $row2[wr_comment];
$list[$key]->wr_commentcnt = $row2[wr_commentcnt];
$list[$key]->wr_datetime = $row2[wr_datetime];
}
mysql_free_result($result2);
}
mysql_free_result($result);
?>
<table width=100%>
<tr>
<td height=25 bgcolor=94AA21 colspan=3 align=center> <b><font color=ffffff><?=$hours?> 시간 이내에 올라온 새글</font></b></td>
</tr>
<?
if (count($list) > 0) {
krsort($list);
foreach ($list as $key=>$value) {
$comment = $comment_tail = "";
if ($value->wr_comment > 0) {
$comment = "[코멘트] ";
$comment_tail = "#gnuboard_tail";
}
$commentcnt = "";
if ($value->wr_commentcnt > 0)
$commentcnt = "<font size=-2>({$value->wr_commentcnt})</font>";
$wr_name = gblayer($value->mb_id, $value->wr_name, $value->wr_email);
$mb_icon = "";
$admin_icon = "";
if ($value->mb_icon) {
$mb_icon = "<img src='data/member/{$value->mb_icon}' border=0 align=absmiddle> ";
if ($value->mb_id == "") {
$admin_icon = "" . $mb_icon;
$mb_icon = "";
}
}
echo "<tr>";
echo "<td width=150 align=center>[".$value->wr_datetime."]</td>";
echo "<td> <a href='$absdir/board/gnuboard.php?bo_table=".$value->bo_table."&wr_id=".$value->wr_id."$comment_tail'>";
echo "$comment<b>{$value->wr_subject} {$commentcnt}</b></a></td>";
echo "<td width=100 align=center><img src='data/member/{$value->mb_icon}' border=0 align=absmiddle>$wr_name$admin_icon</td>";
echo "</tr>";
echo "<tr><td colspan=4 background='$이미지경로/line_width.gif'></td></tr>";
}
} else
echo "<td height=25 align=center>등록된 글이 없습니다.</td>";
?>
</table>
<p>
<a href='./newlisting.php?hours=1'>1시간</a> |
<a href='./newlisting.php?hours=2'>2시간</a> |
<a href='./newlisting.php?hours=3'>3시간</a> |
<a href='./newlisting.php?hours=6'>6시간</a> |
<a href='./newlisting.php?hours=12'>12시간</a> |
<a href='./newlisting.php?hours=24'>24시간</a> |
<a href='./newlisting.php?hours=48'>48시간</a> |
<a href='./newlisting.php?hours=72'>72시간</a>
<p>
?>
<?
require_once "./_lib.php";
if ($hours < 1 || $hours > 72) $hours = 24;
$intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * $hours));
$sql = " select a.bo_subject, a.bo_table, b.gr_subject
from $cfg[table_board] a, $cfg[table_group] b
where a.gr_id = b.gr_id
order by b.gr_id, a.bo_table ";
$result = sql_query_error($sql);
while ($row = mysql_fetch_array($result)) {
$tbl = "{$cfg[write_table_prefix]}{$row[bo_table]}";
$sql2 = " select a.wr_id,
a.wr_parent_id,
a.mb_id,
a.wr_name,
a.wr_email,
a.wr_num,
a.wr_subject,
a.wr_comment,
a.wr_commentcnt,
a.wr_datetime,
b.mb_icon
from $tbl a left join $cfg[table_member] b on (a.mb_id = b.mb_id)
where a.wr_datetime >= '$intime'
order by a.wr_id desc ";
$result2 = sql_query_error($sql2);
for ($i = 0; $row2 = mysql_fetch_array($result2); $i++) {
if ($row2[wr_comment] > 0) {
$sql3 = " select wr_subject
from $tbl
where wr_comment = 0
and wr_parent_id = '$row2[wr_parent_id]' ";
$row3 = sql_fetch_array($sql3);
$wr_subject = $row3[wr_subject];
} else {
$wr_subject = $row2[wr_subject];
}
$wr_subject = get_text($wr_subject);
$key = $row2[wr_datetime] . $row[bo_table] . $row2[wr_id];
$list[$key]->bo_table = $row[bo_table];
$list[$key]->mb_id = $row2[mb_id];
$list[$key]->mb_icon = $row2[mb_icon];
$list[$key]->wr_id = $row2[wr_parent_id];
$list[$key]->wr_email = $row2[wr_email];
$list[$key]->wr_name = get_text(cut_str($row2[wr_name],12));
$list[$key]->wr_subject = get_text(cut_str($wr_subject,70,'…'));
$list[$key]->wr_comment = $row2[wr_comment];
$list[$key]->wr_commentcnt = $row2[wr_commentcnt];
$list[$key]->wr_datetime = $row2[wr_datetime];
}
mysql_free_result($result2);
}
mysql_free_result($result);
?>
<table width=100%>
<tr>
<td height=25 bgcolor=94AA21 colspan=3 align=center> <b><font color=ffffff><?=$hours?> 시간 이내에 올라온 새글</font></b></td>
</tr>
<?
if (count($list) > 0) {
krsort($list);
foreach ($list as $key=>$value) {
$comment = $comment_tail = "";
if ($value->wr_comment > 0) {
$comment = "[코멘트] ";
$comment_tail = "#gnuboard_tail";
}
$commentcnt = "";
if ($value->wr_commentcnt > 0)
$commentcnt = "<font size=-2>({$value->wr_commentcnt})</font>";
$wr_name = gblayer($value->mb_id, $value->wr_name, $value->wr_email);
$mb_icon = "";
$admin_icon = "";
if ($value->mb_icon) {
$mb_icon = "<img src='data/member/{$value->mb_icon}' border=0 align=absmiddle> ";
if ($value->mb_id == "") {
$admin_icon = "" . $mb_icon;
$mb_icon = "";
}
}
echo "<tr>";
echo "<td width=150 align=center>[".$value->wr_datetime."]</td>";
echo "<td> <a href='$absdir/board/gnuboard.php?bo_table=".$value->bo_table."&wr_id=".$value->wr_id."$comment_tail'>";
echo "$comment<b>{$value->wr_subject} {$commentcnt}</b></a></td>";
echo "<td width=100 align=center><img src='data/member/{$value->mb_icon}' border=0 align=absmiddle>$wr_name$admin_icon</td>";
echo "</tr>";
echo "<tr><td colspan=4 background='$이미지경로/line_width.gif'></td></tr>";
}
} else
echo "<td height=25 align=center>등록된 글이 없습니다.</td>";
?>
</table>
<p>
<a href='./newlisting.php?hours=1'>1시간</a> |
<a href='./newlisting.php?hours=2'>2시간</a> |
<a href='./newlisting.php?hours=3'>3시간</a> |
<a href='./newlisting.php?hours=6'>6시간</a> |
<a href='./newlisting.php?hours=12'>12시간</a> |
<a href='./newlisting.php?hours=24'>24시간</a> |
<a href='./newlisting.php?hours=48'>48시간</a> |
<a href='./newlisting.php?hours=72'>72시간</a>
<p>
?>
22년 전
죄송한데여... 게시판별 최신글뽑기 말구요 전체적으로 최신글 뽑는거 말이었습니다.
ihsahN
22년 전
예제페이지에선 예를 쉽고 간단하게 보이기위해(?) 달랑 한개만 해놓으신걸꺼에요.
최근글을 여러개 뽑으시려면 게시판 테이블명만 바꿔서 하시면 됩니다.
그룹은 상관없지 않나요?
최근글을 여러개 뽑으시려면 게시판 테이블명만 바꿔서 하시면 됩니다.
그룹은 상관없지 않나요?
게시판 목록
그누3질답
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 15년 전 | 7795 | ||
| 523 |
ihsahN
|
22년 전 | 1178 | |
| 522 |
ihsahN
|
22년 전 | 1058 | |
| 521 | 22년 전 | 1182 | ||
| 520 | 22년 전 | 1069 | ||
| 519 |
김현철
|
22년 전 | 2981 | |
| 518 | 22년 전 | 1138 | ||
| 517 | 22년 전 | 1434 | ||
| 516 | 22년 전 | 3183 | ||
| 515 | 22년 전 | 1093 | ||
| 514 | 22년 전 | 1144 | ||
| 513 |
아틸라
|
22년 전 | 978 | |
| 512 | 22년 전 | 1106 | ||
| 511 |
박인호
|
22년 전 | 1258 | |
| 510 | 22년 전 | 1207 | ||
| 509 | 22년 전 | 1043 | ||
| 508 |
ihsahN
|
22년 전 | 1113 | |
| 507 |
skynoah
|
22년 전 | 1172 | |
| 506 | 22년 전 | 1203 | ||
| 505 | 22년 전 | 1189 | ||
| 504 | 22년 전 | 1387 |
비밀번호 분실시...드림위즈로 멜을 보내면 안가네요..?
김현철
•
22년 전
가입 인사와 함께 질문이 있습니다.
아틸라
•
22년 전
그누구보드 진짜 좋내요... 하지만... [1]
박인호
•
22년 전
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기