Else/- Computer

일반 게시판 코멘트 색깔 바꾸기

unisty 2010. 2. 12. 20:57
http://www.xpressengine.com/831145제로보드

1. include/list_check.php파일을 엽니다.

2. 7째줄정도에 아래와 같이 $t_comment; 를 추가시킵니다.
=============================================
function list_check(&$data,$view_check=0) {
global         $keyword, $sn, $ss, $sc, $setup, $member, $href, $id, $dir, $category_data, $is_admin, $_zbResizeCheck,-중간생략--$_listCheckTime, $t_comment;
=======================================================

3.  $comment_num="[".$data[total_comment]."]"; //간단한 답글 수 -->이부분을 찾아 주석처리해줍니다.
// $comment_num="[".$data[total_comment]."]"; //간단한 답글 수

4. 3번 주석처리 한 다음 줄에 아래 소스를 붙입니다.
font color=red 이부분에서 색깔 변경할 수 있구요.
style이하부분은 가장최근코멘트가 툴팁으로 뜹니다.
===============================================================
/* 새로운 코멘트 표시  */
$last_comment = mysql_fetch_array(mysql_query("select * from $t_comment"."_$id where parent='$data[no]' order by reg_date desc limit 1"));
$last_comment_time = $last_comment['reg_date'];
if(time()-$last_comment_time<60*60*12) $comment_num = "<font color=red style="cursor:hand" title="".cut_str(stripslashes($last_comment['memo']),$textlen)."">[".$data[total_comment]."]</font>";
elseif(time()-$last_comment_time<60*60*24) $comment_num = "<font color=green style="cursor:hand" title="".cut_str(stripslashes($last_comment['memo']),$textlen)."">[".$data[total_comment]."]</font>";
else $comment_num = "[".$data[total_comment]."]";


===============================================================
저는 요렇게 바꿔서 사용합니다.

/* 새로운 코멘트 표시 */
$last_comment = mysql_fetch_array(mysql_query("select * from $t_comment"."_$id where parent='$data[no]' order by reg_date desc limit 1"));
$last_comment_time = $last_comment['reg_date'];
if(time()-$last_comment_time<60*60*24) $comment_num = "<font color=red size=3 style="cursor:hand" title="".cut_str(stripslashes($last_comment['memo']),$textlen).""><b>[".$data[total_comment]."]+</font></b>";
elseif(time()-$last_comment_time<60*60*48) $comment_num = "<font color=green size=3 style="cursor:hand" title="".cut_str(stripslashes($last_comment['memo']),$textlen).""><b>[".$data[total_comment]."]+</font></b>";