[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개
게시글 목록
| 번호 | 제목 |
|---|---|
| 34706 | |
| 34693 | |
| 34563 | |
| 34536 | |
| 34521 | |
| 34480 | |
| 34479 | |
| 34466 | |
| 34437 | |
| 34436 | |
| 34435 | |
| 34406 | |
| 34398 | |
| 34387 | |
| 34382 | |
| 34375 | |
| 34364 | |
| 34336 | |
| 34294 | |
| 34293 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기