최근에 코멘트 달리면 new icon 출력 > 그누4 팁자료실

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.

최근에 코멘트 달리면 new icon 출력 정보

최근에 코멘트 달리면 new icon 출력

본문

최신덧글 새로 달리면 뉴 아이콘 표시
비슷한 팁들이 있는데, 덧글에 덧글이 달린 경우를 제대로 반영 못하는 것 같아 새로 만들어봤습니다.
최신글과 게시판을 모두 고쳐보도록 하겠습니다.
각각의 스킨의 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'>";
}

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'>";
}
추천
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'>";
    }
}
전체 29 |RSS
그누4 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT