h

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

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 표시" 팁인데요.
새 코멘트가 있을때 아이콘 띄우기로 적용하려면 어떻게 수정해야 하나요?
|

댓글 2개

마지막행에 있는 where !wr_is_comment AND <-- 수정
where wr_is_comment>'0' AND
[code]
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\" />";
[/code]
여기서 쿼리를
[code]
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\" />";
[/code]
이렇게 하시면 코멘트 검사하겠는데요
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
12년 전 조회 2,040
12년 전 조회 974
12년 전 조회 924
12년 전 조회 748
12년 전 조회 1,586
12년 전 조회 769
12년 전 조회 1,577
12년 전 조회 983
12년 전 조회 2,939
12년 전 조회 1,643
12년 전 조회 746
12년 전 조회 1,558
12년 전 조회 1,786
12년 전 조회 897
12년 전 조회 740
12년 전 조회 2,016
12년 전 조회 1,573
12년 전 조회 1,555
12년 전 조회 815
12년 전 조회 1,030