새 댓글 올라왔을때 메뉴 옆에 아이콘 띄우기 (참고 코드 有) > 그누4 질문답변

그누4 질문답변

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

새 댓글 올라왔을때 메뉴 옆에 아이콘 띄우기 (참고 코드 有) 정보

새 댓글 올라왔을때 메뉴 옆에 아이콘 띄우기 (참고 코드 有)

본문

http://gnucomun.net/sp/study.14


function new_icon($bo_table) {
  global $g4;
  $temp = sql_fetch("select bo_new from `$g4[board_table]` where bo_table = '$bo_table'");
  $timefrom = date("Y-m-d H:i:s", time() - $temp[bo_new] * 60 * 60);
  if(sql_fetch("select wr_datetime from `$g4[write_prefix]$bo_table` where !wr_is_comment AND wr_datetime > '$timefrom'")) echo " <img src=\"$g4[path]/skin/board/basic/img/icon_new.gif\" />";
}


원하는 위치에 <?new_icon("게시판")?>



위에 코드가 말러님의 "새글 있으면 new 표시" 팁인데요.
새 코멘트가 있을때 아이콘 띄우기로 적용하려면 어떻게 수정해야 하나요?
  • 복사

댓글 전체


  if(sql_fetch("select wr_datetime from `$g4[write_prefix]$bo_table` where !wr_is_comment AND wr_datetime > '$timefrom'")) echo " <img src=\"$g4[path]/skin/board/basic/img/icon_new.gif\" />"; 

여기서 쿼리를

 if(sql_fetch("select wr_datetime from `$g4[write_prefix]$bo_table` where wr_is_comment=1 AND wr_datetime > '$timefrom'")) echo " <img src=\"$g4[path]/skin/board/basic/img/icon_new.gif\" />";

이렇게 하시면 코멘트 검사하겠는데요
© SIRSOFT
현재 페이지 제일 처음으로