[10년전 재탕 팁]메뉴 NEW 아이콘 또는 새글수 출력 (분류도 지원)
[code]
<?php
//24시간 이내의 글 수 알아내기
function new_count($table_id,$ca_name,$cmt){
// 오늘을 불러옵니다.
$intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * 24));
// 여기는 오늘과 글쓴 날짜를 비교합니다.
$tmp_write_table .= "g4_write_$table_id";
if($cmt){
$sql2 = " select wr_datetime from $tmp_write_table where wr_datetime >= '$intime' and wr_is_comment = '$cmt' and ca_name = '$ca_name' ";
}else{
$sql2 = " select wr_datetime from $tmp_write_table where wr_datetime >= '$intime' and ca_name = '$ca_name' ";
}
// 새로운 글이 몇개 있는지 확인합니다.
$result2 = sql_query($sql2);
$total_count = mysql_num_rows($result2);
if ($total_count > 0) {
$str_cnt .= " [".$total_count."]"; //새글수
$str_cnt .= " <img src='$g4[path]/img/new_layout/icon_new.gif'>"; //이미지
return $str_cnt;
}
else {
$str_cnt .= "";
return $str_cnt;
}
}
?>
[/code]
출력방법
[code]
//new_count("게시판명","분류명","0 게시물만 | 1 댓글만 | 빈 공간 둘다 ");
<?=new_count("게시판명","","0");?>
[/code]
원본 http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=1279&sca=&sfl=wr_subject%7C%7Cwr_content&stx=%EB%A9%94%EB%89%B4+%EC%83%88%EA%B8%80 게시물의 댓글
<?php
//24시간 이내의 글 수 알아내기
function new_count($table_id,$ca_name,$cmt){
// 오늘을 불러옵니다.
$intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * 24));
// 여기는 오늘과 글쓴 날짜를 비교합니다.
$tmp_write_table .= "g4_write_$table_id";
if($cmt){
$sql2 = " select wr_datetime from $tmp_write_table where wr_datetime >= '$intime' and wr_is_comment = '$cmt' and ca_name = '$ca_name' ";
}else{
$sql2 = " select wr_datetime from $tmp_write_table where wr_datetime >= '$intime' and ca_name = '$ca_name' ";
}
// 새로운 글이 몇개 있는지 확인합니다.
$result2 = sql_query($sql2);
$total_count = mysql_num_rows($result2);
if ($total_count > 0) {
$str_cnt .= " [".$total_count."]"; //새글수
$str_cnt .= " <img src='$g4[path]/img/new_layout/icon_new.gif'>"; //이미지
return $str_cnt;
}
else {
$str_cnt .= "";
return $str_cnt;
}
}
?>
[/code]
출력방법
[code]
//new_count("게시판명","분류명","0 게시물만 | 1 댓글만 | 빈 공간 둘다 ");
<?=new_count("게시판명","","0");?>
[/code]
원본 http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=1279&sca=&sfl=wr_subject%7C%7Cwr_content&stx=%EB%A9%94%EB%89%B4+%EC%83%88%EA%B8%80 게시물의 댓글
댓글 3개
민권민민군
10년 전
참고할께요
익명닉네임
10년 전
넵 ^^
10년 전
감사합니다
게시판 목록
그누4 팁자료실
그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.
나누면 즐거움이 커집니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 3289 | 9년 전 | 4821 | ||
| 3288 | 9년 전 | 5803 | ||
| 3287 |
|
9년 전 | 3508 | |
| 3286 |
또치하우스
|
9년 전 | 12304 | |
| 3285 | 9년 전 | 11506 | ||
| 3284 |
다람쥐7마리
|
10년 전 | 4685 | |
| 3283 |
블랙초콜렛더블샷
|
10년 전 | 5976 | |
| 3282 |
또치하우스
|
10년 전 | 10276 | |
| 3281 | 10년 전 | 9790 | ||
| 3280 | 10년 전 | 4995 | ||
| 3279 | 10년 전 | 4276 | ||
| 3278 | 10년 전 | 5359 | ||
| 3277 |
|
10년 전 | 5268 | |
| 3276 | 10년 전 | 5781 | ||
| 3275 | 10년 전 | 4352 | ||
| 3274 | 10년 전 | 5595 | ||
| 3273 | 10년 전 | 6910 | ||
| 3272 | 10년 전 | 7223 | ||
| 3271 | 10년 전 | 4939 | ||
| 3270 |
|
10년 전 | 5407 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기