카테고리 오늘 올라온 글 갯수 가져오기
[code]
//카테고리 오늘 새글
function board_cat_number($table_id, $cat_id){
// 자정을 기준으로 새글
$intime = date("Y-m-d 00:00:00");
// 자정 기준으로 새글을 검색합니다.
$tmp_write_table .= "g4_write_$table_id";
$sql2 = " select wr_datetime from $tmp_write_table where wr_datetime >= '$intime' and ca_name = '$cat_id'";
// 새로운 글이 몇개 있는지 확인합니다.
$result2 = sql_query($sql2);
$total_count = mysql_num_rows($result2);
if ($total_count > 0) {
$str_cnt .= "".$total_count."";
return $str_cnt;
}
else {
$str_cnt .= "";
return $str_cnt;
}
}
[/code]
팁자료실에서 게시판 새글로 올라온것에 and ca_name = '$cat_id'만 추가했습니다.
<?=board_cat_number(bo_table, ca_name);?> 으로 불러오면 됩니다.
//카테고리 오늘 새글
function board_cat_number($table_id, $cat_id){
// 자정을 기준으로 새글
$intime = date("Y-m-d 00:00:00");
// 자정 기준으로 새글을 검색합니다.
$tmp_write_table .= "g4_write_$table_id";
$sql2 = " select wr_datetime from $tmp_write_table where wr_datetime >= '$intime' and ca_name = '$cat_id'";
// 새로운 글이 몇개 있는지 확인합니다.
$result2 = sql_query($sql2);
$total_count = mysql_num_rows($result2);
if ($total_count > 0) {
$str_cnt .= "".$total_count."";
return $str_cnt;
}
else {
$str_cnt .= "";
return $str_cnt;
}
}
[/code]
팁자료실에서 게시판 새글로 올라온것에 and ca_name = '$cat_id'만 추가했습니다.
<?=board_cat_number(bo_table, ca_name);?> 으로 불러오면 됩니다.
게시판 목록
그누4 팁자료실
그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.
나누면 즐거움이 커집니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 3309 | 3년 전 | 1798 | ||
| 3308 | 11년 전 | 2087 | ||
| 3307 |
uPAmJ903
|
6년 전 | 4742 | |
| 3306 |
바른사나이
|
6년 전 | 3269 | |
| 3305 | 6년 전 | 12297 | ||
| 3304 | 7년 전 | 3699 | ||
| 3303 | 7년 전 | 3736 | ||
| 3302 |
지리산초보
|
7년 전 | 13588 | |
| 3301 |
sozet
|
8년 전 | 4897 | |
| 3300 |
sozet
|
8년 전 | 5962 | |
| 3299 |
sozet
|
8년 전 | 10855 | |
| 3298 | 8년 전 | 4008 | ||
| 3297 |
또치하우스
|
8년 전 | 4433 | |
| 3296 | 8년 전 | 11961 | ||
| 3295 |
또치하우스
|
8년 전 | 14978 | |
| 3294 | 8년 전 | 6016 | ||
| 3293 | 8년 전 | 5583 | ||
| 3292 |
|
9년 전 | 5309 | |
| 3291 | 9년 전 | 13673 | ||
| 3290 | 9년 전 | 5042 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기