h

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

· 2013-04-08 (월) 17:54:33 · 1712 · 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,086
13-04-09 조회 842
13-04-09 조회 2,239
13-04-09 조회 1,056
13-04-09 조회 2,112
13-04-08 조회 1,050
13-04-08 조회 1,004
13-04-08 조회 822
13-04-08 조회 1,653
13-04-08 조회 853
13-04-08 조회 1,648
13-04-08 조회 1,046
13-04-08 조회 3,013
13-04-08 조회 1,713
13-04-08 조회 810
13-04-08 조회 1,626
13-04-08 조회 1,857
13-04-08 조회 983
13-04-08 조회 817
13-04-08 조회 2,088