새 글이 있으면 new icon 표시하기
저는 아래와 같은 함수를 /extend/function.extend.php 파일에 넣어두고 있습니다.
사용하는 방법은 원하는 위치에 <?new_icon("게시판bo_table값")?> 이런식으로 써주시면 됩니다.
초보자 분들은 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\" />";
}
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("게시판bo_table값")?> 이런식으로 써주시면 됩니다.
초보자 분들은 http://gnucomun.net/sp/study.14 이 링크를 참고하시면 도움이 될 듯 합니다.
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 8개