코멘트 최신글 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 아이콘을 달 수 있지만 별로 유용한 것 같지는 않더군요
최신 댓글 표시는 등록일 다음날 자정까지 표시하도록 하였습니다
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 아이콘을 달 수 있지만 별로 유용한 것 같지는 않더군요
댓글 3개
19년 전
이거 새로운 코멘트가 있을경우 코멘트 숫자를 굵게 표시할려면 어떤부분을 바꾸면되나요?
위에 이미지 경로부분을 <b> 해도 안되던데,,, 죄송하지만 좀 갈켜주세요
위에 이미지 경로부분을 <b> 해도 안되던데,,, 죄송하지만 좀 갈켜주세요
19년 전
hgj
16년 전
사용해 보아야 겠어요 좋은데요?ㅎㅎㅎㅎ 감사합니다.
게시판 목록
그누4 팁자료실
그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.
나누면 즐거움이 커집니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 369 |
|
19년 전 | 10647 | |
| 368 | 19년 전 | 5865 | ||
| 367 | 19년 전 | 4099 | ||
| 366 | 19년 전 | 5225 | ||
| 365 | 19년 전 | 4706 | ||
| 364 | 19년 전 | 2476 | ||
| 363 | 19년 전 | 4501 | ||
| 362 | 19년 전 | 3793 | ||
| 361 | 19년 전 | 4042 | ||
| 360 | 19년 전 | 7931 | ||
| 359 | 19년 전 | 3126 | ||
| 358 | 19년 전 | 5641 | ||
| 357 | 19년 전 | 6655 | ||
| 356 | 19년 전 | 3257 | ||
| 355 | 19년 전 | 4100 | ||
| 354 | 19년 전 | 4346 | ||
| 353 |
|
19년 전 | 5301 | |
| 352 | 19년 전 | 4092 | ||
| 351 |
sanxiyn
|
19년 전 | 4687 | |
| 350 |
|
19년 전 | 6393 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기