최근에 코멘트 달리면 new icon 출력 정보
최근에 코멘트 달리면 new icon 출력본문
최신덧글 새로 달리면 뉴 아이콘 표시
비슷한 팁들이 있는데, 덧글에 덧글이 달린 경우를 제대로 반영 못하는 것 같아 새로 만들어봤습니다.
최신글과 게시판을 모두 고쳐보도록 하겠습니다.
각각의 스킨의 img 폴더에 icon_new2.gif를 추가해줘서 구분이 되도록 해보겠습니다.
구분 없이 쓰려면 이하 내용에서 icon_new2.gif 를 icon_new.gif 라고 바꾸면 됩니다.
1. 최신글의 latest.skin.php
2. 게시판의 list.skin.php
비슷한 팁들이 있는데, 덧글에 덧글이 달린 경우를 제대로 반영 못하는 것 같아 새로 만들어봤습니다.
최신글과 게시판을 모두 고쳐보도록 하겠습니다.
각각의 스킨의 img 폴더에 icon_new2.gif를 추가해줘서 구분이 되도록 해보겠습니다.
구분 없이 쓰려면 이하 내용에서 icon_new2.gif 를 icon_new.gif 라고 바꾸면 됩니다.
1. 최신글의 latest.skin.php
echo " " . $list[$i]['icon_new'];
위 내용을 다음과 같이 수정합니다.if($list[$i]['icon_new'])
echo " " . $list[$i]['icon_new'];
else {
$temp = sql_fetch("select wr_datetime from $tmp_write_table where wr_num='{$list[$i][wr_num]}' and wr_is_comment='1' ORDER BY wr_id DESC " );
$co_time = strtotime($temp[wr_datetime]);
if(time() - $co_time < 24*60*60) //24시간 이내일 때
echo " <img src='$latest_skin_path/img/icon_new2.gif' align=absmiddle title='new comment'>";
}
echo " " . $list[$i]['icon_new'];
else {
$temp = sql_fetch("select wr_datetime from $tmp_write_table where wr_num='{$list[$i][wr_num]}' and wr_is_comment='1' ORDER BY wr_id DESC " );
$co_time = strtotime($temp[wr_datetime]);
if(time() - $co_time < 24*60*60) //24시간 이내일 때
echo " <img src='$latest_skin_path/img/icon_new2.gif' align=absmiddle title='new comment'>";
}
2. 게시판의 list.skin.php
echo " " . $list[$i][icon_new];
위 내용을 다음과 같이 수정합니다.if($list[$i][icon_new])
echo " " . $list[$i][icon_new];
else {
$temp = sql_fetch("select wr_datetime from `$write_table` where wr_num='{$list[$i][wr_num]}' and wr_is_comment='1' ORDER BY wr_id DESC " );
$co_time = strtotime($temp[wr_datetime]);
if(time() - $co_time < 24*60*60) //24시간 이내일 때
echo " <img src='$board_skin_path/img/icon_new2.gif' align=absmiddle title='new comment'>";
}
echo " " . $list[$i][icon_new];
else {
$temp = sql_fetch("select wr_datetime from `$write_table` where wr_num='{$list[$i][wr_num]}' and wr_is_comment='1' ORDER BY wr_id DESC " );
$co_time = strtotime($temp[wr_datetime]);
if(time() - $co_time < 24*60*60) //24시간 이내일 때
echo " <img src='$board_skin_path/img/icon_new2.gif' align=absmiddle title='new comment'>";
}
추천
4
4
댓글 4개
오우 괜찮은데요~ 추천합니다~
오류가 조금 있던데요.
게시판에서 comment 가 안달려 있는 글은, 오류가 뜨던데, 이렇게 수정했습니다.
if($list[$i][icon_new])
echo " " . $list[$i][icon_new];
else {
$temp = sql_fetch("select wr_datetime from `$write_table` where wr_num='{$list[$i][wr_num]}' and wr_is_comment='1' ORDER BY wr_id DESC " );
if($temp[wr_datetime]){
$co_time = strtotime($temp[wr_datetime]);
if(time() - $co_time < 24*60*60) //24시간 이내일 때
echo " <img src='$board_skin_path/img/icon_new2.gif' align=absmiddle title='new comment'>";
}
}
게시판에서 comment 가 안달려 있는 글은, 오류가 뜨던데, 이렇게 수정했습니다.
if($list[$i][icon_new])
echo " " . $list[$i][icon_new];
else {
$temp = sql_fetch("select wr_datetime from `$write_table` where wr_num='{$list[$i][wr_num]}' and wr_is_comment='1' ORDER BY wr_id DESC " );
if($temp[wr_datetime]){
$co_time = strtotime($temp[wr_datetime]);
if(time() - $co_time < 24*60*60) //24시간 이내일 때
echo " <img src='$board_skin_path/img/icon_new2.gif' align=absmiddle title='new comment'>";
}
}
쵝오예요!!ㅎㅎㅎ
감사합니다.