|
|
|
22년 전
|
조회 1,110
|
|
|
|
22년 전
|
조회 1,265
|
|
|
관리자
|
22년 전
|
조회 1,198
|
|
|
|
22년 전
|
조회 1,243
|
|
|
|
22년 전
|
조회 1,137
|
|
|
|
22년 전
|
조회 1,191
|
|
|
|
22년 전
|
조회 1,201
|
|
|
|
22년 전
|
조회 1,224
|
|
|
|
22년 전
|
조회 1,105
|
|
|
|
22년 전
|
조회 1,216
|
|
|
|
22년 전
|
조회 1,138
|
|
|
|
22년 전
|
조회 3,013
|
|
|
|
22년 전
|
조회 1,180
|
|
|
|
22년 전
|
조회 1,464
|
|
|
관리자
|
22년 전
|
조회 3,244
|
|
|
|
22년 전
|
조회 1,144
|
|
|
|
22년 전
|
조회 1,199
|
|
|
|
22년 전
|
조회 1,002
|
|
|
|
22년 전
|
조회 1,129
|
|
|
|
22년 전
|
조회 1,288
|
댓글 5개
<?
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>
?>
최근글을 여러개 뽑으시려면 게시판 테이블명만 바꿔서 하시면 됩니다.
그룹은 상관없지 않나요?