게시판에 새로운글이 올라오면 메뉴옆에 new이미지를 넣고 싶은데요 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

게시판에 새로운글이 올라오면 메뉴옆에 new이미지를 넣고 싶은데요 정보

게시판에 새로운글이 올라오면 메뉴옆에 new이미지를 넣고 싶은데요

본문

<?php
//24시간 이내의 글 수 알아내기
function new_count($table_id){
// 오늘을 불러옵니다.
$intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * 24));

// 여기는 오늘과 글쓴 날짜를 비교합니다.
$tmp_write_table .= "g4_write_$table_id";
$sql2 = " select wr_datetime from $tmp_write_table where wr_datetime >= '$intime'";

// 새로운 글이 몇개 있는지 확인합니다.
$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;
}
}
?>
----------------------------------------

이렇게 함수를 집어넣고 원하시는 장소에...

예를 들어 왼쪽에 '자유게시판'이라는 메뉴가 있고 그 옆에 글 갯수를 출력하기 위해

<?=new_count(테이블명);?>
 
 
이소스를 팁게시판에서 봣는데
되긴되는데
여기서 new이미지가 옆에 뜨게 하려면 어디를 어떻게 수정해야하는지요?
위에꺼데로 하면 몇개에 새글이 올라왓는지 숫자로 나오더라구요 ㅎㅎ;
  • 복사

댓글 전체

// 새로운 글이 몇개 있는지 확인합니다.
$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;
}
}
?>
<?php
//24시간 이내의 글 수 알아내기
function new_count($table_id){
// 오늘을 불러옵니다.
$intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * 24));

// 여기는 오늘과 글쓴 날짜를 비교합니다.
$tmp_write_table .= "g4_write_$table_id";
$sql2 = " select wr_datetime from $tmp_write_table where wr_datetime >= '$intime'";

// 새로운 글이 몇개 있는지 확인합니다.
$result2 = sql_query($sql2);
$total_count = mysql_num_rows($result2);

if ($total_count > 0) {
$str_cnt .= " [".$total_count."]<img src=images/new.gif width=15 height=6 border=0>";
return $str_cnt;
}
else {
$str_cnt .= "";
return $str_cnt;
}
}
?>

이런식으로 넣었는데 안뜹니당 -0-;
© SIRSOFT
현재 페이지 제일 처음으로