PHP with GNU 게시판 새글 갯 수
페이지 정보
작성자 디자인천일
작성일Date: 2025-03-29 00:55
조회view: 11
본문
게시판에서 새글 아이콘이 붙는 글에 해당되는 글의 갯수를 구함
php
$count = notice_recent('게시판테이블');
function notice_recent($bo_table) {
global $g5;
$temp = sql_fetch("select bo_new from {$g5['board_table']} where bo_table = '".$bo_table."'");
$time_set = date("Y-m-d H:i:s", time() - $temp['bo_new'] * 3600);
$row = sql_fetch("select count(distinct `wr_id`) as `cnt` from {$g5['write_prefix']}$bo_table where wr_is_comment = '0' and wr_datetime > '$time_set'");
if($row['cnt']) {
return $row['cnt'];
} else {
return 0;
}
}