코멘트시간별로 코멘트카운트 색상을 변경하고싶습니다. > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

코멘트시간별로 코멘트카운트 색상을 변경하고싶습니다. 정보

코멘트시간별로 코멘트카운트 색상을 변경하고싶습니다.

본문

 if ($list[$i][comment_cnt])
            {
              $co_wr_parent = $list[$i][wr_id];
              $co_wr_comment =substr($list[$i][comment_cnt],1,1);
              $intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * 24));
              $sqlcomm = "SELECT count(*) AS cnt FROM $write_table WHERE wr_is_comment = '1' and wr_parent = '$co_wr_parent' and wr_datetime >='$intime'";
          $row = sql_fetch($sqlcomm);
                  if ($row[cnt])
            echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'><font color='#F36B2D'><b>{$list[$i][comment_cnt]}</b></font></span></a>";
        else
            echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";
        }
 
이렇게 위와 같은 소스를 적용하면 24시간이내에 새 코멘트가 달리면
코멘트 카운트 색상이 주황색으로 변경되는데요..
 
24시간이내의 새 코멘트에는 주황색이 12시간이내의 새 코멘트는 빨간색으로 표시되게 하고싶은데
어떻게 하면 되나요??
 
 
설명이 좀 난해해도 양해부탁드려요 --;

댓글 전체

24시간에 조회된것이 있을경우 12시간에 조회되는것이 있는지 다시한번 조회하도록 수정

if ($list[$i][comment_cnt])
{
    $co_wr_parent = $list[$i][wr_id];
    $co_wr_comment =substr($list[$i][comment_cnt],1,1);
    $intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * 24));
    $sqlcomm = "SELECT count(*) AS cnt FROM $write_table WHERE wr_is_comment = '1' and wr_parent = '$co_wr_parent' and wr_datetime >='$intime'";
    $row = sql_fetch($sqlcomm);
    if ($row[cnt]) {
        $intime12 = date("Y-m-d H:i:s", time() - (int)(60 * 60 * 12));
        $sqlcomm = "SELECT count(*) AS cnt FROM $write_table WHERE wr_is_comment = '1' and wr_parent = '$co_wr_parent' and wr_datetime >='$intime12'";
        $row1 = sql_fetch($sqlcomm);
        if ($row1[cnt]) {
            echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'><font color=red><b>{$list[$i][comment_cnt]}</b></font></span></a>";
        } else {
            echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'><font color='#F36B2D'><b>{$list[$i][comment_cnt]}</b></font></span></a>";
        }
    } else {
        echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";
    }
}
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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