h

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

· 2013-04-08 (월) 17:54:33 · 1725 · 2
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
2013-04-08 (월) 19:32:47
[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 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
13-04-09 조회 1,097
13-04-09 조회 851
13-04-09 조회 2,247
13-04-09 조회 1,066
13-04-09 조회 2,122
13-04-08 조회 1,058
13-04-08 조회 1,013
13-04-08 조회 832
13-04-08 조회 1,665
13-04-08 조회 863
13-04-08 조회 1,659
13-04-08 조회 1,058
13-04-08 조회 3,022
13-04-08 조회 1,726
13-04-08 조회 819
13-04-08 조회 1,638
13-04-08 조회 1,866
13-04-08 조회 992
13-04-08 조회 827
13-04-08 조회 2,097