새 댓글 올라왔을때 메뉴 옆에 아이콘 띄우기 (참고 코드 有) 정보
새 댓글 올라왔을때 메뉴 옆에 아이콘 띄우기 (참고 코드 有)본문
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 표시" 팁인데요.
새 코멘트가 있을때 아이콘 띄우기로 적용하려면 어떻게 수정해야 하나요?
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 표시" 팁인데요.
새 코멘트가 있을때 아이콘 띄우기로 적용하려면 어떻게 수정해야 하나요?
댓글 전체
마지막행에 있는 where !wr_is_comment AND <-- 수정
where wr_is_comment>'0' AND
where wr_is_comment>'0' AND
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\" />";
이렇게 하시면 코멘트 검사하겠는데요