새로운 코멘트 등록시 (몇개)표시를 색상 다르게하기
주제: 오늘 새로운 코멘트( 댓글 ) 등록시 리스트의 제목에서 (몇개)를 색상 다르게 하기
검색어: 오늘 , 새로운 , 코멘트 , 댓글 , 몇개 , 색상 , 다르게 , 표시 , 리스트
SIR 서버의 문제로 이전에 등록한 게시물이 사라져 버려서 재정리하여 다시등록 합니다.
아래의 균이님이 올려주신 새로운 댓글이 달리면 NEW 아이콘 표시하기를
제목옆의 코멘트 갯수(몇개) 를 색상이 다르게 출력이 되도록 수정한 것입니다.
예제보기: http://avaschool.net/web/sub_data/board.php?bo_table=sub_community_001
게시물에 새로운 댓글이 달리면 리스트의 제목옆에 (몇개) 표시를 색상 다르게 하기 설명시작
---------------------------------------------------------------------------------------------
1,
bbs/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 부분을 찾아서 아래와 같이 $new_comment 를 추가합니다.
(수정은 두군데(2줄) 입니다.)
원본:
$list[$i] = get_list($row, $board, $board_skin_path, $board[bo_subject_len]);
수정후:
$list[$i] = get_list($row, $board, $board_skin_path, $board[bo_subject_len],$new_comment);
------------------------------------------------------------------------------------------------
2,
bbs/common.lib.php 의 그누보드 관련함수 모음이 시작되는 부분을 수정 합니다.
원본:
// 게시물 정보($write_row)를 출력하기 위하여 $list로 가공된 정보를 복사 및 가공
function get_list($write_row, $board, $skin_path, $subject_len=40)
수정후:
// 게시물 정보($write_row)를 출력하기 위하여 $list로 가공된 정보를 복사 및 가공
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])";
수정후:
$list[comment_cnt] = "";
$list[icon_comment] = "";
if ($list[wr_comment]) {
if(in_array($list[wr_id], $new_comm) ) $list[icon_comment]="color:#ff0000;";
$list[comment_cnt] = "($list[wr_comment])";
}
--------------------------------------------------------------------------------------------------------
3,
게시판스킨의 list.skin.php 를 수정합니다.
원본:
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";
수정후:
if($list[$i][icon_comment]) $list[$i][icon2_comment] =$list[$i][icon_comment];
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;{$list[$i][icon2_comment]}'>{$list[$i][comment_cnt]}</span></a>";
이렇게 하면 오래된 게시물 등에서 새로운 코멘트가 달리면 빨간색으로 표시해 줍니다.
예제보기: http://avaschool.net/web/sub_data/board.php?bo_table=sub_community_001
게시물에 새로운 댓글이 달리면 리스트의 제목옆에 (몇개) 표시를 색상 다르게 하기 설명끝
검색어: 오늘 , 새로운 , 코멘트 , 댓글 , 몇개 , 색상 , 다르게 , 표시 , 리스트
검색어: 오늘 , 새로운 , 코멘트 , 댓글 , 몇개 , 색상 , 다르게 , 표시 , 리스트
SIR 서버의 문제로 이전에 등록한 게시물이 사라져 버려서 재정리하여 다시등록 합니다.
아래의 균이님이 올려주신 새로운 댓글이 달리면 NEW 아이콘 표시하기를
제목옆의 코멘트 갯수(몇개) 를 색상이 다르게 출력이 되도록 수정한 것입니다.
예제보기: http://avaschool.net/web/sub_data/board.php?bo_table=sub_community_001
게시물에 새로운 댓글이 달리면 리스트의 제목옆에 (몇개) 표시를 색상 다르게 하기 설명시작
---------------------------------------------------------------------------------------------
1,
bbs/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 부분을 찾아서 아래와 같이 $new_comment 를 추가합니다.
(수정은 두군데(2줄) 입니다.)
원본:
$list[$i] = get_list($row, $board, $board_skin_path, $board[bo_subject_len]);
수정후:
$list[$i] = get_list($row, $board, $board_skin_path, $board[bo_subject_len],$new_comment);
------------------------------------------------------------------------------------------------
2,
bbs/common.lib.php 의 그누보드 관련함수 모음이 시작되는 부분을 수정 합니다.
원본:
// 게시물 정보($write_row)를 출력하기 위하여 $list로 가공된 정보를 복사 및 가공
function get_list($write_row, $board, $skin_path, $subject_len=40)
수정후:
// 게시물 정보($write_row)를 출력하기 위하여 $list로 가공된 정보를 복사 및 가공
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])";
수정후:
$list[comment_cnt] = "";
$list[icon_comment] = "";
if ($list[wr_comment]) {
if(in_array($list[wr_id], $new_comm) ) $list[icon_comment]="color:#ff0000;";
$list[comment_cnt] = "($list[wr_comment])";
}
--------------------------------------------------------------------------------------------------------
3,
게시판스킨의 list.skin.php 를 수정합니다.
원본:
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";
수정후:
if($list[$i][icon_comment]) $list[$i][icon2_comment] =$list[$i][icon_comment];
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;{$list[$i][icon2_comment]}'>{$list[$i][comment_cnt]}</span></a>";
이렇게 하면 오래된 게시물 등에서 새로운 코멘트가 달리면 빨간색으로 표시해 줍니다.
예제보기: http://avaschool.net/web/sub_data/board.php?bo_table=sub_community_001
게시물에 새로운 댓글이 달리면 리스트의 제목옆에 (몇개) 표시를 색상 다르게 하기 설명끝
검색어: 오늘 , 새로운 , 코멘트 , 댓글 , 몇개 , 색상 , 다르게 , 표시 , 리스트
댓글 3개
19년 전
헐랭이님 고생이 많습니다.
두번 올리셨네요.
감사합니다.
두번 올리셨네요.
감사합니다.
19년 전
좋은 글 감사합니다. 새 코멘트가 달릴 경우, 원래 쓰시던 뉴아이콘이 뜨게 하려고 하신다면 아래를 참조하세요.
위 헐랭이님 내용에서 약간의 수정이 있을 뿐입니다.
위 헐랭이님의 분문에서 1번까지만 하시고, 아래 2번까지만 하시면 됩니다.
===================================================
2,
bbs/common.lib.php 의 그누보드 관련함수 모음이 시작되는 부분을 수정 합니다.
원본:
// 게시물 정보($write_row)를 출력하기 위하여 $list로 가공된 정보를 복사 및 가공
function get_list($write_row, $board, $skin_path, $subject_len=40)
수정후:
// 게시물 정보($write_row)를 출력하기 위하여 $list로 가공된 정보를 복사 및 가공
function get_list($write_row, $board, $skin_path, $subject_len=40, $new_comm=array())
위의 라인을 수정후
아래로 조금내리면 아래의 소스를 수정합니다.
// 원본 :
$list[icon_new] = "";
if ($list[wr_datetime] >= date("Y-m-d H:i:s", $g4[server_time] - ($board[bo_new] * 3600)))
// 수정후:
$list[icon_new] = "";
if ($list[wr_datetime] >= date("Y-m-d H:i:s", $g4[server_time] - ($board[bo_new] * 3600)) || in_array($list[wr_id], $new_comm))
===================================================끝
그러면 새글이 달릴때 뜨던 뉴아이콘이... 새 코멘트가 달릴때도 뜨게 됩니다.
새글인지 새코멘트인지 꼭 구분을 해야 하는 경우가 아니라면 이렇게 써도 무방한 분들이 있을지 모르겠습니다.
조건을 조금 더 세분화 하면 뉴아이콘을 새글일때와 새코멘트일때로 구분해서 함께 표시할 수 있겠네요.
위 헐랭이님 내용에서 약간의 수정이 있을 뿐입니다.
위 헐랭이님의 분문에서 1번까지만 하시고, 아래 2번까지만 하시면 됩니다.
===================================================
2,
bbs/common.lib.php 의 그누보드 관련함수 모음이 시작되는 부분을 수정 합니다.
원본:
// 게시물 정보($write_row)를 출력하기 위하여 $list로 가공된 정보를 복사 및 가공
function get_list($write_row, $board, $skin_path, $subject_len=40)
수정후:
// 게시물 정보($write_row)를 출력하기 위하여 $list로 가공된 정보를 복사 및 가공
function get_list($write_row, $board, $skin_path, $subject_len=40, $new_comm=array())
위의 라인을 수정후
아래로 조금내리면 아래의 소스를 수정합니다.
// 원본 :
$list[icon_new] = "";
if ($list[wr_datetime] >= date("Y-m-d H:i:s", $g4[server_time] - ($board[bo_new] * 3600)))
// 수정후:
$list[icon_new] = "";
if ($list[wr_datetime] >= date("Y-m-d H:i:s", $g4[server_time] - ($board[bo_new] * 3600)) || in_array($list[wr_id], $new_comm))
===================================================끝
그러면 새글이 달릴때 뜨던 뉴아이콘이... 새 코멘트가 달릴때도 뜨게 됩니다.
새글인지 새코멘트인지 꼭 구분을 해야 하는 경우가 아니라면 이렇게 써도 무방한 분들이 있을지 모르겠습니다.
조건을 조금 더 세분화 하면 뉴아이콘을 새글일때와 새코멘트일때로 구분해서 함께 표시할 수 있겠네요.
13년 전
감사합니다.
게시판 목록
그누4 팁자료실
그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.
나누면 즐거움이 커집니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 3309 | 3년 전 | 1807 | ||
| 3308 | 11년 전 | 2093 | ||
| 3307 |
uPAmJ903
|
6년 전 | 4753 | |
| 3306 |
바른사나이
|
6년 전 | 3274 | |
| 3305 | 6년 전 | 12312 | ||
| 3304 | 7년 전 | 3705 | ||
| 3303 | 7년 전 | 3745 | ||
| 3302 |
지리산초보
|
7년 전 | 13597 | |
| 3301 |
sozet
|
8년 전 | 4905 | |
| 3300 |
sozet
|
8년 전 | 5974 | |
| 3299 |
sozet
|
8년 전 | 10863 | |
| 3298 | 8년 전 | 4017 | ||
| 3297 |
또치하우스
|
8년 전 | 4444 | |
| 3296 | 8년 전 | 11972 | ||
| 3295 |
또치하우스
|
8년 전 | 14988 | |
| 3294 | 8년 전 | 6028 | ||
| 3293 | 8년 전 | 5593 | ||
| 3292 |
|
9년 전 | 5320 | |
| 3291 | 9년 전 | 13683 | ||
| 3290 | 9년 전 | 5055 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기