답변 1개
채택된 답변
+20 포인트
11년 전
Copy
// 오늘 전체 새글function today_new(){ global $g5; // 자정을 기준으로 새글 $intime = date("Y-m-d 00:00:00"); // 자정 기준으로 새글을 검색합니다. $tmp_write_table .= $g5['board_new_table']; $sql2 = " select bn_datetime from $tmp_write_table where bn_datetime >= '$intime' and wr_id = wr_parent"; // 새로운 글이 몇개 있는지 확인합니다. $result2 = sql_query($sql2); $total_count = mysql_num_rows($result2); if ($total_count > 0) { $str_cnt .= $total_count; return $str_cnt; } else { $str_cnt .= "0"; return $str_cnt; } }
common.lib.php 파일 하단 등에 위 함수를 추가해주세요.
원하는 위치에서 <?php echo today_new();?>로 불러오시면 오늘 올라온 새 글 갯수를 출력할 수 있습니다.
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
11년 전
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
복 받으실꺼에요~