코멘트 최신글 NEW 표시하기 > 그누4 팁자료실

그누4 팁자료실

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

코멘트 최신글 NEW 표시하기 정보

코멘트 최신글 NEW 표시하기

본문

오래된 게시물에 댓글이 달린 경우 확인하기가 어려워 다음처럼 만들어 씁니다
최신 댓글 표시는 등록일 다음날 자정까지 표시하도록 하였습니다
list.php 윗부분 적당한 곳에 삽입
------------------------------------------------
$cur_day1=date("Y-m-d");
$cur_day=date("Y-m-d H:i:s", strtotime("-1 day",strtotime($cur_day1) ) );
 $result_comment = sql_query(" select wr_parent from $g4[board_new_table] where bo_table ='$bo_table' and wr_id<>wr_parent and bn_datetime >= '$cur_day' ");

  $new_comment=array();
while( $tmp = sql_fetch_array($result_comment) ){
  array_push($new_comment, $tmp[wr_parent]);
}
//////////////////////////////////////////////////////////////////////////////////////////
get_list부분을 찾아서 마지막 인수부분을 아래와 같이 수정(두 군데..)
get_list($row, $board, $board_skin_path, $board[bo_subject_len],$new_comment);

common.lib.php 263행(?) 수정
----------------------------------------------
function get_list($write_row, $board, $skin_path, $subject_len=40, $new_comm=array())

======================================
    $list[comment_cnt] = "";
 if ($list[wr_comment])
    $list[comment_cnt] = "($list[wr_comment])";  부분 다음과 같이 수정(get_list함수 내의...)
======================================
    $list[comment_cnt] = "";
    $list[icon_comment] = "";
    if ($list[wr_comment]) {
      if(in_array($list[wr_id], $new_comm) ) $list[icon_comment]="<img src='$g4[path]/images/icon_comment.gif' align='absmiddle'>";
        $list[comment_cnt] = "($list[wr_comment])";
    }

------------------------------------------------------------------------
list.skin.php 53행(?) 수정

<!-- 목록 -->
<? for ($i=0; $i<count($list); $i++) {
  //뉴코멘트 가 있으면 표시 ##############################
  if($list[$i][icon_comment]) $list[$i][icon_new]=$list[$i][icon_comment];
?>
최신글에 댓글이 달리면 최신글 표시 대신 새로운 댓글 아이콘으로 표시되게 함
=========================================
위에서 images/icon_comment.gif 로 설정했으므로 images 폴더에 새로운 댓글 아이콘을
제작하여 업로드 합니다(화일명 icon_comment.gif)
너무 복잡한가요?
전 필요해서 하는 수 없이....

최신글에도 latest.lib.php 와 latest.skin.php를 위와 같은 방법으로 수정하면
새로운 댓글에 NEW 아이콘을 달 수 있지만 별로 유용한 것 같지는 않더군요
추천
1
  • 복사

댓글 3개

이거 새로운 코멘트가 있을경우 코멘트 숫자를 굵게 표시할려면 어떤부분을 바꾸면되나요?
위에 이미지 경로부분을 <b> 해도 안되던데,,, 죄송하지만 좀 갈켜주세요
© SIRSOFT
현재 페이지 제일 처음으로