반응형

게시판 리스트페이지에 코드추가.  

 

//아직 안읽은 게시물 체크
            $lastTime = strtotime($list[$i]['wr_last']);
            if ($is_admin) {
                $adminTimeLast = $list[$i]['wr_20'];
                if (!$list[$i]['wr_20']) {
                    $adminTimeLast = '2000-01-01';
                }
                $adminTimeLastReplaced = strtotime($adminTimeLast);
                if ($adminTimeLastReplaced < $lastTime) {
                    $adminNew = true;
                } else {
                    $adminNew = false;
                }

                if ($adminNew == true) {
                    $lastStyle = 'not_read';
                } else {
                    $lastStyle = '';
                }
            }


tr 에 클래스추가   <?php echo $lastStyle?>

 


뷰페이지에 코드추가 

  // 관리자가 읽을 경우 현재 시간으로 업데이트 한다.
if ($is_admin) {
$sql = " UPDATE $write_table SET
wr_20 = now()
 WHERE
wr_id = '{$wr_id}'
";
sql_query($sql);
}
?>

728x90
반응형

+ Recent posts