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

 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시간이내의 새 코멘트는 빨간색으로 표시되게 하고싶은데
어떻게 하면 되나요??
 
 
설명이 좀 난해해도 양해부탁드려요 --;
|

댓글 3개

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>";
}
}
답변정말 감사합니다.
덕분에 한건 해결했습니다.

언제나 좋은하루 되세요 ^^)/
코멘트 카운트 색상
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
19년 전 조회 1,422
19년 전 조회 1,791
19년 전 조회 1,140
19년 전 조회 1,803
19년 전 조회 1,500
19년 전 조회 995
19년 전 조회 1,710
19년 전 조회 1,506
19년 전 조회 1,537
19년 전 조회 1,436
19년 전 조회 1,191
19년 전 조회 952
19년 전 조회 1,137
19년 전 조회 2,080
19년 전 조회 1,313
19년 전 조회 1,573
19년 전 조회 1,742
19년 전 조회 1,074
19년 전 조회 1,274
19년 전 조회 1,259
🐛 버그신고